Rev 1732 | Rev 1738 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1732 | Rev 1737 | ||
---|---|---|---|
Line 193... | Line 193... | ||
193 | 193 | ||
194 | li r31, 0 |
194 | li r31, 0 |
195 | 195 | ||
196 | li r29, 8 |
196 | li r29, 8 |
197 | mtctr r29 |
197 | mtctr r29 |
198 | li r30, 0 |
198 | li r30, 0 # ASID 0 (VSIDs 0 .. 7) |
199 | 199 | ||
200 | seg_fill_uspace: |
200 | seg_fill_uspace: |
201 | 201 | ||
202 | mtsrin r30, r31 |
202 | mtsrin r30, r31 |
203 | addi r30, r30, 1 |
203 | addi r30, r30, 1 |
Line 205... | Line 205... | ||
205 | 205 | ||
206 | bdnz seg_fill_uspace |
206 | bdnz seg_fill_uspace |
207 | 207 | ||
208 | li r29, 8 |
208 | li r29, 8 |
209 | mtctr r29 |
209 | mtctr r29 |
210 | lis r30, 0x4000 |
210 | lis r30, 0x4000 # priviledged access only |
211 | ori r30, r30, 8 |
211 | ori r30, r30, 8 # ASID 0 (VSIDs 8 .. 15) |
212 | 212 | ||
213 | seg_fill_kernel: |
213 | seg_fill_kernel: |
214 | 214 | ||
215 | mtsrin r30, r31 |
215 | mtsrin r30, r31 |
216 | addi r30, r30, 1 |
216 | addi r30, r30, 1 |
Line 258... | Line 258... | ||
258 | li r30, 0x4000 |
258 | li r30, 0x4000 |
259 | li r29, 0 |
259 | li r29, 0 |
260 | 260 | ||
261 | pht_clear: |
261 | pht_clear: |
262 | 262 | ||
- | 263 | # write zeroes |
|
- | 264 | ||
263 | stw r29, 0(r31) |
265 | stw r29, 0(r31) |
264 | 266 | ||
265 | addi r31, r31, 4 |
267 | addi r31, r31, 4 |
266 | subi r30, r30, 4 |
268 | subi r30, r30, 4 |
267 | 269 | ||
Line 277... | Line 279... | ||
277 | lis r31, 0x07ff |
279 | lis r31, 0x07ff |
278 | ori r31, r31, 0x0000 |
280 | ori r31, r31, 0x0000 |
279 | 281 | ||
280 | mtsdr1 r31 |
282 | mtsdr1 r31 |
281 | 283 | ||
282 | # create identity mapping |
- | |
283 | - | ||
284 | #ifdef CONFIG_BAT |
284 | #ifdef CONFIG_BAT |
285 | 285 | ||
- | 286 | # create BAT identity mapping |
|
- | 287 | ||
286 | DEBUG_mapping |
288 | DEBUG_mapping |
287 | 289 | ||
- | 290 | lwz r31, 0(r3) |
|
- | 291 | ||
- | 292 | lis r29, 0x0002 |
|
- | 293 | cmpw r31, r29 |
|
- | 294 | blt no_bat # less than 128 KB -> no BAT |
|
- | 295 | ||
- | 296 | li r29, 18 |
|
- | 297 | srw r31, r31, r29 # r31 = total >> 18 |
|
- | 298 | ||
- | 299 | # create Block Length mask by replicating |
|
288 | # FIXME: map exactly the size of RAM |
300 | # the leading logical one 14 times |
289 | 301 | ||
- | 302 | li r29, 14 |
|
- | 303 | mtctr r31 |
|
- | 304 | li r29, 1 |
|
- | 305 | ||
- | 306 | bat_mask: |
|
- | 307 | srw r30, r31, r29 # r30 = mask >> 1 |
|
- | 308 | or r31, r31, r30 # mask = mask | r30 |
|
- | 309 | ||
- | 310 | bdnz bat_mask |
|
- | 311 | ||
- | 312 | andi. r31, r31, 0x07ff # mask = mask & 0x07ff (BAT can map up to 256 MB) |
|
- | 313 | ||
- | 314 | li r29, 2 |
|
- | 315 | slw r31, r31, r29 # mask = mask << 2 |
|
- | 316 | ori r31, r31, 0x0002 # mask = mask | 0x0002 (priviledged access only) |
|
- | 317 | ||
290 | lis r31, 0x8000 |
318 | lis r29, 0x8000 |
291 | ori r31, r31, 0x0ffe |
319 | or r29, r29, r31 |
292 | 320 | ||
293 | lis r30, 0x0000 |
321 | lis r30, 0x0000 |
294 | ori r30, r30, 0x0002 |
322 | ori r30, r30, 0x0002 |
295 | 323 | ||
296 | mtspr ibat0u, r31 |
324 | mtspr ibat0u, r29 |
297 | mtspr ibat0l, r30 |
325 | mtspr ibat0l, r30 |
298 | 326 | ||
299 | mtspr dbat0u, r31 |
327 | mtspr dbat0u, r29 |
300 | mtspr dbat0l, r30 |
328 | mtspr dbat0l, r30 |
- | 329 | ||
- | 330 | no_bat: |
|
301 | 331 | ||
302 | #endif |
332 | #endif |
303 | 333 | ||
304 | DEBUG_tlb |
334 | DEBUG_tlb |
305 | 335 |