Skip to content

Commit 7360e75

Browse files
Dragan Simicwens
authored andcommitted
arm64: dts: allwinner: Add cache information to the SoC dtsi for A64
Add missing cache information to the Allwinner A64 SoC dtsi, to allow the userspace, which includes lscpu(1) that uses the virtual files provided by the kernel under the /sys/devices/system/cpu directory, to display the proper A64 cache information. While there, use a more self-descriptive label for the L2 cache node, which also makes it more consistent with other SoC dtsi files. The cache parameters for the A64 dtsi were obtained and partially derived by hand from the cache size and layout specifications found in the following datasheets and technical reference manuals: - Allwinner A64 datasheet, version 1.1 - ARM Cortex-A53 revision r0p3 TRM, version E For future reference, here's a brief summary of the documentation: - All caches employ the 64-byte cache line length - Each Cortex-A53 core has 32 KB of L1 2-way, set-associative instruction cache and 32 KB of L1 4-way, set-associative data cache - The entire SoC has 512 KB of unified L2 16-way, set-associative cache Signed-off-by: Dragan Simic <[email protected]> Reviewed-by: Jernej Skrabec <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Link: https://lore.kernel.org/r/6a772756c2c677dbdaaab4a2c71a358d8e4b27e9.1714304058.git.dsimic@manjaro.org Signed-off-by: Chen-Yu Tsai <[email protected]>
1 parent 523bfa3 commit 7360e75

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,49 +51,76 @@
5151
device_type = "cpu";
5252
reg = <0>;
5353
enable-method = "psci";
54-
next-level-cache = <&L2>;
5554
clocks = <&ccu CLK_CPUX>;
5655
clock-names = "cpu";
5756
#cooling-cells = <2>;
57+
i-cache-size = <0x8000>;
58+
i-cache-line-size = <64>;
59+
i-cache-sets = <256>;
60+
d-cache-size = <0x8000>;
61+
d-cache-line-size = <64>;
62+
d-cache-sets = <128>;
63+
next-level-cache = <&l2_cache>;
5864
};
5965

6066
cpu1: cpu@1 {
6167
compatible = "arm,cortex-a53";
6268
device_type = "cpu";
6369
reg = <1>;
6470
enable-method = "psci";
65-
next-level-cache = <&L2>;
6671
clocks = <&ccu CLK_CPUX>;
6772
clock-names = "cpu";
6873
#cooling-cells = <2>;
74+
i-cache-size = <0x8000>;
75+
i-cache-line-size = <64>;
76+
i-cache-sets = <256>;
77+
d-cache-size = <0x8000>;
78+
d-cache-line-size = <64>;
79+
d-cache-sets = <128>;
80+
next-level-cache = <&l2_cache>;
6981
};
7082

7183
cpu2: cpu@2 {
7284
compatible = "arm,cortex-a53";
7385
device_type = "cpu";
7486
reg = <2>;
7587
enable-method = "psci";
76-
next-level-cache = <&L2>;
7788
clocks = <&ccu CLK_CPUX>;
7889
clock-names = "cpu";
7990
#cooling-cells = <2>;
91+
i-cache-size = <0x8000>;
92+
i-cache-line-size = <64>;
93+
i-cache-sets = <256>;
94+
d-cache-size = <0x8000>;
95+
d-cache-line-size = <64>;
96+
d-cache-sets = <128>;
97+
next-level-cache = <&l2_cache>;
8098
};
8199

82100
cpu3: cpu@3 {
83101
compatible = "arm,cortex-a53";
84102
device_type = "cpu";
85103
reg = <3>;
86104
enable-method = "psci";
87-
next-level-cache = <&L2>;
88105
clocks = <&ccu CLK_CPUX>;
89106
clock-names = "cpu";
90107
#cooling-cells = <2>;
108+
i-cache-size = <0x8000>;
109+
i-cache-line-size = <64>;
110+
i-cache-sets = <256>;
111+
d-cache-size = <0x8000>;
112+
d-cache-line-size = <64>;
113+
d-cache-sets = <128>;
114+
next-level-cache = <&l2_cache>;
91115
};
92116

93-
L2: l2-cache {
117+
l2_cache: l2-cache {
94118
compatible = "cache";
95119
cache-level = <2>;
96120
cache-unified;
121+
cache-size = <0x80000>;
122+
cache-line-size = <64>;
123+
cache-sets = <512>;
97124
};
98125
};
99126

0 commit comments

Comments
 (0)