Skip to content

Commit 0c1271f

Browse files
ArcaneNibbledlech
authored andcommitted
pbio/platform/ev3/start.S: Update comments for CPU setup
We are going to be keeping this cache/MMU disable code, so update the comment appropriately. Also explain what the bit 13 in the control register does.
1 parent 72e7458 commit 0c1271f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/pbio/platform/ev3/start.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@
5151
@ main() function.
5252
@
5353
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.
5857
mrc p15, #0, r0, c1, c0,#0 @ Read System Control Register
5958
bic r0, r0, #0x1000 @ Clear bit 12 to disable ICache
6059
bic r0, r0, #0x0004 @ Clear bit 2 to disable DCache
6160
bic r0, r0, #0x0001 @ Clear bit 0 to disable MMU
6261
mcr p15, #0, r0, c1, c0, #0 @ Write back to System Control Register
6362
mov r0, #0 @ Set r0 to 0
6463
mcr p15, #0, r0, c7, c7, #0 @ Invalidate all caches
65-
@ END HACK
6664

65+
@ Set the "V" bit so that exception vectors are at 0xffff0000
66+
@ (where the AM1808 SoC has ARM local RAM)
6767
MRC p15, 0, r0, c1, c0, 0 @ Load Coprocessor Register C1 to ARM Register r0
6868
ORR r0, r0, #0x00002000 @ Logical OR --> Set Bit 13
6969
MCR p15, 0, r0, c1, c0, 0 @ Restore Coprocessor Register C1 from ARM Register r0

0 commit comments

Comments
 (0)