Changeset bab785fe in mainline


Ignore:
Timestamp:
2006-06-18T12:03:01Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60316bd
Parents:
a88ab795
Message:

pick the best BAT mapping

Location:
arch/ppc32/loader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/loader/asm.S

    ra88ab795 rbab785fe  
    196196        li r29, 8
    197197        mtctr r29
    198         li r30, 0
     198        li r30, 0                     # ASID 0 (VSIDs 0 .. 7)
    199199
    200200        seg_fill_uspace:
     
    208208        li r29, 8
    209209        mtctr r29
    210         lis r30, 0x4000
    211         ori r30, r30, 8
     210        lis r30, 0x4000               # priviledged access only
     211        ori r30, r30, 8               # ASID 0 (VSIDs 8 .. 15)
    212212       
    213213        seg_fill_kernel:
     
    261261        pht_clear:
    262262               
     263                # write zeroes
     264               
    263265                stw r29, 0(r31)
    264266               
     
    280282        mtsdr1 r31
    281283       
    282         # create identity mapping
    283        
    284284#ifdef CONFIG_BAT
    285285       
     286        # create BAT identity mapping
     287       
    286288        DEBUG_mapping
    287289       
    288         # FIXME: map exactly the size of RAM
    289        
    290         lis r31, 0x8000
    291         ori r31, r31, 0x0ffe
     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
     300        # the leading logical one 14 times
     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       
     318        lis r29, 0x8000
     319        or r29, r29, r31
    292320       
    293321        lis r30, 0x0000
    294322        ori r30, r30, 0x0002
    295323       
    296         mtspr ibat0u, r31
     324        mtspr ibat0u, r29
    297325        mtspr ibat0l, r30
    298326       
    299         mtspr dbat0u, r31
     327        mtspr dbat0u, r29
    300328        mtspr dbat0l, r30
     329       
     330        no_bat:
    301331
    302332#endif
  • arch/ppc32/loader/debug.inc

    ra88ab795 rbab785fe  
    83088308#endif
    83098309.endm
     8310
     8311.macro DEBUG_bat_mask
     8312#ifdef CONFIG_DEBUG
     8313#endif
     8314.endm
Note: See TracChangeset for help on using the changeset viewer.