Commit 4b886159 authored by Arnd Bergmann's avatar Arnd Bergmann

ARM: pxa: fix building with clang

The integrated assembler in clang does not understand the xscale
specific mra/mar instructions:

arch/arm/mach-pxa/pxa27x.c:136:15: error: unsupported architectural extension: xscale
        asm volatile(".arch_extension xscale\n\t"
arch/arm/mach-pxa/pxa27x.c:136:40: error: invalid instruction, did you mean: mcr, mla, mrc, mrs, msr?
        mra r2, r3, acc0

Since these are coprocessor features, the same can be expressed using
mrrc/mcrr, so use that for builds with IAS.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20221215162529.3659187-1-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 4c03c418
...@@ -133,8 +133,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) ...@@ -133,8 +133,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
#ifndef CONFIG_IWMMXT #ifndef CONFIG_IWMMXT
u64 acc0; u64 acc0;
#ifndef CONFIG_AS_IS_LLVM
asm volatile(".arch_extension xscale\n\t" asm volatile(".arch_extension xscale\n\t"
"mra %Q0, %R0, acc0" : "=r" (acc0)); "mra %Q0, %R0, acc0" : "=r" (acc0));
#else
asm volatile("mrrc p0, 0, %Q0, %R0, c0" : "=r" (acc0));
#endif
#endif #endif
/* ensure voltage-change sequencer not initiated, which hangs */ /* ensure voltage-change sequencer not initiated, which hangs */
...@@ -153,8 +157,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state) ...@@ -153,8 +157,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
case PM_SUSPEND_MEM: case PM_SUSPEND_MEM:
cpu_suspend(pwrmode, pxa27x_finish_suspend); cpu_suspend(pwrmode, pxa27x_finish_suspend);
#ifndef CONFIG_IWMMXT #ifndef CONFIG_IWMMXT
#ifndef CONFIG_AS_IS_LLVM
asm volatile(".arch_extension xscale\n\t" asm volatile(".arch_extension xscale\n\t"
"mar acc0, %Q0, %R0" : "=r" (acc0)); "mar acc0, %Q0, %R0" : "=r" (acc0));
#else
asm volatile("mcrr p0, 0, %Q0, %R0, c0" :: "r" (acc0));
#endif
#endif #endif
break; break;
} }
......
...@@ -108,8 +108,12 @@ static void pxa3xx_cpu_pm_suspend(void) ...@@ -108,8 +108,12 @@ static void pxa3xx_cpu_pm_suspend(void)
#ifndef CONFIG_IWMMXT #ifndef CONFIG_IWMMXT
u64 acc0; u64 acc0;
#ifdef CONFIG_CC_IS_GCC
asm volatile(".arch_extension xscale\n\t" asm volatile(".arch_extension xscale\n\t"
"mra %Q0, %R0, acc0" : "=r" (acc0)); "mra %Q0, %R0, acc0" : "=r" (acc0));
#else
asm volatile("mrrc p0, 0, %Q0, %R0, c0" : "=r" (acc0));
#endif
#endif #endif
/* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */ /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */
...@@ -137,8 +141,12 @@ static void pxa3xx_cpu_pm_suspend(void) ...@@ -137,8 +141,12 @@ static void pxa3xx_cpu_pm_suspend(void)
AD3ER = 0; AD3ER = 0;
#ifndef CONFIG_IWMMXT #ifndef CONFIG_IWMMXT
#ifndef CONFIG_AS_IS_LLVM
asm volatile(".arch_extension xscale\n\t" asm volatile(".arch_extension xscale\n\t"
"mar acc0, %Q0, %R0" : "=r" (acc0)); "mar acc0, %Q0, %R0" : "=r" (acc0));
#else
asm volatile("mcrr p0, 0, %Q0, %R0, c0" :: "r" (acc0));
#endif
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment