diff options
Diffstat (limited to 'boot.S')
-rw-r--r-- | boot.S | 61 |
1 files changed, 55 insertions, 6 deletions
@@ -8,6 +8,7 @@ */ .syntax unified + .arch_extension sec .text .globl _start @@ -28,6 +29,45 @@ _start: @ @ CPU initialisation @ + mrc p15, 0, r4, c0, c0, 5 @ MPIDR (ARMv7 only) + and r4, r4, #15 @ CPU number + + @ + @ Hypervisor / TrustZone initialization + @ + + @ Set all interrupts to be non-secure + ldr r0, =0x2c001000 @ Dist GIC base + ldr r1, [r0, #0x04] @ Type Register + cmp r4, #0 + andeq r1, r1, #0x1f + movne r1, #0 + add r2, r0, #0x080 @ Security Register 0 + mvn r3, #0 +2: str r3, [r2] + sub r1, r1, #1 + add r2, r2, #4 @ Next security register + cmp r1, #-1 + bne 2b + + @ Set GIC priority mask bit [7] = 1 + ldr r0, =0x2c002000 @ CPU GIC base + mov r1, #0x80 + str r1, [r0, #0x4] @ GIC ICCPMR + + @ Set NSACR to allow coprocessor access from non-secure + mrc p15, 0, r0, c1, c1, 2 + ldr r1, =0x43fff + orr r0, r0, r1 + mcr p15, 0, r0, c1, c1, 2 + + @ Change to NS-mode + mov r0, #0xf0000000 + mcr p15, 0, r0, c12, c0, 1 @ Monitor vector base address + mov r7, #0xffffffff + smc #0 @ Change to NS-mode + + @ Check CPU nr again mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only) and r0, r0, #15 @ CPU number cmp r0, #0 @ primary CPU? @@ -36,6 +76,7 @@ _start: @ @ Secondary CPUs (following the RealView SMP booting protocol) @ + ldr r1, =filesystem - 0x100 adr r2, 1f ldmia r2, {r3 - r7} @ move the code to a location @@ -56,10 +97,10 @@ _start: mov pc, r1 @ branch to the given address #endif +2: @ @ UART initialisation (38400 8N1) @ -2: #ifdef MACH_MPS ldr r0, =0x1f005000 @ UART3 base (MPS) #elif defined (VEXPRESS) @@ -103,15 +144,23 @@ atags: .long 0x54410009 #ifdef MACH_MPS .asciz "rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk" -#elif defined(USE_INITRD) -#ifdef VEXPRESS - .asciz "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk" -#else - .asciz "console=ttyAMA0 mem=256M earlyprintk" +#elif defined(VEXPRESS) + +#ifdef USE_INITRD + .asciz "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk ip=192.168.27.200::192.168.27.1:255.255.255.0:angstrom:eth0:off" +#else /* VEXPRESS && !USE_INITRD */ + .asciz "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk root=/dev/nfs nfsroot=192.168.27.93:/srv/nfs_root,tcp rw ip=dhcp nfsrootdebug" #endif + +#else /* ! VEXPRESS && ! MACH_MPS */ + +#ifdef USE_INITRD + .asciz "console=ttyAMA0 mem=256M earlyprintk" #else .asciz "root=/dev/nfs nfsroot=10.1.77.43:/work/debootstrap/arm ip=dhcp console=ttyAMA0 mem=256M earlyprintk" #endif + +#endif .align 2 1: |