From 1b3a02eb452354fa9b36a7f33dc4c8307bbc40aa Mon Sep 17 00:00:00 2001 From: Tony Thompson Date: Wed, 4 Nov 2009 12:16:38 +0000 Subject: [PATCH] ARMv7: Check whether the SMP/nAMP mode was already enabled If running in non-secure mode, enabling this register will fault. Signed-off-by: Tony Thompson Acked-by: Srinidhi Kasagar Signed-off-by: Catalin Marinas --- arch/arm/mm/proc-v7.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index eeeed01ee44a..3a285218fd15 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -186,9 +186,10 @@ cpu_v7_name: */ __v7_setup: #ifdef CONFIG_SMP - mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode and - orr r0, r0, #(1 << 6) | (1 << 0) @ TLB ops broadcasting - mcr p15, 0, r0, c1, c0, 1 + mrc p15, 0, r0, c1, c0, 1 + tst r0, #(1 << 6) @ SMP/nAMP mode enabled? + orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and + mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting #endif adr r12, __v7_setup_stack @ the local stack stmia r12, {r0-r5, r7, r9, r11, lr} -- 2.39.5