|
1 | 1 | #include "linux_config.h" |
2 | 2 | #include "scu.h" |
3 | 3 |
|
4 | | -@ LCD Frambuffers stuff (Physical Addresses) |
5 | | -#define LCD_FB_PDC0 (0x10400400) |
6 | | -#define LCD_FB_PDC1 (0x10400500) |
7 | | -#define LCD_FB_A_ADDR_OFFSET (0x68) |
8 | | -#define LCD_FB_FORMAT_OFFSET (0x70) |
9 | | -#define LCD_FB_PDC0_FORMAT (0x80341) |
10 | | -#define LCD_FB_SELECT_OFFSET (0x78) |
11 | | -#define LCD_FB_STRIDE_OFFSET (0x90) |
12 | | -#define LCD_FB_PDC0_STRIDE (0x2D0) |
13 | | -#define LCD_FB_B_ADDR_OFFSET (0x94) |
14 | | -#define FB_TOP_SIZE (400 * 240 * 3) |
15 | | -#define FB_BOT_SIZE (320 * 240 * 3) |
16 | | -#define FB_BASE_PA (VRAM_BASE) |
17 | | -#define FB_TOP_LEFT1 (FB_BASE_PA) |
18 | | -#define FB_TOP_LEFT2 (FB_TOP_LEFT1 + FB_TOP_SIZE) |
19 | | -#define FB_TOP_RIGHT1 (FB_TOP_LEFT2 + FB_TOP_SIZE) |
20 | | -#define FB_TOP_RIGHT2 (FB_TOP_RIGHT1 + FB_TOP_SIZE) |
21 | | -#define FB_BOT_1 (FB_TOP_RIGHT2 + FB_TOP_SIZE) |
22 | | -#define FB_BOT_2 (FB_BOT_1 + FB_BOT_SIZE) |
23 | | - |
24 | 4 | .arm |
25 | 5 | .section .text.start |
26 | 6 | .cpu mpcore |
27 | 7 |
|
28 | 8 | .global _start |
29 | 9 | _start: |
| 10 | + @ Initialize RAM value used to sync with arm9 |
| 11 | + ldr r0, =SYNC_ADDR |
| 12 | + mov r1, #SYNC_INIT |
| 13 | + str r1, [r0] |
| 14 | + |
30 | 15 | @ Disable FIQs, IRQs, imprecise aborts |
31 | 16 | @ and enter SVC mode |
32 | 17 | cpsid aif, #0x13 |
@@ -91,6 +76,23 @@ _start: |
91 | 76 |
|
92 | 77 | @@@@@ Map Framebuffers @@@@@ |
93 | 78 |
|
| 79 | + @@@ Zero framebuffer region @@@ |
| 80 | + mov r1, #0 @ value to set |
| 81 | + ldr r2, =FB_TOP_SIZE @ number of bytes |
| 82 | + ldr r0, =FB_TOP_LEFT1 @ address of buffer |
| 83 | + bl memset |
| 84 | + ldr r0, =FB_TOP_LEFT2 |
| 85 | + bl memset |
| 86 | + ldr r0, =FB_TOP_RIGHT1 |
| 87 | + bl memset |
| 88 | + ldr r0, =FB_TOP_RIGHT2 |
| 89 | + bl memset |
| 90 | + ldr r2, =FB_BOT_SIZE |
| 91 | + ldr r0, =FB_BOT_1 |
| 92 | + bl memset |
| 93 | + ldr r0, =FB_BOT_2 |
| 94 | + bl memset |
| 95 | + |
94 | 96 | @@@ Top screen @@@ |
95 | 97 | ldr r0, =LCD_FB_PDC0 |
96 | 98 |
|
@@ -125,15 +127,19 @@ _start: |
125 | 127 | @ Select framebuffer 0 |
126 | 128 | mov r1, #0 |
127 | 129 | str r1, [r0, #LCD_FB_SELECT_OFFSET] |
| 130 | + |
| 131 | + ldr r0, =SYNC_ADDR |
| 132 | + mov r1, #SYNC_FB_RDY |
| 133 | + str r1, [r0] |
128 | 134 |
|
129 | 135 | @@@@@ Jump to the kernel @@@@@ |
130 | | - |
| 136 | + |
131 | 137 | @ Wait until ARM9 tells Linux address... |
132 | 138 | ldr r0, =SYNC_ADDR |
133 | 139 | wait_arm9: |
134 | 140 | ldr r1, [r0] |
135 | | - cmp r1, #0 |
136 | | - beq wait_arm9 |
| 141 | + cmp r1, #SYNC_BOOT_RDY |
| 142 | + bne wait_arm9 |
137 | 143 |
|
138 | 144 | @ Setup the registers before |
139 | 145 | @ jumping to the kernel entry |
|
0 commit comments