Attempt to get mailboxes up
[rpi-open-firmware.git] / start.s
diff --git a/start.s b/start.s
old mode 100755 (executable)
new mode 100644 (file)
index 716e918..2e3e035
--- a/start.s
+++ b/start.s
@@ -38,7 +38,7 @@ empty_space:
 .globl _start
 .align 2
 _start:
-       mov r0, cpuid
+        version r0
        mov r5, r0
 
        /* vectors */
@@ -72,12 +72,15 @@ _start:
        RegExceptionHandler breakpoint, #13
        RegExceptionHandler unknown, #14
 
-       add r1, r3, #252
+       //add r1, r3, #252
+        add r1, r3, #128
        lea r2, fleh_irq
-       mov r4, #492
+       //mov r4, #492
+        add r4, r3, #492
 
 L_setup_hw_irq:
-       st r2, (r1)++
+       st r2, (r1)
+        add r1, #4
        ble r1, r4, L_setup_hw_irq
 
        /*
@@ -94,12 +97,26 @@ L_setup_hw_irq:
        mov r0, #IC1_VADDR
        st r3, (r0)
 
+        /* unmask ARM interrupts */
+        mov r0, #(IC0_BASE + 0x10)
+        mov r1, #(IC1_BASE + 0x10)
+        mov r2, 0xFFFFFFFF
+        mov r3, #(IC0_BASE + 0x10 + 0x20)
+
+    unmask_all:
+        st r2, (r0)
+        st r2, (r1)
+        add r0, 4
+        add r1, 4
+        ble r0, r3, unmask_all
+
+        /* enable interrupts */
+       ei
+
        /* jump to C code */
        mov r0, r5
        lea r1, _start
 
-       ei
-
        bl _main
 
 /************************************************************
@@ -135,12 +152,13 @@ delayloop2:
  ************************************************************/
 
 .macro SaveRegsLower 
-       push r0-r5, lr
+        stm lr, (--sp)
+       stm r0-r5, (--sp)
 .endm
 
 .macro SaveRegsUpper
-       push r6-r15
-       push r16-r23
+       stm r6-r15, (--sp)
+       stm r16-r23, (--sp)
 .endm
 
 .macro SaveRegsAll
@@ -184,8 +202,8 @@ fleh_irq:
        bl sleh_irq
 
 return_from_exception:
-       pop r16-r23
-       pop r6-r15
-       pop r0-r15
-       ld lr, (sp)++
+       ldm r16-r23, (sp++)
+       ldm r6-r15, (sp++)
+       ldm r0-r5, (sp++)
+       ld lr, (sp++)
        rti
This page took 0.024645 seconds and 4 git commands to generate.