arm64: dts: apple: Add t8103 L1/L2 cache properties and nodes
authorJanne Grunau <j@jannau.net>
Tue, 6 Dec 2022 22:38:46 +0000 (23:38 +0100)
committerHector Martin <marcan@marcan.st>
Wed, 7 Dec 2022 01:17:18 +0000 (10:17 +0900)
The t8103 CPU nodes are missing the cache hierarchy information. The
cache hierarchy on Arm can not be detected and needs to be described in
DT. The OS scheduler can make use of this information for scheduling
decisions.

The cache size information is based on various articles about the
processors. There's also an L3 system level cache (SLC). It's not
described here because SLCs typically have some MMIO interface which
would need to be described.

Based on Rob Herring's patch adding cache properties and nodes for
t600x.

Link: https://lore.kernel.org/asahi/20221122220619.659174-1-robh@kernel.org/
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Hector Martin <marcan@marcan.st>
arch/arm64/boot/dts/apple/t8103.dtsi

index 264bd0bae56749659304855d0632441092bae047..9859219699f4522224059e8957b16e52848a470c 100644 (file)
@@ -63,6 +63,9 @@
                        operating-points-v2 = <&ecluster_opp>;
                        capacity-dmips-mhz = <714>;
                        performance-domains = <&cpufreq_e>;
+                       next-level-cache = <&l2_cache_0>;
+                       i-cache-size = <0x20000>;
+                       d-cache-size = <0x10000>;
                };
 
                cpu_e1: cpu@1 {
@@ -74,6 +77,9 @@
                        operating-points-v2 = <&ecluster_opp>;
                        capacity-dmips-mhz = <714>;
                        performance-domains = <&cpufreq_e>;
+                       next-level-cache = <&l2_cache_0>;
+                       i-cache-size = <0x20000>;
+                       d-cache-size = <0x10000>;
                };
 
                cpu_e2: cpu@2 {
@@ -85,6 +91,9 @@
                        operating-points-v2 = <&ecluster_opp>;
                        capacity-dmips-mhz = <714>;
                        performance-domains = <&cpufreq_e>;
+                       next-level-cache = <&l2_cache_0>;
+                       i-cache-size = <0x20000>;
+                       d-cache-size = <0x10000>;
                };
 
                cpu_e3: cpu@3 {
                        operating-points-v2 = <&ecluster_opp>;
                        capacity-dmips-mhz = <714>;
                        performance-domains = <&cpufreq_e>;
+                       next-level-cache = <&l2_cache_0>;
+                       i-cache-size = <0x20000>;
+                       d-cache-size = <0x10000>;
                };
 
                cpu_p0: cpu@10100 {
                        operating-points-v2 = <&pcluster_opp>;
                        capacity-dmips-mhz = <1024>;
                        performance-domains = <&cpufreq_p>;
+                       next-level-cache = <&l2_cache_1>;
+                       i-cache-size = <0x30000>;
+                       d-cache-size = <0x20000>;
                };
 
                cpu_p1: cpu@10101 {
                        operating-points-v2 = <&pcluster_opp>;
                        capacity-dmips-mhz = <1024>;
                        performance-domains = <&cpufreq_p>;
+                       next-level-cache = <&l2_cache_1>;
+                       i-cache-size = <0x30000>;
+                       d-cache-size = <0x20000>;
                };
 
                cpu_p2: cpu@10102 {
                        operating-points-v2 = <&pcluster_opp>;
                        capacity-dmips-mhz = <1024>;
                        performance-domains = <&cpufreq_p>;
+                       next-level-cache = <&l2_cache_1>;
+                       i-cache-size = <0x30000>;
+                       d-cache-size = <0x20000>;
                };
 
                cpu_p3: cpu@10103 {
                        operating-points-v2 = <&pcluster_opp>;
                        capacity-dmips-mhz = <1024>;
                        performance-domains = <&cpufreq_p>;
+                       next-level-cache = <&l2_cache_1>;
+                       i-cache-size = <0x30000>;
+                       d-cache-size = <0x20000>;
+               };
+
+               l2_cache_0: l2-cache-0 {
+                       compatible = "cache";
+                       cache-level = <2>;
+                       cache-unified;
+                       cache-size = <0x400000>;
+               };
+
+               l2_cache_1: l2-cache-1 {
+                       compatible = "cache";
+                       cache-level = <2>;
+                       cache-unified;
+                       cache-size = <0xc00000>;
                };
        };