Changeset 46c20c8 in mainline for boot/arch/ppc32/src/asm.S
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45df59a
- Parents:
- fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
boot/arch/ppc32/src/asm.S (moved) (moved from boot/arch/ppc32/loader/asm.S ) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc32/src/asm.S
rfb150d78 r46c20c8 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 60 .global start 61 .global halt 62 .global jump_to_kernel 63 .global real_mode 64 65 .section BOOTSTRAP, "ax" 66 67 start: 68 lis r4, ofw_cif@ha 69 addi r4, r4, ofw_cif@l 70 stw r5, 0(r4) 71 72 bl ofw_init 73 b bootstrap 74 61 75 .text 62 63 .global halt64 .global memcpy65 .global jump_to_kernel66 .global balloc_base67 76 68 77 halt: 69 78 b halt 70 79 71 memcpy:72 srwi. r7, r5, 373 addi r6, r3, -474 addi r4, r4, -475 beq 2f76 77 andi. r0, r6, 378 mtctr r779 bne 5f80 81 1:82 lwz r7, 4(r4)83 lwzu r8, 8(r4)84 stw r7, 4(r6)85 stwu r8, 8(r6)86 bdnz 1b87 88 andi. r5, r5, 789 90 2:91 cmplwi 0, r5, 492 blt 3f93 94 lwzu r0, 4(r4)95 addi r5, r5, -496 stwu r0, 4(r6)97 98 3:99 cmpwi 0, r5, 0100 beqlr101 mtctr r5102 addi r4, r4, 3103 addi r6, r6, 3104 105 4:106 lbzu r0, 1(r4)107 stbu r0, 1(r6)108 bdnz 4b109 blr110 111 5:112 subfic r0, r0, 4113 mtctr r0114 115 6:116 lbz r7, 4(r4)117 addi r4, r4, 1118 stb r7, 4(r6)119 addi r6, r6, 1120 bdnz 6b121 subf r5, r0, r5122 rlwinm. r7, r5, 32-3, 3, 31123 beq 2b124 mtctr r7125 b 1b126 127 80 jump_to_kernel: 128 81 129 # r3 = bootinfo (pa)130 # r 4 = bootinfo_size131 # r 5 = trans (pa)132 # r 6 = bytes to copy133 # r 7 = real_mode (pa)82 # arguments: 83 # r3 = bootinfo (physical address) 84 # r4 = translate table (physical address) 85 # r5 = pages to translate 86 # r6 = real mode meeting point (physical address) 134 87 135 88 # disable interrupts … … 139 92 mtmsr r31 140 93 141 # set real _mode meeting pointaddress142 143 mtspr srr0, r 7144 145 # jump sto real_mode94 # set real mode meeting point physical address 95 96 mtspr srr0, r6 97 98 # jump to real_mode 146 99 147 100 mfmsr r31 … … 155 108 rfi 156 109 110 .section REALMODE, "ax" 111 157 112 .align PAGE_WIDTH 158 balloc_base:159 .fill BALLOC_MAX_SIZE160 161 .section REALMODE, "ax"162 163 .align PAGE_WIDTH164 .global real_mode165 113 real_mode: 166 114 167 # copy kernel to proper location 168 # 169 # r3 = bootinfo (pa) 170 # r4 = bootinfo_size 171 # r5 = trans (pa) 172 # r6 = bytes to copy 115 # arguments: 116 # r3 = bootinfo (physical address) 117 # r4 = translate table (physical address) 118 # r5 = pages to translate 119 120 # move the images of components to the proper 121 # location using the translate table 173 122 174 123 li r31, PAGE_SIZE >> 2 … … 177 126 page_copy: 178 127 179 cmpwi r 6, 0128 cmpwi r5, 0 180 129 beq copy_end 181 130 182 # copy page183 184 131 mtctr r31 185 lwz r29, 0(r 5)132 lwz r29, 0(r4) 186 133 187 134 copy_loop: … … 194 141 addi r29, r29, 4 195 142 addi r30, r30, 4 196 subi r6, r6, 4197 198 cmpwi r6, 0199 beq copy_end200 143 201 144 bdnz copy_loop 202 203 addi r5, r5, 4 145 146 addi r4, r4, 4 147 subi r5, r5, 1 204 148 b page_copy 205 149 … … 266 210 # on top of memory, size 64 KB 267 211 268 lwz r31, 0(r3) # r31 = memory size212 lwz r31, 4(r3) # r31 = memory size 269 213 270 214 lis r30, 65536@h … … 303 247 # create BAT identity mapping 304 248 305 lwz r31, 0(r3) # r31 = memory size249 lwz r31, 4(r3) # r31 = memory size 306 250 307 251 lis r29, 0x0002 … … 354 298 # 355 299 # pc = PA2KA(BOOT_OFFSET) 356 # r3 = bootinfo (p a)300 # r3 = bootinfo (physical address) 357 301 # sprg0 = BOOT_OFFSET 358 302 # sprg3 = physical memory size 359 # sp = 0 ( pa)303 # sp = 0 (enforces the usage of sprg0 as exception stack) 360 304 361 305 lis r31, PA2KA(BOOT_OFFSET)@ha … … 367 311 mtsprg0 r31 368 312 369 lwz r31, 0(r3) 313 # bootinfo starts with a 64 bit integer containing 314 # the physical memory size, get the lower 4 bytes 315 316 lwz r31, 4(r3) 370 317 mtsprg3 r31 371 318 … … 379 326 isync 380 327 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.
