summaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-02 19:05:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-08-07 08:48:36 +0200
commit20e9bc17d4434f85cab228cc9ffa38dc514be63e (patch)
tree077c22aca3f2bf07b84a92649a26eb3cb575789f /arch/arm/include
parent72826e747442142a64b865ca6e4a8b3c88acd5d2 (diff)
downloadbarebox-20e9bc17d4434f85cab228cc9ffa38dc514be63e.tar.gz
barebox-20e9bc17d4434f85cab228cc9ffa38dc514be63e.tar.xz
ARM: Create an assembly arm_cpu_lowlevel_init function
To avoid the code duplication between the static inline C function and the assembly macro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/barebox-arm-head.h64
1 files changed, 1 insertions, 63 deletions
diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
index af7164a2eb..0a2eb6bdca 100644
--- a/arch/arm/include/asm/barebox-arm-head.h
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -5,33 +5,7 @@
#ifndef __ASSEMBLY__
-static inline void arm_cpu_lowlevel_init(void)
-{
- uint32_t r;
-
- /* set the cpu to SVC32 mode */
- __asm__ __volatile__("mrs %0, cpsr":"=r"(r));
- r &= ~0x1f;
- r |= 0xd3;
- __asm__ __volatile__("msr cpsr, %0" : : "r"(r));
-
- /* disable MMU stuff and caches */
- r = get_cr();
- r &= ~(CR_M | CR_C | CR_B | CR_S | CR_R | CR_V);
- r |= CR_I;
-
-#if __LINUX_ARM_ARCH__ >= 6
- r |= CR_U;
- r &= ~CR_A;
-#else
- r |= CR_A;
-#endif
-
-#ifdef __ARMEB__
- r |= CR_B;
-#endif
- set_cr(r);
-}
+void arm_cpu_lowlevel_init(void);
/*
* 32 bytes at this offset is reserved in the barebox head for board/SoC
@@ -86,42 +60,6 @@ static inline void barebox_arm_head(void)
}
#endif
-#else
-
-.macro arm_cpu_lowlevel_init, scratch
-
- /* set the cpu to SVC32 mode */
- mrs \scratch, cpsr
- bic \scratch, \scratch, #0x1f
- orr \scratch, \scratch, #0xd3
- msr cpsr, \scratch
-
-#if __LINUX_ARM_ARCH__ >= 7
- isb
-#elif __LINUX_ARM_ARCH__ == 6
- mcr p15, 0, \scratch, c7, c5, 4
-#endif
-
- /* disable MMU stuff and caches */
- mrc p15, 0, \scratch, c1, c0, 0
- bic \scratch, \scratch , #(CR_M | CR_C | CR_B)
- bic \scratch, \scratch, #(CR_S | CR_R | CR_V)
- orr \scratch, \scratch, #CR_I
-
-#if __LINUX_ARM_ARCH__ >= 6
- orr \scratch, \scratch, #CR_U
- bic \scratch, \scratch, #CR_A
-#else
- orr \scratch, \scratch, #CR_A
-#endif
-
-#ifdef __ARMEB__
- orr \scratch, \scratch, #CR_B
-#endif
-
- mcr p15, 0, \scratch, c1, c0, 0
-.endm
-
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARM_HEAD_H */