diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-08 08:04:11 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-08 08:04:11 +0000 |
commit | 0d472c457bf1567f556e11fbd744ce0710901098 (patch) | |
tree | 205f76bb3f3e05425581086f56da093136a91663 /firmware/crt0.S | |
parent | 3796a58cea01ec9be760a2af543afc70dad185bc (diff) | |
download | rockbox-0d472c457bf1567f556e11fbd744ce0710901098.tar.gz rockbox-0d472c457bf1567f556e11fbd744ce0710901098.zip |
Set up the Flash, LCD and ATA chip selects
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5220 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/crt0.S')
-rw-r--r-- | firmware/crt0.S | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/firmware/crt0.S b/firmware/crt0.S index f66a0fb3cf..f98689eb0a 100644 --- a/firmware/crt0.S +++ b/firmware/crt0.S | |||
@@ -31,14 +31,56 @@ start: | |||
31 | move.l #MBAR2+1,%d0 | 31 | move.l #MBAR2+1,%d0 |
32 | movec.l %d0,%mbar2 | 32 | movec.l %d0,%mbar2 |
33 | 33 | ||
34 | lea MBAR,%a0 | ||
35 | lea MBAR2,%a1 | ||
36 | |||
37 | /* 64K DMA-capable SRAM at 0x10000000 | ||
38 | DMA is enabled and has priority in both banks | ||
39 | All types of accesses are allowed | ||
40 | (We might want to restrict that to save power) */ | ||
41 | move.l #0x1000e001,%d0 | ||
42 | movec.l %d0,%rambar1 | ||
43 | |||
44 | /* 32K Non-DMA SRAM at 0x10010000 | ||
45 | All types of accesses are allowed | ||
46 | (We might want to restrict that to save power) */ | ||
47 | move.l #0x10010001,%d0 | ||
48 | movec.l %d0,%rambar0 | ||
49 | |||
50 | /* Chip select 0 - Flash ROM */ | ||
51 | move.l #0x00000000,%d0 /* CSAR0 - Base = 0x00000000 */ | ||
52 | move.l %d0,(0x080,%a0) | ||
53 | move.l #0x001f0101,%d0 /* CSMR0 - 2M, All access, write protect */ | ||
54 | move.l %d0,(0x084,%a0) | ||
55 | move.l #0x00000d80,%d0 /* CSCR0 - 3 wait states, 16 bits, no bursts */ | ||
56 | move.l %d0,(0x088,%a0) | ||
57 | |||
58 | /* Chip select 1 - LCD controller */ | ||
59 | move.l #0xf0000000,%d0 /* CSAR1 - Base = 0xf0000000 */ | ||
60 | move.l %d0,(0x08c,%a0) | ||
61 | move.l #0x0000007b,%d0 /* CSMR1 - 64K, Only data access */ | ||
62 | move.l %d0,(0x090,%a0) | ||
63 | move.l #0x00002180,%d0 /* CSCR1 - 8 wait states, 16 bits, no bursts */ | ||
64 | move.l %d0,(0x094,%a0) | ||
65 | |||
66 | /* Chip select 2 - ATA controller */ | ||
67 | move.l #0x20000000,%d0 /* CSAR2 - Base = 0x20000000 */ | ||
68 | move.l %d0,(0x098,%a0) | ||
69 | move.l #0x0000007b,%d0 /* CSMR2 - 64K, Only data access */ | ||
70 | move.l %d0,(0x09c,%a0) | ||
71 | move.l #0x00000180,%d0 /* CSCR2 - no wait states, 16 bits, no bursts */ | ||
72 | move.l %d0,(0x0a0,%a0) /* NOTE: I'm not sure about the wait states. | ||
73 | We have to be careful with the access times, | ||
74 | since IORDY isn't connected to the HDD. */ | ||
75 | |||
76 | |||
34 | /* Test code: blink the backlight */ | 77 | /* Test code: blink the backlight */ |
35 | lea MBAR2,%a0 | ||
36 | move.l #0x00020000,%d0 | 78 | move.l #0x00020000,%d0 |
37 | move.l %d0,(0xbc,%a0) /* Function = 1 */ | 79 | move.l %d0,(0xbc,%a1) /* Function = 1 */ |
38 | move.l %d0,(0xb8,%a0) /* Enable = 1 */ | 80 | move.l %d0,(0xb8,%a1) /* Enable = 1 */ |
39 | 81 | ||
40 | .blinkloop: | 82 | .blinkloop: |
41 | eor.l %d0,(0xb4,%a0) | 83 | eor.l %d0,(0xb4,%a1) |
42 | 84 | ||
43 | move.l #2000000,%d2 | 85 | move.l #2000000,%d2 |
44 | .delay: | 86 | .delay: |