Changeset 3de8b81b in mainline for boot/arch/ppc64/loader/asm.S
- Timestamp:
- 2006-07-17T00:22:27Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41c4444
- Parents:
- fcf907e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc64/loader/asm.S
rfcf907e r3de8b81b 29 29 #include "asm.h" 30 30 #include "regname.h" 31 #include "debug.inc" 31 32 32 33 .text … … 109 110 # r6 = bytes to copy 110 111 # r7 = real_mode (pa) 112 # r8 = framebuffer (pa) 113 # r9 = scanline 111 114 112 115 # disable interrupts … … 138 141 real_mode: 139 142 143 DEBUG_INIT 144 DEBUG_real_mode 145 140 146 # copy kernel to proper location 141 147 # 142 148 # r5 = trans (pa) 143 149 # r6 = bytes to copy 150 # r8 = framebuffer (pa) 151 # r9 = scanline 144 152 145 153 li r31, PAGE_SIZE >> 2 … … 155 163 mtctr r31 156 164 lwz r29, 0(r5) 165 166 DEBUG_INIT 167 DEBUG_copy_loop 157 168 158 169 copy_loop: … … 169 180 170 181 bdnz copy_loop 182 183 DEBUG_end_copy_loop 171 184 172 185 addi r5, r5, 4 … … 175 188 copy_end: 176 189 190 DEBUG_segments 191 177 192 # initially fill segment registers 178 179 li r31, 16 180 mtctr r31 193 181 194 li r31, 0 182 li r30, 0x2000 183 184 seg_fill: 195 196 li r29, 8 197 mtctr r29 198 li r30, 0 # ASID 0 (VSIDs 0 .. 7) 199 200 seg_fill_uspace: 185 201 186 202 mtsrin r30, r31 187 addi r30, r30, 0x111203 addi r30, r30, 1 188 204 addis r31, r31, 0x1000 # move to next SR 189 205 190 bdnz seg_fill 206 bdnz seg_fill_uspace 207 208 li r29, 8 209 mtctr r29 210 lis r30, 0x4000 # priviledged access only 211 ori r30, r30, 8 # ASID 0 (VSIDs 8 .. 15) 212 213 seg_fill_kernel: 214 215 mtsrin r30, r31 216 addi r30, r30, 1 217 addis r31, r31, 0x1000 # move to next SR 218 219 bdnz seg_fill_kernel 220 221 # create empty Page Hash Table 222 # on top of memory, size 64 KB 223 224 DEBUG_pht 225 226 lwz r31, 0(r3) # r31 = memory size 227 228 lis r30, 65536@h 229 ori r30, r30, 65536@l # r30 = 65536 230 231 subi r29, r30, 1 # r29 = 65535 232 233 sub r31, r31, r30 234 andc r31, r31, r29 # pht = ALIGN_DOWN(memory_size - 65536, 65536) 235 236 mtsdr1 r31 237 238 li r29, 2 239 srw r30, r30, r29 # r30 = 16384 240 li r29, 0 241 242 pht_clear: 243 244 # write zeroes 245 246 stw r29, 0(r31) 247 248 addi r31, r31, 4 249 subi r30, r30, 4 250 251 cmpwi r30, 0 252 beq clear_end 253 254 bdnz pht_clear 255 256 DEBUG_end_pht_clear 257 258 clear_end: 259 260 DEBUG_tlb 191 261 192 262 tlbia 193 263 tlbsync 194 264 265 DEBUG_prepare 266 195 267 # start the kernel 196 268 # 269 # pc = KERNEL_START_ADDR 197 270 # r3 = bootinfo (pa) 271 # sprg0 = KA2PA(KERNEL_START_ADDR) 272 # sprg3 = physical memory size 273 # sp = 0 (pa) 198 274 199 275 lis r31, KERNEL_START_ADDR@ha … … 201 277 202 278 mtspr srr0, r31 279 280 subis r31, r31, 0x8000 281 mtsprg0 r31 282 283 lwz r31, 0(r3) 284 mtsprg3 r31 285 286 li sp, 0 203 287 204 288 mfmsr r31 … … 208 292 sync 209 293 isync 294 295 DEBUG_rfi 210 296 rfid 211 297
Note:
See TracChangeset
for help on using the changeset viewer.