Rev 1478 | Rev 1725 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1478 | Rev 1479 | ||
---|---|---|---|
Line 137... | Line 137... | ||
137 | .section REALMODE, "ax" |
137 | .section REALMODE, "ax" |
138 | .align PAGE_WIDTH |
138 | .align PAGE_WIDTH |
139 | .global real_mode |
139 | .global real_mode |
140 | 140 | ||
141 | real_mode: |
141 | real_mode: |
142 | 142 | ||
- | 143 | DEBUG_INIT |
|
143 | DEBUG_real_mode |
144 | DEBUG_real_mode |
144 | 145 | ||
145 | # copy kernel to proper location |
146 | # copy kernel to proper location |
146 | # |
147 | # |
147 | # r5 = trans (pa) |
148 | # r5 = trans (pa) |
Line 160... | Line 161... | ||
160 | # copy page |
161 | # copy page |
161 | 162 | ||
162 | mtctr r31 |
163 | mtctr r31 |
163 | lwz r29, 0(r5) |
164 | lwz r29, 0(r5) |
164 | 165 | ||
- | 166 | DEBUG_INIT |
|
- | 167 | DEBUG_copy_loop |
|
- | 168 | ||
165 | copy_loop: |
169 | copy_loop: |
166 | 170 | ||
167 | lwz r28, 0(r29) |
171 | lwz r28, 0(r29) |
168 | stw r28, 0(r30) |
172 | stw r28, 0(r30) |
169 | 173 | ||
Line 173... | Line 177... | ||
173 | 177 | ||
174 | cmpwi r6, 0 |
178 | cmpwi r6, 0 |
175 | beq copy_end |
179 | beq copy_end |
176 | 180 | ||
177 | bdnz copy_loop |
181 | bdnz copy_loop |
- | 182 | ||
- | 183 | DEBUG_end_copy_loop |
|
178 | 184 | ||
179 | addi r5, r5, 4 |
185 | addi r5, r5, 4 |
180 | b page_copy |
186 | b page_copy |
181 | 187 | ||
182 | copy_end: |
188 | copy_end: |
183 | 189 | ||
- | 190 | DEBUG_segments |
|
- | 191 | ||
184 | # initially fill segment registers |
192 | # initially fill segment registers |
185 | 193 | ||
186 | li r31, 16 |
194 | li r31, 16 |
187 | mtctr r31 |
195 | mtctr r31 |
188 | li r31, 0 |
196 | li r31, 0 |
Line 196... | Line 204... | ||
196 | 204 | ||
197 | bdnz seg_fill |
205 | bdnz seg_fill |
198 | 206 | ||
199 | # invalidate block address translation registers |
207 | # invalidate block address translation registers |
200 | 208 | ||
- | 209 | DEBUG_bat |
|
- | 210 | ||
201 | li r30, 0 |
211 | li r30, 0 |
202 | 212 | ||
203 | mtspr ibat0u, r30 |
213 | mtspr ibat0u, r30 |
204 | mtspr ibat0l, r30 |
214 | mtspr ibat0l, r30 |
205 | 215 | ||
Line 224... | Line 234... | ||
224 | mtspr dbat3u, r30 |
234 | mtspr dbat3u, r30 |
225 | mtspr dbat3l, r30 |
235 | mtspr dbat3l, r30 |
226 | 236 | ||
227 | # create identity mapping |
237 | # create identity mapping |
228 | 238 | ||
- | 239 | DEBUG_mapping |
|
- | 240 | ||
229 | # FIXME: map exactly the size of RAM |
241 | # FIXME: map exactly the size of RAM |
230 | 242 | ||
231 | lis r31, 0x8000 |
243 | lis r31, 0x8000 |
232 | ori r31, r31, 0x0ffe |
244 | ori r31, r31, 0x0ffe |
233 | 245 | ||
Line 238... | Line 250... | ||
238 | mtspr ibat0l, r30 |
250 | mtspr ibat0l, r30 |
239 | 251 | ||
240 | mtspr dbat0u, r31 |
252 | mtspr dbat0u, r31 |
241 | mtspr dbat0l, r30 |
253 | mtspr dbat0l, r30 |
242 | 254 | ||
- | 255 | DEBUG_tlb |
|
- | 256 | ||
243 | tlbia |
257 | tlbia |
244 | tlbsync |
258 | tlbsync |
245 | 259 | ||
- | 260 | DEBUG_prepare |
|
- | 261 | ||
246 | # start the kernel |
262 | # start the kernel |
247 | # |
263 | # |
248 | # r3 = bootinfo (pa) |
264 | # r3 = bootinfo (pa) |
249 | 265 | ||
250 | lis r31, KERNEL_START_ADDR@ha |
266 | lis r31, KERNEL_START_ADDR@ha |