5 #error ARM versions below ARMv6 not supported yet.
8 #define STACK_SIZE 0x1000
14 * Entry point for the kernel.
17 * r1 -> machine type number.
18 * r2 -> start address of ATAGS.
23 # Since these can only branch to 32MiB from instruction, put the address
24 # of the handlers nearby, and copy them too.
26 # Execution starts here too, so we set this to "Start."
30 ldr pc, prefetch_abort
37 ud: .word exception_ud
38 swi: .word exception_swi
39 prefetch_abort: .word exception_prefetch_abort
40 data_abort: .word exception_data_abort
41 unused: .word exception_unused
42 irq: .word exception_irq
43 fiq: .word exception_fiq
46 // Read control register 1 from CP15.
47 mrc p15, #0, r3, c1, c0, #0
49 // No MMU, no alignment fault checking, no data cache.
50 bic r3, #((1 << 0) | (1 << 1) | (1 << 2))
51 // No instruction cache, low vectors, loads to PC set the T bit.
52 bic r3, #((1 << 12) | (1 << 13) | (1 << 15))
53 // Fixed interrupt vector.
57 mcr p15, #0, r3, c1, c0, #0
59 // Move vectors to 0x00000000.
72 // Switch to FIQ mode.
74 ldr sp, =fiq_stack + (STACK_SIZE)
77 ldr sp, =abort_stack + (STACK_SIZE)
80 ldr sp, =abort_stack + (STACK_SIZE)
83 ldr sp, =abort_stack + (STACK_SIZE)
86 ldr sp, =abort_stack + (STACK_SIZE)
89 ldr sp, =abort_stack + (STACK_SIZE)
97 // If lower than end, continue.
105 // DO NOT RETURN HERE.
110 // Subtract 1 and keep looping till not 0.
117 // The stacks in the BSS section.