X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Fcode940%2F940init.s;h=201ee8653c58810da844af5b808fef8afdd28013;hb=b5f5dc1fad9a7876a2d146b1c61d06e64435a86e;hp=2a17a9cdb0ddf9c73959bc5b20267c9bf817ae6e;hpb=abe0ea43b561e2def84cf921b1d6d8c82819ea69;p=picodrive.git diff --git a/platform/gp2x/code940/940init.s b/platform/gp2x/code940/940init.s index 2a17a9c..201ee86 100644 --- a/platform/gp2x/code940/940init.s +++ b/platform/gp2x/code940/940init.s @@ -1,5 +1,8 @@ @ vim:filetype=armasm: +@ ARM940 initialization. +@ Based on ogg940 code by Dzz. +@ (c) Copyright 2007, Grazvydas "notaz" Ignotas .equ mmsp2_regs, (0xc0000000-0x02000000) @ assume we live @ 0x2000000 bank .equ shared_ctl, 0x00200000 @ this is where shared_ctl struncture is located @@ -84,19 +87,25 @@ code940: mcr p15, 0, r0, c6, c3, 0 mcr p15, 0, r0, c6, c3, 1 - @ set up region 4: 16M 0x01000000-0x02000000 (mp3 area) - mov r0, #(0x17<<1)|1 - orr r0, r0, #0x01000000 + @ region 4: 4K 0x00000000-0x00001000 (boot code protection region) + mov r0, #(0x0b<<1)|1 mcr p15, 0, r0, c6, c4, 0 mcr p15, 0, r0, c6, c4, 1 - @ region 5: 4K 0x00000000-0x00001000 (boot code protection region) - mov r0, #(0x0b<<1)|1 + @ region 5: 4M 0x00400000-0x00800000 (mp3 area part1) + mov r0, #(0x15<<1)|1 + orr r0, r0, #0x00400000 mcr p15, 0, r0, c6, c5, 0 mcr p15, 0, r0, c6, c5, 1 - @ set regions 1, 4 and 5 to be cacheable (so the first 2M and mp3 area will be cacheable) - mov r0, #(1<<1)|(1<<4)|(1<<5) + @ region 6: 8M 0x00800000-0x01000000 (mp3 area part2) + mov r0, #(0x16<<1)|1 + orr r0, r0, #0x00800000 + mcr p15, 0, r0, c6, c6, 0 + mcr p15, 0, r0, c6, c6, 1 + + @ set regions 1, 4, 5 and 6 to be cacheable (so the first 2M and mp3 area will be cacheable) + mov r0, #(1<<1)|(1<<4)|(1<<5)|(1<<6) mcr p15, 0, r0, c2, c0, 0 mcr p15, 0, r0, c2, c0, 1 @@ -105,12 +114,13 @@ code940: mcr p15, 0, r0, c3, c0, 0 @ set access protection - @ data: [no, full, full, full, full, no access] for regions [5 4 3 2 1 0] - mov r0, #(0<<10)|(3<<8)|(3<<6)|(3<<4)|(3<<2)|(0) + @ data: [full, full, no, full, full, full, no access] for regions [6 5 4 3 2 1 0] + mov r0, # (3<<12)|(3<<10)|(0<<8) + orr r0, r0, #(3<<6)|(3<< 4)|(3<< 2)|(0<<0) mcr p15, 0, r0, c5, c0, 0 - @ instructions: [full, no access, no, no, full, no] - mov r0, #(0<< 6)|(0<<4)|(3<<2)|(0) - orr r0, r0, #(3<<10)|(0<<8) + @ instructions: [no, no, full, no, no, full, no] + mov r0, # (0<<12)|(0<<10)|(3<<8) + orr r0, r0, #(0<<6)|(0<< 4)|(3<< 2)|(0<<0) mcr p15, 0, r0, c5, c0, 1 mrc p15, 0, r0, c1, c0, 0 @ fetch current control reg