summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-12-03 16:33:44 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2009-12-03 16:33:44 +0000
commitaf8cb1af25911e73b7e548af6ad3dfa9f1b6ac1a (patch)
tree4a8fa661d10ddebe9fbeae837eaef0d1b942b29e
parent2ea58571f5a5e47077a92f4af69f5faba1588fb6 (diff)
Add support for SMP booting following the RealView Boot Monitor booting
protocol but without WFI since the GIC isn't set up.
-rw-r--r--boot.S24
-rw-r--r--model.lds8
2 files changed, 27 insertions, 5 deletions
diff --git a/boot.S b/boot.S
index 4aedd35..884e46b 100644
--- a/boot.S
+++ b/boot.S
@@ -22,9 +22,31 @@
.globl _start
_start:
@
+ @ CPU initialisation
+ @
+ mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only)
+ and r0, r0, #15 @ CPU number
+ cmp r0, #0 @ primary CPU?
+ beq 2f
+
+ @
+ @ Secondary CPUs (following the RealView SMP booting protocol)
+ @
+ ldr r1, =filesystem - 0x100
+ adr r2, 1f
+ ldmia r2, {r3 - r6} @ move the code to a location
+ stmia r1, {r3 - r6} @ less likely to be overridden
+ ldr r0, =0x10000030 @ RealView SYS_FLAGS register
+ mov pc, r1 @ branch to the relocated code
+1: ldr r1, [r0]
+ cmp r1, #0
+ beq 1b
+ mov pc, r1 @ branch to the given address
+
+ @
@ UART initialisation (38400 8N1)
@
- ldr r0, =0x10009000 @ UART base (RealView/EB)
+2: ldr r0, =0x10009000 @ UART base (RealView/EB)
mov r1, #0x10 @ ibrd
str r1, [r0, #0x24]
mov r1, #0xc300
diff --git a/model.lds b/model.lds
index 187ba9f..45df047 100644
--- a/model.lds
+++ b/model.lds
@@ -25,18 +25,18 @@ INPUT(./uImage)
INPUT(./filesystem.cpio.gz)
INPUT(./boot.o)
-PHYS = 0x70000000;
+PHYS_OFFSET = 0x00000000;
SECTIONS
{
- . = PHYS;
+ . = PHYS_OFFSET;
.text : { boot.o }
- . = PHYS + 0x8000 - 0x40;
+ . = PHYS_OFFSET + 0x8000 - 0x40;
kernel = . + 0x40;
.kernel : { ./uImage }
- . = PHYS + 0x00800000;
+ . = PHYS_OFFSET + 0x00800000;
filesystem = .;
.filesystem : { ./filesystem.cpio.gz }
fs_size = . - filesystem;