|
51 | 51 | @ main() function. |
52 | 52 | @ |
53 | 53 | Entry: |
54 | | - @ HACK: The U-Boot Linux loader was doing this, but the ELF loader |
55 | | - @ does not. Adding this here until we sort out the proper way to handle |
56 | | - @ caching. But right now, it breaks the display driver and other things |
57 | | - @ if we don't do this. |
| 54 | + @ U-Boot invokes us with caches and MMU enabled (since we use the |
| 55 | + @ ELF loader and not the Linux loader). We later do custom setup |
| 56 | + @ in platform.c, but for now we need to disable caches and MMU. |
58 | 57 | mrc p15, #0, r0, c1, c0,#0 @ Read System Control Register |
59 | 58 | bic r0, r0, #0x1000 @ Clear bit 12 to disable ICache |
60 | 59 | bic r0, r0, #0x0004 @ Clear bit 2 to disable DCache |
61 | 60 | bic r0, r0, #0x0001 @ Clear bit 0 to disable MMU |
62 | 61 | mcr p15, #0, r0, c1, c0, #0 @ Write back to System Control Register |
63 | 62 | mov r0, #0 @ Set r0 to 0 |
64 | 63 | mcr p15, #0, r0, c7, c7, #0 @ Invalidate all caches |
65 | | - @ END HACK |
66 | 64 |
|
| 65 | + @ Set the "V" bit so that exception vectors are at 0xffff0000 |
| 66 | + @ (where the AM1808 SoC has ARM local RAM) |
67 | 67 | MRC p15, 0, r0, c1, c0, 0 @ Load Coprocessor Register C1 to ARM Register r0 |
68 | 68 | ORR r0, r0, #0x00002000 @ Logical OR --> Set Bit 13 |
69 | 69 | MCR p15, 0, r0, c1, c0, 0 @ Restore Coprocessor Register C1 from ARM Register r0 |
|
0 commit comments