Skip to contentSkip to conversation

armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

PATCH New Alison Wang 3 participants 5 messages Dec 28, 2017 – Jan 15, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

855873: An eviction might overtake a cache clean operation
Workaround: The erratum can be avoided by upgrading cache clean by address operations to cache clean and invalidate operations. For Cortex-A53 r0p3 and later release, this can be achieved by setting CPUACTLR.ENDCCASCI to 1.

This patch is to implement the workaround for this erratum.

---
Changes in v3:
- Check the major revision of Cortex-A53.

Changes in v2:
- Check the revision of Cortex-A53 and apply the erratum to r0p3 and later release.
- Fix the mistake in the commit description.

 arch/arm/Kconfig                          |    3 +++
 arch/arm/cpu/armv8/fsl-layerscape/Kconfig |    3 +++
 arch/arm/cpu/armv8/start.S                |   24 +++++++++++++++++++++++-
 3 files changed, 29 insertions(+), 1 deletions(-)
arch/arm/Kconfig +3 -0
index f2c35e3..de323bf 100644
@@ -122,6 +122,9 @@ config ARM_ERRATA_852421
 config ARM_ERRATA_852423
 	bool
 
+config ARM_ERRATA_855873
+	bool
+
 config CPU_ARM720T
 	bool
 	select SYS_CACHE_SHIFT_5
arch/arm/cpu/armv8/fsl-layerscape/Kconfig +3 -0
index 66bc32c..76a4d8b 100644
@@ -1,6 +1,7 @@
 config ARCH_LS1012A
 	bool
 	select ARMV8_SET_SMPEN
+	select ARM_ERRATA_855873
 	select FSL_LSCH2
 	select SYS_FSL_DDR_BE
 	select SYS_FSL_MMDC
@@ -15,6 +16,7 @@ config ARCH_LS1012A
 config ARCH_LS1043A
 	bool
 	select ARMV8_SET_SMPEN
+	select ARM_ERRATA_855873
 	select FSL_LSCH2
 	select SYS_FSL_DDR
 	select SYS_FSL_DDR_BE
@@ -67,6 +69,7 @@ config ARCH_LS1046A
 config ARCH_LS1088A
 	bool
 	select ARMV8_SET_SMPEN
+	select ARM_ERRATA_855873
 	select FSL_LSCH3
 	select SYS_FSL_DDR
 	select SYS_FSL_DDR_LE
arch/arm/cpu/armv8/start.S +23 -1
index 03e744e..f385ed4 100644
@@ -196,7 +196,10 @@ reset_sctrl:
 WEAK(apply_core_errata)
 
 	mov	x29, lr			/* Save LR */
-	/* For now, we support Cortex-A57 specific errata only */
+	/* For now, we support Cortex-A53, Cortex-A57 specific errata */
+
+	/* Check if we are running on a Cortex-A53 core */
+	branch_if_a53_core x0, apply_a53_core_errata
 
 	/* Check if we are running on a Cortex-A57 core */
 	branch_if_a57_core x0, apply_a57_core_errata
@@ -204,6 +207,25 @@ WEAK(apply_core_errata)
 	mov	lr, x29			/* Restore LR */
 	ret
 
+apply_a53_core_errata:
+
+#ifdef CONFIG_ARM_ERRATA_855873
+	mrs	x0, midr_el1
+	tst	x0, #(0xf << 20)
+	b.ne	0b
+
+	mrs	x0, midr_el1
+	and	x0, x0, #0xf
+	cmp	x0, #3
+	b.lt	0b
+
+	mrs	x0, S3_1_c15_c2_0	/* cpuactlr_el1 */
+	/* Enable data cache clean as data cache clean/invalidate */
+	orr	x0, x0, #1 << 44
+	msr	S3_1_c15_c2_0, x0	/* cpuactlr_el1 */
+#endif
+	b 0b
+
 apply_a57_core_errata:
 
 #ifdef CONFIG_ARM_ERRATA_828024
Signature · 1 line
1.7.1
Applied
#1 lore raw

PATCH v3 1/1 armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

Quoted 8 lines · Alison Wang

855873: An eviction might overtake a cache clean operation
Workaround: The erratum can be avoided by upgrading cache clean by address operations to cache clean and invalidate operations. For Cortex-A53 r0p3 and later release, this can be achieved by setting CPUACTLR.ENDCCASCI to 1.

This patch is to implement the workaround for this erratum.

Quoted 9 lines

---
Changes in v3:
- Check the major revision of Cortex-A53.

Changes in v2:
- Check the revision of Cortex-A53 and apply the erratum to r0p3 and later release.
- Fix the mistake in the commit description.

Applied to fsl-qoriq master. Thanks.

York

#2 lore raw

PATCH v3 1/1 armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

Quoted 14 lines · York Sun
Quoted 13 lines · Alison Wang

855873: An eviction might overtake a cache clean operation
Workaround: The erratum can be avoided by upgrading cache clean by address operations to cache clean and invalidate operations. For Cortex-A53 r0p3 and later release, this can be achieved by setting CPUACTLR.ENDCCASCI to 1.

This patch is to implement the workaround for this erratum.

---
Changes in v3:
- Check the major revision of Cortex-A53.

Quoted 6 lines
Quoted 4 lines

Changes in v2:
- Check the revision of Cortex-A53 and apply the erratum to r0p3 and later release.
- Fix the mistake in the commit description.

Applied to fsl-qoriq master. Thanks.

Just a note if this is just for a53 should we consider to place these Kconfigs to arch/arm/cpu/armv8/Kconfig?

M

#3 lore raw

PATCH v3 1/1 armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

Quoted 20 lines · Michal Simek
Quoted 19 lines · York Sun
Quoted 17 lines · Alison Wang

855873: An eviction might overtake a cache clean operation
Workaround: The erratum can be avoided by upgrading cache clean by address operations to cache clean and invalidate operations. For Cortex-A53 r0p3 and later release, this can be achieved by setting CPUACTLR.ENDCCASCI to 1.

This patch is to implement the workaround for this erratum.

---
Changes in v3:
- Check the major revision of Cortex-A53.

Changes in v2:
- Check the revision of Cortex-A53 and apply the erratum to r0p3 and later release.
- Fix the mistake in the commit description.

Quoted 5 lines
Quoted 1 line

Applied to fsl-qoriq master. Thanks.

Just a note if this is just for a53 should we consider to place these Kconfigs to arch/arm/cpu/armv8/Kconfig?

We were following Tom Rini's move in commit 8dda2e2f9. I am not against moving ARMv8 related config options, if no single erratum applies to both ARMv8 and legacy cores.

York

#4 lore raw

PATCH v3 1/1 armv8: errata: Implement workaround for Cortex-A53 Erratum 855873

Quoted 23 lines · York Sun
Quoted 22 lines · Michal Simek
Quoted 20 lines · York Sun
Quoted 8 lines · Alison Wang

855873: An eviction might overtake a cache clean operation
Workaround: The erratum can be avoided by upgrading cache clean by address operations to cache clean and invalidate operations. For Cortex-A53 r0p3 and later release, this can be achieved by setting CPUACTLR.ENDCCASCI to 1.

This patch is to implement the workaround for this erratum.

Quoted 9 lines

---
Changes in v3:
- Check the major revision of Cortex-A53.

Changes in v2:
- Check the revision of Cortex-A53 and apply the erratum to r0p3 and later release.
- Fix the mistake in the commit description.

Applied to fsl-qoriq master. Thanks.

Quoted 7 lines
Quoted 3 lines

Just a note if this is just for a53 should we consider to place these Kconfigs to arch/arm/cpu/armv8/Kconfig?

We were following Tom Rini's move in commit 8dda2e2f9. I am not against moving ARMv8 related config options, if no single erratum applies to both ARMv8 and legacy cores.

ok. Good.

Thanks,
Michal