340
|
1
|
386
|
2 .section .init
|
340
|
3
|
|
4 .global _Reset;
|
|
5 _Reset:
|
387
|
6
|
|
7 _start:
|
340
|
8 LDR sp, =stack_top
|
386
|
9
|
|
10 ldr r2, =0x10009000
|
|
11
|
|
12 mov r1, #'1'
|
|
13 str r1, [r2]
|
|
14
|
387
|
15 // Load TTBR0 and TTBR1
|
386
|
16 ldr r0, =kernel_table0
|
|
17 mcr p15, 0, r0, c2, c0, 1
|
|
18 mcr p15, 0, r0, c2, c0, 0
|
|
19
|
387
|
20 // Domain 0:
|
386
|
21 mov r0, #3
|
|
22 mcr p15, 0, r0, c3, c0, 0
|
|
23
|
387
|
24 # ; Enable paging:
|
386
|
25 mrc p15, 0, r0, c1, c0, 0
|
|
26 orr r0, r0, #1
|
|
27 mcr p15, 0, r0, c1, c0, 0
|
|
28
|
387
|
29 // Change uart DR pointer (now located at 0x109000:
|
|
30 ldr r2, =0x109000
|
|
31 mov r1, #'2'
|
386
|
32 str r1, [r2]
|
|
33
|
340
|
34 BL start
|
|
35 B .
|
|
36
|
386
|
37 .section .padata
|
|
38
|
387
|
39 /*
|
|
40 Maybe the kernel is loaded at 0x60000000, so we need to map that to first
|
|
41 megabyte also...
|
|
42 */
|
|
43
|
386
|
44 kernel_table0:
|
387
|
45 .long 0x00000000 + 0x402 // 0x00000000 # ; Identity map first 1 MB
|
|
46 .long 0x10000000 + 0x402 // 0x00100000 # ; second mb mapping to peripherals
|
|
47
|
|
48 .rept 0x600 - 2
|
|
49 .long 0x0
|
|
50 .endr
|
|
51 .long 0x00000402 // 0x60000000 maps 1 MB to first MB
|
|
52 .rept 0x1000 - 0x601
|
386
|
53 .long 0x0
|
|
54 .endr
|
|
55
|