Changeset 4872160 in mainline for boot/arch/ppc32/src/asm.S
- Timestamp:
- 2010-05-04T10:44:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 568db0f
- Parents:
- bb252ca
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc32/src/asm.S
rbb252ca r4872160 27 27 # 28 28 29 #include "asm.h" 30 #include "regname.h" 31 #include "ofwarch.h" 29 #include <arch/arch.h> 30 #include <arch/regname.h> 32 31 33 32 .macro SMC_COHERENCY addr … … 59 58 .endm 60 59 61 .text 62 60 .global start 63 61 .global halt 64 62 .global memcpy 65 63 .global jump_to_kernel 66 .global balloc_base 64 .global real_mode 65 66 .section BOOTSTRAP, "ax" 67 68 start: 69 lis r4, ofw_cif@ha 70 addi r4, r4, ofw_cif@l 71 stw r5, 0(r4) 72 73 bl ofw_init 74 b bootstrap 75 76 .text 67 77 68 78 halt: … … 127 137 jump_to_kernel: 128 138 129 # r3 = bootinfo (pa)130 # r 4 = bootinfo_size131 # r 5 = trans (pa)132 # r 6 = bytes to copy133 # r 7 = real_mode (pa)139 # arguments: 140 # r3 = bootinfo (physical address) 141 # r4 = translate table (physical address) 142 # r5 = pages to translate 143 # r6 = real mode meeting point (physical address) 134 144 135 145 # disable interrupts … … 139 149 mtmsr r31 140 150 141 # set real _mode meeting pointaddress142 143 mtspr srr0, r 7144 145 # jump sto real_mode151 # set real mode meeting point physical address 152 153 mtspr srr0, r6 154 155 # jump to real_mode 146 156 147 157 mfmsr r31 … … 155 165 rfi 156 166 167 .section REALMODE, "ax" 168 157 169 .align PAGE_WIDTH 158 balloc_base:159 .fill BALLOC_MAX_SIZE160 161 .section REALMODE, "ax"162 163 .align PAGE_WIDTH164 .global real_mode165 170 real_mode: 166 171 167 # copy kernel to proper location 168 # 169 # r3 = bootinfo (pa) 170 # r4 = bootinfo_size 171 # r5 = trans (pa) 172 # r6 = bytes to copy 172 # arguments: 173 # r3 = bootinfo (physical address) 174 # r4 = translate table (physical address) 175 # r5 = pages to translate 176 177 # move the images of components to the proper 178 # location using the translate table 173 179 174 180 li r31, PAGE_SIZE >> 2 … … 177 183 page_copy: 178 184 179 cmpwi r 6, 0185 cmpwi r5, 0 180 186 beq copy_end 181 187 182 # copy page183 184 188 mtctr r31 185 lwz r29, 0(r 5)189 lwz r29, 0(r4) 186 190 187 191 copy_loop: … … 194 198 addi r29, r29, 4 195 199 addi r30, r30, 4 196 subi r6, r6, 4197 198 cmpwi r6, 0199 beq copy_end200 200 201 201 bdnz copy_loop 202 203 addi r5, r5, 4 202 203 addi r4, r4, 4 204 subi r5, r5, 1 204 205 b page_copy 205 206 … … 266 267 # on top of memory, size 64 KB 267 268 268 lwz r31, 0(r3) # r31 = memory size269 lwz r31, 4(r3) # r31 = memory size 269 270 270 271 lis r30, 65536@h … … 303 304 # create BAT identity mapping 304 305 305 lwz r31, 0(r3) # r31 = memory size306 lwz r31, 4(r3) # r31 = memory size 306 307 307 308 lis r29, 0x0002 … … 354 355 # 355 356 # pc = PA2KA(BOOT_OFFSET) 356 # r3 = bootinfo (p a)357 # r3 = bootinfo (physical address) 357 358 # sprg0 = BOOT_OFFSET 358 359 # sprg3 = physical memory size 359 # sp = 0 ( pa)360 # sp = 0 (enforces the usage of sprg0 as exception stack) 360 361 361 362 lis r31, PA2KA(BOOT_OFFSET)@ha … … 367 368 mtsprg0 r31 368 369 369 lwz r31, 0(r3) 370 # bootinfo starts with a 64 bit integer containing 371 # the physical memory size, get the lower 4 bytes 372 373 lwz r31, 4(r3) 370 374 mtsprg3 r31 371 375 … … 379 383 isync 380 384 rfi 381 382 .align PAGE_WIDTH383 .global trans384 trans:385 .rept TRANS_SIZE386 .int 0387 .endr
Note:
See TracChangeset
for help on using the changeset viewer.