diff --git a/src/system/boot/platform/u-boot/arch/arm/shell.S b/src/system/boot/platform/u-boot/arch/arm/shell.S index 6ef1edf93d..d66730c5bd 100644 --- a/src/system/boot/platform/u-boot/arch/arm/shell.S +++ b/src/system/boot/platform/u-boot/arch/arm/shell.S @@ -36,7 +36,31 @@ SYMBOL_END(_start_netbsd) SYMBOL(_start_common): strb r4,gUBootOS str r8,gUBootGlobalData - /* ... */ + + /* + * Turn off interrupts and make sure we are in SVC mode + */ + + mrs r4, cpsr + bic r4, r4, #0x1f + orr r4, r4, #0xd3 + msr cpsr, r4 + + /* + * Turn off MMU and data cache if necessary. + * WARNING: assumes we are running with a 1-1 mapping if MMU is enabled. + */ + mrc p15, 0, r4, c1, c0, 0 + bic r4, r4, #0x0000000f // WCAM bits + bic r4, r4, #0x00000300 // RS bits + mcr p15, 0, r4, c1, c0, 0 + mov r4, #0 + mov r4, r4 + mov r4, r4 + + + + ldrb r4,gUBootOS cmp r4,#0 beq start_raw