Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Richard Schleich <rs@noreya.tech>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

authored by

Richard Schleich and committed by
Florian Fainelli
4c9b2507 618682b3

+67
+17
arch/arm/boot/dts/bcm2835.dtsi
··· 14 14 device_type = "cpu"; 15 15 compatible = "arm,arm1176jzf-s"; 16 16 reg = <0x0>; 17 + /* Source for d/i-cache-line-size and d/i-cache-sets 18 + * https://developer.arm.com/documentation/ddi0301 19 + * /h/level-one-memory-system/cache-organization?lang=en 20 + * 21 + * Source for d/i-cache-size 22 + * https://forums.raspberrypi.com/viewtopic.php?t=98428 23 + * 24 + * NOTE: The BCM2835 has a L2 cache but it is dedicated to the GPU 25 + * It can be shared with the CPU through fw settings, 26 + * but this is not recommended. 27 + */ 28 + d-cache-size = <0x4000>; 29 + d-cache-line-size = <16>; 30 + d-cache-sets = <256>; // 16KiB(size)/16(line-size)=1024ways/4-way set 31 + i-cache-size = <0x4000>; 32 + i-cache-line-size = <16>; 33 + i-cache-sets = <256>; // 16KiB(size)/16(line-size)=1024ways/4-way set 17 34 }; 18 35 }; 19 36
+50
arch/arm/boot/dts/bcm2836.dtsi
··· 41 41 #size-cells = <0>; 42 42 enable-method = "brcm,bcm2836-smp"; 43 43 44 + /* Source for d/i-cache-line-size and d/i-cache-sets 45 + * https://developer.arm.com/documentation/ddi0464/f/L1-Memory-System 46 + * /About-the-L1-memory-system?lang=en 47 + * 48 + * Source for d/i-cache-size 49 + * https://forums.raspberrypi.com/viewtopic.php?t=98428 50 + */ 51 + 44 52 v7_cpu0: cpu@0 { 45 53 device_type = "cpu"; 46 54 compatible = "arm,cortex-a7"; 47 55 reg = <0xf00>; 48 56 clock-frequency = <800000000>; 57 + d-cache-size = <0x8000>; 58 + d-cache-line-size = <64>; 59 + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set 60 + i-cache-size = <0x8000>; 61 + i-cache-line-size = <32>; 62 + i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set 63 + next-level-cache = <&l2>; 49 64 }; 50 65 51 66 v7_cpu1: cpu@1 { ··· 68 53 compatible = "arm,cortex-a7"; 69 54 reg = <0xf01>; 70 55 clock-frequency = <800000000>; 56 + d-cache-size = <0x8000>; 57 + d-cache-line-size = <64>; 58 + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set 59 + i-cache-size = <0x8000>; 60 + i-cache-line-size = <32>; 61 + i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set 62 + next-level-cache = <&l2>; 71 63 }; 72 64 73 65 v7_cpu2: cpu@2 { ··· 82 60 compatible = "arm,cortex-a7"; 83 61 reg = <0xf02>; 84 62 clock-frequency = <800000000>; 63 + d-cache-size = <0x8000>; 64 + d-cache-line-size = <64>; 65 + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set 66 + i-cache-size = <0x8000>; 67 + i-cache-line-size = <32>; 68 + i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set 69 + next-level-cache = <&l2>; 85 70 }; 86 71 87 72 v7_cpu3: cpu@3 { ··· 96 67 compatible = "arm,cortex-a7"; 97 68 reg = <0xf03>; 98 69 clock-frequency = <800000000>; 70 + d-cache-size = <0x8000>; 71 + d-cache-line-size = <64>; 72 + d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set 73 + i-cache-size = <0x8000>; 74 + i-cache-line-size = <32>; 75 + i-cache-sets = <512>; // 32KiB(size)/32(line-size)=1024ways/2-way set 76 + next-level-cache = <&l2>; 77 + }; 78 + 79 + /* Source for cache-line-size + cache-sets 80 + * https://developer.arm.com/documentation/ddi0464/f/L2-Memory-System 81 + * /About-the-L2-Memory-system?lang=en 82 + * Source for cache-size 83 + * https://forums.raspberrypi.com/viewtopic.php?t=98428 84 + */ 85 + l2: l2-cache0 { 86 + compatible = "cache"; 87 + cache-size = <0x80000>; 88 + cache-line-size = <64>; 89 + cache-sets = <1024>; // 512KiB(size)/64(line-size)=8192ways/8-way set 90 + cache-level = <2>; 99 91 }; 100 92 }; 101 93 };