Hack on the loader
[rpi-open-firmware.git] / arm_monitor.c
index c1b6c1d..7b1a22f 100644 (file)
@@ -20,24 +20,26 @@ First stage monitor.
 #include <common.h>\r
 #include "hardware.h"\r
 \r
-void monitor_irq() {\r
-\r
+/*\r
+ * called from sleh_irq (trap.c)\r
+ */\r
+void arm_monitor_interrupt() {\r
+       printf("VPU MBOX rcv: 0x%X, cnf 0x%X\n",\r
+               ARM_1_MAIL1_RD,\r
+               ARM_1_MAIL1_CNF);\r
 }\r
 \r
 void monitor_start() {\r
        printf("Starting IPC monitor ...\n");\r
 \r
-        /* enable IRQ */\r
-        mmio_write32(0x7E00B9BC, 1);\r
+       /* dump status */\r
+       printf("Mailbox status: 0x%X\n", ARM_1_MAIL1_STA);\r
 \r
-        for(;;) {\r
-            for(unsigned int i = 0; i < 99999; ++i);\r
+       /* enable IRQ */\r
+       ARM_1_MAIL1_CNF = ARM_MC_IHAVEDATAIRQEN;\r
 \r
-            if( (mmio_read32(0x7E00B9B8) & 0x40000000) == 0) {\r
-                putchar('-');\r
-            } else {\r
-                putchar('!');\r
-            }\r
-        }\r
-//     __asm__ __volatile__ ("sleep" :::);\r
+       for(;;) {\r
+               __asm__ __volatile__ ("sleep" :::);\r
+               printf("sleep interrupted!\n");\r
+       }\r
 }\r
This page took 0.024929 seconds and 4 git commands to generate.