Skip to contentSkip to conversation

ARM: l2x0: Only set .set_debug on PL310 r3p0 and earlier

PATCH New Rob Herring 2 participants 2 messages Dec 12, 2012 – Dec 14, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: l2x0: Only set .set_debug on PL310 r3p0 and earlier

From: Rob Herring <[email protected]>

PL310 errata work-arounds using .set_debug function are only needed on r3p0 and earlier, so check the rev and only set .set_debug on older revs.

Avoiding debug register accesses fixes aborts on non-secure platforms like highbank. It is assumed that non-secure platforms needing these work-arounds have already implemented .set_debug with secure monitor calls.

---
 arch/arm/mm/cache-l2x0.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/cache-l2x0.c +2 -1
index 8a97e64..6cf2fd1 100644
@@ -334,7 +334,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
 		/* Unmapped register. */
 		sync_reg_offset = L2X0_DUMMY_REG;
 #endif
-		outer_cache.set_debug = pl310_set_debug;
+		if ((cache_id & L2X0_CACHE_ID_RTL_MASK) <= L2X0_CACHE_ID_RTL_R3P0)
+			outer_cache.set_debug = pl310_set_debug;
 		break;
 	case L2X0_CACHE_ID_PART_L210:
 		ways = (aux >> 13) & 0xf;
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/2 ARM: l2x0: Only set .set_debug on PL310 r3p0 and earlier

Quoted 11 lines · Rob Herring

From: Rob Herring <[email protected]>

PL310 errata work-arounds using .set_debug function are only needed on r3p0 and earlier, so check the rev and only set .set_debug on older revs.

Avoiding debug register accesses fixes aborts on non-secure platforms like highbank. It is assumed that non-secure platforms needing these work-arounds have already implemented .set_debug with secure monitor calls.

Nice, works for me:

Quoted 21 lines
---
 arch/arm/mm/cache-l2x0.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mm/cache-l2x0.c +2 -1
index 8a97e64..6cf2fd1 100644
@@ -334,7 +334,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
 		/* Unmapped register. */
 		sync_reg_offset = L2X0_DUMMY_REG;
 #endif
-		outer_cache.set_debug = pl310_set_debug;
+		if ((cache_id & L2X0_CACHE_ID_RTL_MASK) <= L2X0_CACHE_ID_RTL_R3P0)
+			outer_cache.set_debug = pl310_set_debug;
 		break;
 	case L2X0_CACHE_ID_PART_L210:
 		ways = (aux >> 13) & 0xf;
Signature · 1 line
1.7.10.4