Skip to contentSkip to conversation

Add cache configuration for Microchip SAMA7D and SAMA7G MPUs

PATCH Applied Mihai Sain 2 participants 4 messages Jun 19, 2025 – Jul 10, 2025

Subsystems (2)
lore
Share & tools
lore

Mihai Sain

author
#0 lore raw

v3 cover Add cache configuration for Microchip SAMA7D and SAMA7G MPUs

This patch series adds cache configuration for Microchip SAMA7D and SAMA7G MPUs. The cache configuration is described in datasheet chapter 15.2.

Changelog:

v2 -> v3:
- Remove the l1-cache node
- Move the L1 cache properties in the cpu node
- Align with device node requirements for cpu:
https://devicetree-specification.readthedocs.io/en/latest/chapter3-devicenodes.html#internal-l1-cache-properties

v1 -> v2:
- Remove the cache-unified property from l1-cache node

Mihai Sain (2):
ARM: dts: microchip: sama7d65: Add cache configuration for cpu node
ARM: dts: microchip: sama7g5: Add cache configuration for cpu node

 arch/arm/boot/dts/microchip/sama7d65.dtsi | 10 ++++++++++
 arch/arm/boot/dts/microchip/sama7g5.dtsi  | 10 ++++++++++
 2 files changed, 20 insertions(+)

base-commit: fb4d33ab452ea254e2c319bac5703d1b56d895bf

Signature · 1 line
2.50.0
author
#1 lore raw

PATCH v3 1/2 ARM: dts: microchip: sama7d65: Add cache configuration for cpu node

Describe the cache memories according with datasheet chapter 15.2:

- L1 cache configuration with 32KB for both data and instruction cache.
- L2 cache configuration with 256KB unified cache.

Before this patch the kernel reported the warning:

[    0.161955] cacheinfo: Unable to detect cache hierarchy for CPU 0
---
 arch/arm/boot/dts/microchip/sama7d65.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/microchip/sama7d65.dtsi +10 -0
index d08d773b1cc5..f123faaa2ef7 100644
@@ -32,6 +32,16 @@ cpu0: cpu@0 {
 			device_type = "cpu";
 			clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
 			clock-names = "cpu";
+			d-cache-size = <0x8000>;	// L1, 32 KB
+			i-cache-size = <0x8000>;	// L1, 32 KB
+			next-level-cache = <&L2>;
+
+			L2: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-size = <0x40000>; // L2, 256 KB
+				cache-unified;
+			};
 		};
 	};
 
Signature · 1 line
2.50.0
author
#2 lore raw

PATCH v3 2/2 ARM: dts: microchip: sama7g5: Add cache configuration for cpu node

In reply to Mihai Sain

Describe the cache memories according with datasheet chapter 15.2:

- L1 cache configuration with 32KB for both data and instruction cache.
- L2 cache configuration with 256KB unified cache.

Before this patch the kernel reported the warning:

[    0.171425] cacheinfo: Unable to detect cache hierarchy for CPU 0
---
 arch/arm/boot/dts/microchip/sama7g5.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/microchip/sama7g5.dtsi +10 -0
index 17bcdcf0cf4a..f28bcf6daf4e 100644
@@ -38,6 +38,16 @@ cpu0: cpu@0 {
 			clock-names = "cpu";
 			operating-points-v2 = <&cpu_opp_table>;
 			#cooling-cells = <2>; /* min followed by max */
+			d-cache-size = <0x8000>;	// L1, 32 KB
+			i-cache-size = <0x8000>;	// L1, 32 KB
+			next-level-cache = <&L2>;
+
+			L2: l2-cache {
+				compatible = "cache";
+				cache-level = <2>;
+				cache-size = <0x40000>; // L2, 256 KB
+				cache-unified;
+			};
 		};
 	};
 
Signature · 1 line
2.50.0
maintainer Applied
#3 lore raw
In reply to Mihai Sain
Quoted 3 lines · Mihai Sain

Mihai Sain (2):
ARM: dts: microchip: sama7d65: Add cache configuration for cpu node
ARM: dts: microchip: sama7g5: Add cache configuration for cpu node

Applied to at91-dt, thanks!