From bb7479a182b988cc45c747cdddfb36abd5f10d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 15 Aug 2009 02:11:07 +0000 Subject: [PATCH] [GSoC] [ARM] Patch by Johannes Wischert. Turn off interrupts at loader entryn and make sure the mmu is disabled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32405 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../boot/platform/u-boot/arch/arm/shell.S | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) 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