X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=rpikern;a=blobdiff_plain;f=src%2Fstartup.s;h=7765ede46d9a56f27b3ae9b3436d6e654f5080fb;hp=30e2a6676a7b12c327dc184f7a19a703b1546310;hb=e848811902a51b67dedb6f6325dda19a6f21e820;hpb=4cdb0feb633bc6181644704cea8f18368b5bcfd1 diff --git a/src/startup.s b/src/startup.s index 30e2a66..7765ede 100644 --- a/src/startup.s +++ b/src/startup.s @@ -3,10 +3,14 @@ .section .startup .code 32 - ldr sp, =_stacktop +startup: + @ stop all but one of the cores + mrc p15, 0, r0, c0, c0, 5 + ands r0, r0, #0xff + bne exit - mov r0, #1 - bl dbgled + @ setup stack + ldr sp, =_stacktop @ clear bss ldr r0, =_bss_start @@ -18,23 +22,23 @@ subs r1, #4 bne 0b 1: - bl main - - mov r0, #0 - bl dbgled + blx main -halt: wfe - b halt + .global exit +exit: wfe + b exit + .global dbgled dbgled: ldr r3, =0x3f200000 @ gpio base ldr r2, =0x9000 @ gpio 24 and 25 -> output str r2, [r3, #8] @ store to GPFSEL2 ldr r2, =0x01000000 @ bit 24 - teq r0, #0 - streq r2, [r3, #0x1c] @ GPSET0 - strne r2, [r3, #0x28] @ GPCLR0 + tst r0, #1 + strne r2, [r3, #0x1c] @ GPSET0 + streq r2, [r3, #0x28] @ GPCLR0 lsl r2, #1 + tst r0, #2 strne r2, [r3, #0x1c] @ GPSET0 streq r2, [r3, #0x28] @ GPCLR0 bx lr