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