Attempt to get mailboxes up
authorAlyssa Rosenzweig <alyssa@backtick.town>
Mon, 15 Aug 2016 02:35:50 +0000 (19:35 -0700)
committerAlyssa Rosenzweig <alyssa@backtick.town>
Mon, 15 Aug 2016 02:35:50 +0000 (19:35 -0700)
arm_chainloader/main.c
arm_loader.c
arm_monitor.c
start.s

index 4106fdd..1a4ae6b 100644 (file)
@@ -38,6 +38,11 @@ void main() {
        /* c++ runtime */\r
        cxx_init();\r
 \r
+        /* poke the VPU */\r
+        printf("Poking the VPU..\n");\r
+        while( (mmio_read32(0x2000B898) & 0x80000000) != 0);\r
+        mmio_write32(0x2000B8A0, 0xA1755A01);\r
+\r
        panic("Nothing else to do!");\r
 \r
 #if 0\r
@@ -47,4 +52,4 @@ void main() {
                udelay(1000000);\r
        }\r
 #endif\r
-}
\ No newline at end of file
+}\r
index 9d1d977..2d2fa3b 100644 (file)
@@ -256,6 +256,9 @@ void arm_init() {
         * set the mem size for who knows what reason.\r
         */\r
        ARM_CONTROL0 |= 0x008 | ARM_C0_APROTSYST | ARM_C0_SIZ1G | ARM_C0_FULLPERI;\r
+        ARM_CONTROL1 |= ARM_C1_PERSON | ARM_C1_MAIL;\r
+\r
+        ARM_IRQ_ENBL3 |= ARM_IE_MAIL;\r
 \r
        logf("using C0: 0x%X\n", ARM_CONTROL0);\r
 \r
@@ -277,4 +280,4 @@ void arm_init() {
                logf("0x%X 0x%X 0x%X 0x%X\n", arm_membase[0], arm_membase[1], arm_membase[2], arm_membase[3]);\r
                udelay(5000);\r
        }\r
-}
\ No newline at end of file
+}\r
index c9168c7..ee6d384 100644 (file)
@@ -27,5 +27,13 @@ void monitor_irq() {
 void monitor_start() {\r
        printf("Starting IPC monitor ...\n");\r
 \r
-       __asm__ __volatile__ ("sleep" :::);\r
-}
\ No newline at end of file
+        for(;;) {\r
+            for(unsigned int i = 0; i < 99999; ++i);\r
+            if( (mmio_read32(0x7E00B9B8) & 0x40000000) ) {\r
+                putchar('-');\r
+            } else {\r
+                putchar('!');\r
+            }\r
+        }\r
+//     __asm__ __volatile__ ("sleep" :::);\r
+}\r
diff --git a/start.s b/start.s
index 6fc8e90..2e3e035 100644 (file)
--- a/start.s
+++ b/start.s
@@ -98,12 +98,18 @@ L_setup_hw_irq:
        st r3, (r0)
 
         /* unmask ARM interrupts */
-        mov r0, #(IC0_BASE + 0x10 + 24)
-        mov r1, #(IC1_BASE + 0x10 + 24)
-        mov r2, 0x07000000
+        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
 
This page took 0.030387 seconds and 4 git commands to generate.