diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-12-03 16:33:44 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-12-03 16:33:44 +0000 |
commit | af8cb1af25911e73b7e548af6ad3dfa9f1b6ac1a (patch) | |
tree | 4a8fa661d10ddebe9fbeae837eaef0d1b942b29e | |
parent | 2ea58571f5a5e47077a92f4af69f5faba1588fb6 (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.S | 24 | ||||
-rw-r--r-- | model.lds | 8 |
2 files changed, 27 insertions, 5 deletions
@@ -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 @@ -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; |