Skip to contentSkip to conversation

ARM: dts: bcm2835/6: Add the missing L1/L2 cache information

PATCH Applied Richard Schleich 2 participants 2 messages Feb 5, 2022 – Feb 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: bcm2835/6: Add the missing L1/L2 cache information

This patch adds the cache info for the BCM2835 and BCM2836. However, while testing I noticed that this is
not implemented for ARMv6/7.
Basically arch/arm/kernel/cacheinfo.c and other topology related code is missing.
Since the work is already done and this has no negative effects, I am submitting it for future/documentation purposes.

---
 arch/arm/boot/dts/bcm2835.dtsi | 17 ++++++++++++
 arch/arm/boot/dts/bcm2836.dtsi | 50 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
arch/arm/boot/dts/bcm2835.dtsi +17 -0
index 0549686134ea..1c90e5a44283 100644
@@ -14,6 +14,23 @@ cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,arm1176jzf-s";
 			reg = <0x0>;
+			/* Source for d/i-cache-line-size and d/i-cache-sets
+			 * https://developer.arm.com/documentation/ddi0301
+			 * /h/level-one-memory-system/cache-organization?lang=en
+			 *
+			 * Source for d/i-cache-size
+			 * https://forums.raspberrypi.com/viewtopic.php?t=98428
+			 *
+			 * NOTE: The BCM2835 has a L2 cache but it is dedicated to the GPU
+			 * It can be shared with the CPU through fw settings,
+			 * but this is not recommended.
+			 */
+			d-cache-size = <0x4000>;
+			d-cache-line-size = <16>;
+			d-cache-sets = <256>; // 16KiB(size)/16(line-size)=1024ways/4-way set
+			i-cache-size = <0x4000>;
+			i-cache-line-size = <16>;
+			i-cache-sets = <256>; // 16KiB(size)/16(line-size)=1024ways/4-way set
 		};
 	};
 
arch/arm/boot/dts/bcm2836.dtsi +50 -0

79 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw
Quoted 10 lines · Richard Schleich

This patch adds the cache info for the BCM2835 and BCM2836. However, while testing I noticed that this is
not implemented for ARMv6/7.
Basically arch/arm/kernel/cacheinfo.c and other topology related code is missing.
Since the work is already done and this has no negative effects, I am submitting it for future/documentation purposes.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian