Rev 1737 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1737 | Rev 1738 | ||
---|---|---|---|
Line 246... | Line 246... | ||
246 | mtspr dbat2l, r30 |
246 | mtspr dbat2l, r30 |
247 | 247 | ||
248 | mtspr dbat3u, r30 |
248 | mtspr dbat3u, r30 |
249 | mtspr dbat3l, r30 |
249 | mtspr dbat3l, r30 |
250 | 250 | ||
251 | # create empty page hash table FIXME |
251 | # create empty Page Hash Table |
- | 252 | # on top of memory, size 64 KB |
|
252 | 253 | ||
253 | DEBUG_pht |
254 | DEBUG_pht |
254 | 255 | ||
255 | lis r31, 0x07ff |
- | |
256 | ori r31, r31, 0x0000 |
256 | lwz r31, 0(r3) # r31 = memory size |
257 | 257 | ||
258 | li r30, 0x4000 |
258 | lis r30, 65536@h |
- | 259 | ori r30, r30, 65536@l # r30 = 65536 |
|
- | 260 | ||
- | 261 | subi r29, r30, 1 # r29 = 65535 |
|
- | 262 | ||
- | 263 | sub r31, r31, r30 |
|
- | 264 | andc r31, r31, r29 # pht = ALIGN_DOWN(memory_size - 65536, 65536) |
|
- | 265 | ||
- | 266 | mtsdr1 r31 |
|
- | 267 | ||
- | 268 | li r29, 2 |
|
- | 269 | srw r30, r30, r29 # r30 = 16384 |
|
259 | li r29, 0 |
270 | li r29, 0 |
260 | 271 | ||
261 | pht_clear: |
272 | pht_clear: |
262 | 273 | ||
263 | # write zeroes |
274 | # write zeroes |
Line 274... | Line 285... | ||
274 | 285 | ||
275 | DEBUG_end_pht_clear |
286 | DEBUG_end_pht_clear |
276 | 287 | ||
277 | clear_end: |
288 | clear_end: |
278 | 289 | ||
279 | lis r31, 0x07ff |
- | |
280 | ori r31, r31, 0x0000 |
- | |
281 | - | ||
282 | mtsdr1 r31 |
- | |
283 | - | ||
284 | #ifdef CONFIG_BAT |
290 | #ifdef CONFIG_BAT |
285 | 291 | ||
286 | # create BAT identity mapping |
292 | # create BAT identity mapping |
287 | 293 | ||
288 | DEBUG_mapping |
294 | DEBUG_mapping |
289 | 295 | ||
290 | lwz r31, 0(r3) |
296 | lwz r31, 0(r3) # r31 = memory size |
291 | 297 | ||
292 | lis r29, 0x0002 |
298 | lis r29, 0x0002 |
293 | cmpw r31, r29 |
299 | cmpw r31, r29 |
294 | blt no_bat # less than 128 KB -> no BAT |
300 | blt no_bat # less than 128 KB -> no BAT |
295 | 301 |