From 205353fa06cc5dbfe1949de013ba905bb151c702 Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Fri, 12 Apr 2019 19:08:34 +0800 Subject: csky: Support vmlinux bootup with MMU off Modify SETUP_MMU macro to fit on both MMU-on or MMU-off enviornment and vmlinux could bootup from MMU off enviornment for some cases. Unify the style of _start and _start_smp_secondary in head.S to make head.S looks more concise and easy to understand. Signed-off-by: Guo Ren Cc: Arnd Bergmann --- arch/csky/abiv1/inc/abi/entry.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'arch/csky/abiv1/inc') diff --git a/arch/csky/abiv1/inc/abi/entry.h b/arch/csky/abiv1/inc/abi/entry.h index 18e2023bf165..7ab78bd0f3b1 100644 --- a/arch/csky/abiv1/inc/abi/entry.h +++ b/arch/csky/abiv1/inc/abi/entry.h @@ -143,7 +143,12 @@ cpwcr \rx, cpcr8 .endm -.macro SETUP_MMU rx +.macro SETUP_MMU + /* Init psr and enable ee */ + lrw r6, DEFAULT_PSR_VALUE + mtcr r6, psr + psrset ee + /* Select MMU as co-processor */ cpseti cp15 @@ -152,17 +157,17 @@ * 31 - 29 | 28 - 4 | 3 | 2 | 1 | 0 * BA Reserved C D V */ - cprcr \rx, cpcr30 - lsri \rx, 28 - lsli \rx, 28 - addi \rx, 0xe - cpwcr \rx, cpcr30 - - lsri \rx, 28 - addi \rx, 2 - lsli \rx, 28 - addi \rx, 0xe - cpwcr \rx, cpcr31 + cprcr r6, cpcr30 + lsri r6, 28 + lsli r6, 28 + addi r6, 0xe + cpwcr r6, cpcr30 + + lsri r6, 28 + addi r6, 2 + lsli r6, 28 + addi r6, 0xe + cpwcr r6, cpcr31 .endm .macro ANDI_R3 rx, imm -- cgit v1.2.3