code940 now plays mp3s
[picodrive.git] / platform / gp2x / code940 / 940init.s
similarity index 84%
rename from platform/gp2x/940init.s
rename to platform/gp2x/code940/940init.s
index 771511f..dcf4368 100644 (file)
@@ -73,25 +73,34 @@ code940:                          @ interrupt table:
     mcr p15, 0, r0, c6, c3, 0\r
     mcr p15, 0, r0, c6, c3, 1\r
 \r
-    @ set region 1 to be cacheable (so the first 2M will be cacheable)\r
-    mov r0, #2\r
+    @ set up region 4: 16M 0x01000000-0x02000000 (mp3 area)\r
+    mov r0, #(0x17<<1)|1\r
+    orr r0, r0, #0x01000000\r
+    mcr p15, 0, r0, c6, c4, 0\r
+    mcr p15, 0, r0, c6, c4, 1\r
+\r
+    @ set regions 1 and 4 to be cacheable (so the first 2M and mp3 area will be cacheable)\r
+    mov r0, #(1<<1)|(1<<4)\r
     mcr p15, 0, r0, c2, c0, 0\r
     mcr p15, 0, r0, c2, c0, 1\r
 \r
     @ set region 1 to be bufferable too (only data)\r
+    mov r0, #(1<<1)\r
     mcr p15, 0, r0, c3, c0, 0\r
 \r
     @ set protection, allow accsess only to regions 1 and 2\r
-    mov r0, #(3<<6)|(3<<4)|(3<<2)|(0)  @ data: [full, full, full, no access] for regions [3 2 1 0]\r
+    mov r0, #(3<<8)|(3<<6)|(3<<4)|(3<<2)|(0)  @ data: [full, full, full, full, no access] for regions [4 3 2 1 0]\r
     mcr p15, 0, r0, c5, c0, 0\r
-    mov r0, #(0<<6)|(0<<4)|(3<<2)|(0)  @ instructions: [no access, no, full, no]\r
+    mov r0, #(0<<8)|(0<<6)|(0<<4)|(3<<2)|(0)  @ instructions: [no access, no, no, full, no]\r
     mcr p15, 0, r0, c5, c0, 1\r
 \r
     mrc p15, 0, r0, c1, c0, 0   @ fetch current control reg\r
     orr r0, r0, #1              @ 0x00000001: enable protection unit\r
     orr r0, r0, #4              @ 0x00000004: enable D cache\r
     orr r0, r0, #0x1000         @ 0x00001000: enable I cache\r
-    orr r0, r0, #0xC0000000     @ 0xC0000000: async+fastbus\r
+    bic r0, r0, #0xC0000000\r
+    orr r0, r0, #0x40000000     @ 0x40000000: synchronous, faster?\r
+@    orr r0, r0, #0xC0000000     @ 0xC0000000: async\r
     mcr p15, 0, r0, c1, c0, 0   @ set control reg\r
 \r
     @ flush (invalidate) the cache (just in case)\r
@@ -173,4 +182,4 @@ wait_irq:
 \r
 .pool\r
 \r
-@ vim:filetype=ignored:\r
+@ vim:filetype=armasm:\r