Rev 1725 | Rev 1732 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1725 | Rev 1728 | ||
---|---|---|---|
Line 188... | Line 188... | ||
188 | copy_end: |
188 | copy_end: |
189 | 189 | ||
190 | DEBUG_segments |
190 | DEBUG_segments |
191 | 191 | ||
192 | # initially fill segment registers |
192 | # initially fill segment registers |
193 | 193 | ||
194 | li r31, 16 |
- | |
195 | mtctr r31 |
- | |
196 | li r31, 0 |
194 | li r31, 0 |
- | 195 | ||
- | 196 | li r29, 8 |
|
- | 197 | mtctr r29 |
|
197 | li r30, 0x2000 |
198 | li r30, 0 |
198 | 199 | ||
199 | seg_fill: |
200 | seg_fill_uspace: |
200 | 201 | ||
201 | mtsrin r30, r31 |
202 | mtsrin r30, r31 |
202 | addi r30, r30, 0x111 |
203 | addi r30, r30, 1 |
203 | addis r31, r31, 0x1000 # move to next SR |
204 | addis r31, r31, 0x1000 # move to next SR |
204 | 205 | ||
205 | bdnz seg_fill |
206 | bdnz seg_fill_uspace |
- | 207 | ||
- | 208 | li r29, 8 |
|
- | 209 | mtctr r29 |
|
- | 210 | li r30, 0x4000 |
|
- | 211 | ||
- | 212 | seg_fill_kernel: |
|
- | 213 | ||
- | 214 | mtsrin r30, r31 |
|
- | 215 | addi r30, r30, 1 |
|
- | 216 | addis r31, r31, 0x1000 # move to next SR |
|
- | 217 | ||
- | 218 | bdnz seg_fill_kernel |
|
206 | 219 | ||
207 | # invalidate block address translation registers |
220 | # invalidate block address translation registers |
208 | 221 | ||
209 | DEBUG_bat |
222 | DEBUG_bat |
210 | 223 | ||
Line 239... | Line 252... | ||
239 | DEBUG_pht |
252 | DEBUG_pht |
240 | 253 | ||
241 | lis r31, 0x07ff |
254 | lis r31, 0x07ff |
242 | ori r31, r31, 0x0000 |
255 | ori r31, r31, 0x0000 |
243 | 256 | ||
- | 257 | li r30, 0x4000 |
|
- | 258 | li r29, 0 |
|
- | 259 | ||
- | 260 | pht_clear: |
|
- | 261 | ||
- | 262 | stw r29, 0(r31) |
|
- | 263 | ||
- | 264 | addi r31, r31, 4 |
|
- | 265 | subi r30, r30, 4 |
|
- | 266 | ||
- | 267 | cmpwi r30, 0 |
|
- | 268 | beq clear_end |
|
- | 269 | ||
- | 270 | bdnz pht_clear |
|
- | 271 | ||
- | 272 | DEBUG_end_pht_clear |
|
- | 273 | ||
- | 274 | clear_end: |
|
- | 275 | ||
- | 276 | lis r31, 0x07ff |
|
- | 277 | ori r31, r31, 0x0000 |
|
- | 278 | ||
244 | mtsdr1 r31 |
279 | mtsdr1 r31 |
245 | 280 | ||
246 | # create identity mapping |
281 | # create identity mapping |
247 | 282 | ||
- | 283 | #ifdef CONFIG_BAT |
|
- | 284 | ||
248 | DEBUG_mapping |
285 | DEBUG_mapping |
249 | 286 | ||
250 | # FIXME: map exactly the size of RAM |
287 | # FIXME: map exactly the size of RAM |
251 | 288 | ||
252 | lis r31, 0x8000 |
289 | lis r31, 0x8000 |
Line 258... | Line 295... | ||
258 | mtspr ibat0u, r31 |
295 | mtspr ibat0u, r31 |
259 | mtspr ibat0l, r30 |
296 | mtspr ibat0l, r30 |
260 | 297 | ||
261 | mtspr dbat0u, r31 |
298 | mtspr dbat0u, r31 |
262 | mtspr dbat0l, r30 |
299 | mtspr dbat0l, r30 |
- | 300 | ||
- | 301 | #endif |
|
263 | 302 | ||
264 | DEBUG_tlb |
303 | DEBUG_tlb |
265 | 304 | ||
266 | tlbia |
305 | tlbia |
267 | tlbsync |
306 | tlbsync |
268 | 307 | ||
269 | DEBUG_prepare |
308 | DEBUG_prepare |
270 | 309 | ||
271 | # start the kernel |
310 | # start the kernel |
272 | # |
311 | # |
- | 312 | # pc = KERNEL_START_ADDR |
|
273 | # r3 = bootinfo (pa) |
313 | # r3 = bootinfo (pa) |
- | 314 | # sprg0 = KA2PA(KERNEL_START_ADDR) |
|
- | 315 | # sprg3 = physical memory size |
|
- | 316 | # sp = 0 (pa) |
|
274 | 317 | ||
275 | lis r31, KERNEL_START_ADDR@ha |
318 | lis r31, KERNEL_START_ADDR@ha |
276 | addi r31, r31, KERNEL_START_ADDR@l |
319 | addi r31, r31, KERNEL_START_ADDR@l |
277 | 320 | ||
278 | mtspr srr0, r31 |
321 | mtspr srr0, r31 |
279 | 322 | ||
- | 323 | subis r31, r31, 0x8000 |
|
- | 324 | mtsprg0 r31 |
|
- | 325 | ||
- | 326 | lwz r31, 0(r3) |
|
- | 327 | mtsprg3 r31 |
|
- | 328 | ||
- | 329 | li sp, 0 |
|
- | 330 | ||
280 | mfmsr r31 |
331 | mfmsr r31 |
281 | ori r31, r31, (msr_ir | msr_dr)@l |
332 | ori r31, r31, (msr_ir | msr_dr)@l |
282 | mtspr srr1, r31 |
333 | mtspr srr1, r31 |
283 | 334 | ||
284 | sync |
335 | sync |