Skip to contentSkip to conversation

arm64: dts: add cpu cache information to ExynosAuto-v920

PATCH Applied Devang Tailor 5 participants 8 messages Jan 8, 2025 – Feb 17, 2025 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20250108054224epcas5p399f3d734f8d9f82e5ae75d183d1a5344@epcas5p3.samsung.com

#1 lore raw

PATCH v2 1/1 arm64: dts: add cpu cache information to ExynosAuto-v920

Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 64/64 KB I/D cache and 256KB of L2 cache for each core, 2 MB of shared L3 cache for each quad cpu cluster and 1 MB of shared L3 cache for the dual cpu cluster.

---
Changes in v2:
- Added L3 cache for all the three cpu clusters
- Corrected L2 cache numbering as a part of review comments from Krzysztof
and updated as per cpus clusters.
- Link to v1: https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/

---
 .../arm64/boot/dts/exynos/exynosautov920.dtsi | 127 ++++++++++++++++++
 1 file changed, 127 insertions(+)
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +127 -0
index eb446cdc4ab6..a3fd503c1b21 100644
@@ -89,6 +89,13 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x0>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl0>;
 		};
 
 		cpu1: cpu@100 {
@@ -96,6 +103,13 @@ cpu1: cpu@100 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x100>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl0>;
 		};
 
 		cpu2: cpu@200 {
@@ -103,6 +117,13 @@ cpu2: cpu@200 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x200>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl0>;
 		};
 
 		cpu3: cpu@300 {
@@ -110,6 +131,13 @@ cpu3: cpu@300 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x300>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl0>;
 		};
 
 		cpu4: cpu@10000 {
@@ -117,6 +145,13 @@ cpu4: cpu@10000 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x10000>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl1>;
 		};
 
 		cpu5: cpu@10100 {
@@ -124,6 +159,13 @@ cpu5: cpu@10100 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x10100>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl1>;
 		};
 
 		cpu6: cpu@10200 {
@@ -131,6 +173,13 @@ cpu6: cpu@10200 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x10200>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl1>;
 		};
 
 		cpu7: cpu@10300 {
@@ -138,6 +187,13 @@ cpu7: cpu@10300 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x10300>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl1>;
 		};
 
 		cpu8: cpu@20000 {
@@ -145,6 +201,13 @@ cpu8: cpu@20000 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x20000>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl2>;
 		};
 
 		cpu9: cpu@20100 {
@@ -152,6 +215,70 @@ cpu9: cpu@20100 {
 			compatible = "arm,cortex-a78ae";
 			reg = <0x0 0x20100>;
 			enable-method = "psci";
+			i-cache-size = <0x10000>;
+			i-cache-line-size = <64>;
+			i-cache-sets = <256>;
+			d-cache-size = <0x10000>;
+			d-cache-line-size = <64>;
+			d-cache-sets = <256>;
+			next-level-cache = <&l2_cache_cl2>;
+		};
+
+		l2_cache_cl0: l2-cache0 {
+			compatible = "cache";
+			cache-level = <2>;
+			cache-unified;
+			cache-size = <0x40000>;
+			cache-line-size = <64>;
+			cache-sets = <512>;
+			next-level-cache = <&l3_cache_cl0>;
+		};
+
+		l2_cache_cl1: l2-cache1 {
+			compatible = "cache";
+			cache-level = <2>;
+			cache-unified;
+			cache-size = <0x40000>;
+			cache-line-size = <64>;
+			cache-sets = <512>;
+			next-level-cache = <&l3_cache_cl1>;
+		};
+
+		l2_cache_cl2: l2-cache2 {
+			compatible = "cache";
+			cache-level = <2>;
+			cache-unified;
+			cache-size = <0x40000>;
+			cache-line-size = <64>;
+			cache-sets = <512>;
+			next-level-cache = <&l3_cache_cl2>;
+		};
+
+		l3_cache_cl0: l3-cache0 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <0x200000>;/* 2MB L3 cache for cpu cluster-0 */
+			cache-line-size = <64>;
+			cache-sets = <2048>;
+		};
+
+		l3_cache_cl1: l3-cache1 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <0x200000>;/* 2MB L3 cache for cpu cluster-1 */
+			cache-line-size = <64>;
+			cache-sets = <2048>;
+		};
+
+		l3_cache_cl2: l3-cache2 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <0x100000>;/* 1MB L3 cache for cpu cluster-2 */
+			cache-line-size = <64>;
+			cache-sets = <1365>;
 		};
 	};
 
Signature · 1 line
2.34.1
reviewer
#2 lore raw

Hi Devang

Quoted 30 lines

-----Original Message-----
From: Devang Tailor <[email protected]>
Sent: Wednesday, January 8, 2025 11:20 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]
Subject: [PATCH v2] arm64: dts: add cpu cache information to ExynosAuto- v920

Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 64/64 KB I/D cache and 256KB of L2 cache for each core, 2 MB of shared L3 cache for each quad cpu cluster and 1 MB of shared L3 cache for the dual cpu cluster.

---
Changes in v2:
- Added L3 cache for all the three cpu clusters
- Corrected L2 cache numbering as a part of review comments from Krzysztof and updated as per cpus clusters.
- Link to v1: https://patchwork.kernel.org/project/linux-arm-
kernel/patch/[email protected]/

---
 .../arm64/boot/dts/exynos/exynosautov920.dtsi | 127
++++++++++++++++++
 1 file changed, 127 insertions(+)

[snip]

arch/arm64/boot/dts/exynos/exynosautov920.dtsi cpu9: cpu@20100 { · line 257

Quoted 1 line
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl0: l3-cache0 {

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

Quoted 19 lines
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +4 -0
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <0x200000>;/* 2MB L3 cache for cpu

cluster-0 */

arch/arm64/boot/dts/exynos/exynosautov920.dtsi +9 -0
+			cache-line-size = <64>;
+			cache-sets = <2048>;
+		};
+
+		l3_cache_cl1: l3-cache1 {
+			compatible = "cache";
+			cache-level = <3>;
+			cache-unified;
+			cache-size = <0x200000>;/* 2MB L3 cache for cpu

cluster-1 */

arch/arm64/boot/dts/exynos/exynosautov920.dtsi +4 -0
+			cache-line-size = <64>;
+			cache-sets = <2048>;
+		};
+

[snip]

Quoted 2 lines
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl2: l3-cache2 {

2.34.1

#3 lore raw
Quoted 22 lines · Alim Akhtar

Hi Devang

Quoted 15 lines

Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 64/64 KB I/D cache and 256KB of L2 cache for each core, 2 MB of shared L3 cache for each quad cpu cluster and 1 MB of shared L3 cache for the dual cpu cluster.

---
Changes in v2:
- Added L3 cache for all the three cpu clusters
- Corrected L2 cache numbering as a part of review comments from Krzysztof and updated as per cpus clusters.
- Link to v1: https://patchwork.kernel.org/project/linux-arm-
kernel/patch/[email protected]/

Quoted 5 lines
---
 .../arm64/boot/dts/exynos/exynosautov920.dtsi | 127
++++++++++++++++++
 1 file changed, 127 insertions(+)
Quoted 5 lines

[snip]

arch/arm64/boot/dts/exynos/exynosautov920.dtsi cpu9: cpu@20100 { · line 257

Quoted 1 line
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl0: l3-cache0 {

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

What do you mean by "both are same" ?
Do you mean both have exact same properties but are physically different caches ? OR
Do you mean it is just one shared cache ?

If former, we still need distinct node to get the cacheinfo about shareability correct. If this is about avoiding duplication of errors, you can probably define some macro and avoid it, but we need 2 nodes in the devicetree.

If latter, you suggestion is correct.

--
Regards,
Sudeep

#4 lore raw
Quoted 12 lines · Sudeep Holla
Quoted 6 lines
Quoted 1 line

[snip]

arch/arm64/boot/dts/exynos/exynosautov920.dtsi cpu9: cpu@20100 { · line 257

Quoted 1 line
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl0: l3-cache0 {

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

What do you mean by "both are same" ?
Do you mean both have exact same properties but are physically different caches ? OR
Do you mean it is just one shared cache ?

Quoted 6 lines

If former, we still need distinct node to get the cacheinfo about shareability correct. If this is about avoiding duplication of errors, you can probably define some macro and avoid it, but we need 2 nodes in the devicetree.

If latter, you suggestion is correct.

No answers here, so I drop this patch from my queue.

Best regards,
Krzysztof

reviewer
#5 lore raw

Hi Krzysztof

Quoted 24 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Wednesday, February 5, 2025 9:22 PM
To: Sudeep Holla <[email protected]>; Alim Akhtar <[email protected]>
Cc: 'Devang Tailor' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2] arm64: dts: add cpu cache information to ExynosAuto-v920

Quoted 11 lines · Sudeep Holla
Quoted 6 lines
Quoted 1 line

[snip]

arch/arm64/boot/dts/exynos/exynosautov920.dtsi cpu9: cpu@20100 { · line 257

Quoted 1 line
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl0: l3-cache0 {

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

What do you mean by "both are same" ?
Do you mean both have exact same properties but are physically different caches ? OR Do you mean it is just one shared cache ?

Quoted 9 lines
Quoted 6 lines

If former, we still need distinct node to get the cacheinfo about shareability correct. If this is about avoiding duplication of errors, you can probably define some macro and avoid it, but we need 2 nodes in the devicetree.

If latter, you suggestion is correct.

No answers here, so I drop this patch from my queue.

It took sometime to get the confirmation internally (because of new year holiday) Just replied to Sudeep. It will be great if you can consider this patch for this cycle. Thanks!

Quoted 2 lines

Best regards,
Krzysztof

#6 lore raw

Hi Krzysztof,

Quoted 44 lines

-----Original Message-----
From: Alim Akhtar <[email protected]>
Sent: 05 February 2025 21:41
To: 'Krzysztof Kozlowski' <[email protected]>; 'Sudeep Holla' <[email protected]>
Cc: 'Devang Tailor' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: RE: [PATCH v2] arm64: dts: add cpu cache information to ExynosAuto- v920

Hi Krzysztof

Quoted 30 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Wednesday, February 5, 2025 9:22 PM
To: Sudeep Holla <[email protected]>; Alim Akhtar <[email protected]>
Cc: 'Devang Tailor' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2] arm64: dts: add cpu cache information to ExynosAuto-v920

Quoted 16 lines · Sudeep Holla
Quoted 6 lines
Quoted 1 line

[snip]

arch/arm64/boot/dts/exynos/exynosautov920.dtsi cpu9: cpu@20100 { · line 257

Quoted 1 line
arch/arm64/boot/dts/exynos/exynosautov920.dtsi +1 -0
+		l3_cache_cl0: l3-cache0 {

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

What do you mean by "both are same" ?
Do you mean both have exact same properties but are physically different caches ? OR Do you mean it is just one shared cache ?

If former, we still need distinct node to get the cacheinfo about shareability correct. If this is about avoiding duplication of errors, you can probably define some macro and avoid it, but we need 2 nodes in the devicetree.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

If latter, you suggestion is correct.

No answers here, so I drop this patch from my queue.

It took sometime to get the confirmation internally (because of new year holiday) Just replied to Sudeep. It will be great if you can consider this patch for this cycle.
Thanks!

Is there anything else need to be done for this patch or do you suggest me to re-send this patch again?

Quoted 2 lines
Quoted 2 lines

Best regards,
Krzysztof

reviewer Reviewed-by
#7 lore raw
In reply to Sudeep Holla

Hi Sudeep

Quoted 11 lines

-----Original Message-----
From: Sudeep Holla <[email protected]>
Sent: Friday, January 31, 2025 6:57 PM
To: Alim Akhtar <[email protected]>
Cc: 'Devang Tailor' <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2] arm64: dts: add cpu cache information to ExynosAuto-v920

[snip]

Quoted 8 lines
Quoted 3 lines

You can add one node for cl0 and cl1, say "l3_cache_cl0_cl1" and Remove the specific node for CL1, because both are same.

What do you mean by "both are same" ?
Do you mean both have exact same properties but are physically different caches ? OR Do you mean it is just one shared cache ?

Thanks for review and pointing it out, v920 has physically different caches (two of them are same properties, but the 3rd has 1MB lesser size) Got you point about having distinct node for cacheinfo population So for this patch:

Quoted 1 line

If former, we still need distinct node to get the cacheinfo about

shareability

Quoted 1 line

correct. If this is about avoiding duplication of errors, you can probably

define

Quoted 7 lines

some macro and avoid it, but we need 2 nodes in the devicetree.

If latter, you suggestion is correct.

--
Regards,
Sudeep

#8 lore raw
In reply to Devang Tailor
Quoted 6 lines · Devang Tailor

Add CPU caches information to its dt nodes so that the same is available to userspace via sysfs. This SoC has 64/64 KB I/D cache and 256KB of L2 cache for each core, 2 MB of shared L3 cache for each quad cpu cluster and 1 MB of shared L3 cache for the dual cpu cluster.

Applied, thanks!

[1/1] arm64: dts: add cpu cache information to ExynosAuto-v920

      https://git.kernel.org/krzk/linux/c/bbfc70ca7fd26ee3e7eb16872cf7b1f1be5907e3

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>