Skip to contentSkip to conversation

armv8: Enable CPUECTLR.SMPEN for coherency

PATCH New Gong Qianyu 2 participants 2 messages Jul 7, 2016 – Jul 9, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 armv8: Enable CPUECTLR.SMPEN for coherency

From: Mingkai Hu <[email protected]>

For A53, data coherency is enabled only when the CPUECTLR.SMPEN bit is set. The SMPEN bit should be set before enabling the data cache. If not enabled, the cache is not coherent with other cores and data corruption could occur.

For A57/A72, SMPEN bit enables the processor to receive instruction cache and TLB maintenance operations broadcast from other processors in the cluster. This bit should be set before enabling the caches and MMU, or performing any cache and TLB maintenance operations.

---
v2:
- Revise commit message, add for A57/A72 part.
- Add comments above the code.

 arch/arm/cpu/armv8/start.S | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/cpu/armv8/start.S +8 -0
index 670e323..dfce469 100644
@@ -81,6 +81,14 @@ reset:
 	msr	cpacr_el1, x0			/* Enable FP/SIMD */
 0:
 
+	/* Enalbe SMPEN bit for coherency.
+	 * This register is not architectural but at the moment
+	 * this bit should be set for A53/A57/A72.
+	 */
+	mrs     x0, S3_1_c15_c2_1               /* cpuactlr_el1 */
+	orr     x0, x0, #0x40
+	msr     S3_1_c15_c2_1, x0
+
 	/* Apply ARM core specific erratas */
 	bl	apply_core_errata
 
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH v2 1/1 armv8: Enable CPUECTLR.SMPEN for coherency

Quoted 7 lines · Qianyu Gong

From: Mingkai Hu <[email protected]>

For A53, data coherency is enabled only when the CPUECTLR.SMPEN bit is set. The SMPEN bit should be set before enabling the data cache. If not enabled, the cache is not coherent with other cores and data corruption could occur.

Quoted 8 lines

For A57/A72, SMPEN bit enables the processor to receive instruction cache and TLB maintenance operations broadcast from other processors in the cluster. This bit should be set before enabling the caches and MMU, or performing any cache and TLB maintenance operations.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160709/7d730ccf/attachment.sig>