mmu: mmu enable should after enable SMP

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
licheng 2022-05-27 18:16:33 +08:00 committed by Xiang Xiao
parent 11cf3de776
commit 25d5cd11a1
2 changed files with 4 additions and 1 deletions

3
arch/arm/src/armv7-a/arm_head.S Normal file → Executable file
View File

@ -409,6 +409,7 @@ __start:
bic r0, r0, #(SCTLR_SW | SCTLR_I | SCTLR_V | SCTLR_RR | SCTLR_HA)
bic r0, r0, #(SCTLR_EE | SCTLR_TRE | SCTLR_AFE | SCTLR_TE)
#ifndef CONFIG_SMP
/* Set bits to enable the MMU
*
* SCTLR_M Bit 0: Enable the MMU
@ -416,6 +417,8 @@ __start:
*/
orr r0, r0, #(SCTLR_M)
#endif
#ifndef CONFIG_ARCH_CORTEXA5
orr r0, r0, #(SCTLR_Z)
#endif

2
arch/arm/src/armv7-a/arm_scu.c Normal file → Executable file
View File

@ -203,6 +203,6 @@ void arm_enable_smp(int cpu)
arm_set_actlr(regval);
regval = arm_get_sctlr();
regval |= SCTLR_C | SCTLR_I;
regval |= SCTLR_C | SCTLR_I | SCTLR_M;
arm_set_sctlr(regval);
}