Skip to contentSkip to conversation

ARM: bcm281xx: Add L2 support for Rev A2 chips

PATCH In review Christian Daudt 4 participants 6 messages May 3, 2013 – May 10, 2013

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

PATCH v2 1/1 ARM: bcm281xx: Add L2 support for Rev A2 chips

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

Documentation/devicetree/bindings/arm/l2cc.txt +3 -0
index cbef09b..69ddf9f 100644
@@ -16,6 +16,9 @@ Required properties:
      performs the same operation).
 	"marvell,"aurora-outer-cache: Marvell Controller designed to be
 	 compatible with the ARM one with outer cache mode.
+	"bcm,bcm11351-a2-pl310-cache": For Broadcom bcm11351 chipset where an
+	offset needs to be added to the address before passing down to the L2
+	cache controller
 - cache-unified : Specifies the cache is a unified cache.
 - cache-level : Should be set to 2 for a level 2 cache.
 - reg : Physical base address and size of cache controller's memory mapped
arch/arm/boot/dts/bcm11351.dtsi +4 -4
index 41b2c6c..5e48c85 100644
@@ -47,10 +47,10 @@
 	};
 
 	L2: l2-cache {
-		    compatible = "arm,pl310-cache";
-		    reg = <0x3ff20000 0x1000>;
-		    cache-unified;
-		    cache-level = <2>;
+		compatible = "bcm,bcm11351-a2-pl310-cache";
+		reg = <0x3ff20000 0x1000>;
+		cache-unified;
+		cache-level = <2>;
 	};
 
 	timer at 35006000 {
arch/arm/mm/cache-l2x0.c +158 -0

176 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

Hi Christian,

Quoted 10 lines · Christian Daudt

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

Looking much better now :)

Quoted 7 lines
arch/arm/mm/cache-l2x0.c +0 -0
index c465fac..d70e0ab 100644
@@ -523,6 +523,147 @@ static void aurora_flush_range(unsigned long start, unsigned long end)
 	}
 }

arch/arm/mm/cache-l2x0.c static void aurora_flush_range(unsigned long start, unsigned long end) · line 534

Quoted 10 lines
arch/arm/mm/cache-l2x0.c +9 -0
 
+/*
+ * For certain Broadcom SoCs, depending on the address range, different offsets
+ * need to be added to the address before passing it to L2 for
+ * invalidation/clean/flush
+ *
+ * Section Address Range              Offset        EMI
+ *   1     0x00000000 - 0x3FFFFFFF    0x80000000    VC
+ *   2     0x40000000 - 0xBFFFFFFF    0x40000000    SYS
+ *   3     0xC0000000 - 0xFFFFFFFF    0x80000000    VC

I don't think you answered last time (or I missed it) but where is the RAM in the physical memory map for boards with this L2 controller? Do you actually have 3GB at 0x40000000?

Will

#2 lore raw
Quoted 23 lines · Will Deacon

Hi Christian,

Quoted 10 lines · Christian Daudt

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

Looking much better now :)

Quoted 8 lines
arch/arm/mm/cache-l2x0.c +0 -0
index c465fac..d70e0ab 100644
@@ -523,6 +523,147 @@ static void aurora_flush_range(unsigned long start, unsigned long end)
  	}
  }
 
Quoted 12 lines

arch/arm/mm/cache-l2x0.c static void aurora_flush_range(unsigned long start, unsigned long end) · line 534

Quoted 9 lines
arch/arm/mm/cache-l2x0.c +9 -0
+/*
+ * For certain Broadcom SoCs, depending on the address range, different offsets
+ * need to be added to the address before passing it to L2 for
+ * invalidation/clean/flush
+ *
+ * Section Address Range              Offset        EMI
+ *   1     0x00000000 - 0x3FFFFFFF    0x80000000    VC
+ *   2     0x40000000 - 0xBFFFFFFF    0x40000000    SYS
+ *   3     0xC0000000 - 0xFFFFFFFF    0x80000000    VC

I don't think you answered last time (or I missed it) but where is the RAM in the physical memory map for boards with this L2 controller? Do you actually have 3GB at 0x40000000?

There can be up to 1G for VC and 1G for SYS. Usually that translates to 0x80000000-0xFFFFFFFF

thanks,
csd

Reviewed-by
#3 lore raw
Quoted 34 lines · Christian Daudt
Quoted 21 lines · Will Deacon
Quoted 10 lines · Christian Daudt

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

Looking much better now :)

Quoted 8 lines
arch/arm/mm/cache-l2x0.c +0 -0
index c465fac..d70e0ab 100644
@@ -523,6 +523,147 @@ static void aurora_flush_range(unsigned long start, unsigned long end)
  	}
  }
 
Quoted 12 lines

arch/arm/mm/cache-l2x0.c static void aurora_flush_range(unsigned long start, unsigned long end) · line 534

Quoted 9 lines
arch/arm/mm/cache-l2x0.c +9 -0
+/*
+ * For certain Broadcom SoCs, depending on the address range, different offsets
+ * need to be added to the address before passing it to L2 for
+ * invalidation/clean/flush
+ *
+ * Section Address Range              Offset        EMI
+ *   1     0x00000000 - 0x3FFFFFFF    0x80000000    VC
+ *   2     0x40000000 - 0xBFFFFFFF    0x40000000    SYS
+ *   3     0xC0000000 - 0xFFFFFFFF    0x80000000    VC

I don't think you answered last time (or I missed it) but where is the RAM in the physical memory map for boards with this L2 controller? Do you actually have 3GB at 0x40000000?

Quoted 2 lines

There can be up to 1G for VC and 1G for SYS. Usually that translates to 0x80000000-0xFFFFFFFF

Ok, in which case:

Will

Acked-by on v2 1/1
#4 lore raw
In reply to Christian Daudt
Quoted 6 lines · Christian Daudt

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Quoted 6 lines

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

This patch mostly covers code that is on Russells plate, so please feed this to his tracker to be picked up by him. Feel free to add:

Thanks,

-Olof

#5 lore raw
Quoted 12 lines · Olof Johansson
Quoted 11 lines · Christian Daudt

Rev A2 SoCs have an unorthodox memory re-mapping and this needs to be reflected in the cache operations.
This patch adds new outer cache functions for the l2x0 driver to support this SoC revision. It also adds a new compatible value for the cache to enable this functionality.

Updates from V1:
- remove section 1 altogether and note that in comments
- simplify section selection caused by section 1 removal
- BUG_ON just in case section 1 shows up

Quoted 4 lines
Quoted 1 line

This patch mostly covers code that is on Russells plate, so please feed this to his tracker to be picked up by him. Feel free to add:

Yes, but there's a problem. I don't have bcm11351.dtsi to apply this patch to. This is one of the problems of splitting the SoC stuff from core stuff - either I start doing cross-merges (which cause Linus and everyone else pain as we've seen this time around) or we have to stuff everything through a single tree.

Not happy.

Not applying until after -rc1.