Changeset 3de8b81b in mainline
- 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
- Location:
- boot/arch/ppc64/loader
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc64/loader/Makefile
rfcf907e r3de8b81b 62 62 $(USPACEDIR)/ns/ns \ 63 63 $(USPACEDIR)/init/init \ 64 $(USPACEDIR)/fb/fb 64 $(USPACEDIR)/fb/fb \ 65 $(USPACEDIR)/kbd/kbd \ 66 $(USPACEDIR)/console/console \ 67 $(USPACEDIR)/tetris/tetris \ 68 $(USPACEDIR)/ipcc/ipcc \ 69 $(USPACEDIR)/klog/klog 65 70 66 71 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) -
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 -
boot/arch/ppc64/loader/asm.h
rfcf907e r3de8b81b 27 27 */ 28 28 29 #ifndef __ASM_H__30 #define __ASM_H__29 #ifndef BOOT_ppc64_ASM_H_ 30 #define BOOT_ppc64_ASM_H_ 31 31 32 32 #define PAGE_SIZE 4096 … … 36 36 #define TRANS_ITEM_SIZE 8 37 37 38 #define KERNEL_START_ADDR 0x8000 400038 #define KERNEL_START_ADDR 0x80008000 39 39 40 40 #ifndef __ASM__ … … 45 45 46 46 extern void halt(); 47 extern void jump_to_kernel(void *bootinfo, unsigned long bootinfo_size, void *trans, unsigned long kernel_size, void *real_mode ) __attribute__((noreturn));47 extern void jump_to_kernel(void *bootinfo, unsigned long bootinfo_size, void *trans, unsigned long kernel_size, void *real_mode, void *fb, unsigned long scanline) __attribute__((noreturn)); 48 48 extern void real_mode(); 49 49 -
boot/arch/ppc64/loader/main.c
rfcf907e r3de8b81b 32 32 #include "_components.h" 33 33 #include <ofw.h> 34 #include <align.h> 34 35 35 36 #define HEAP_GAP 1024000 … … 102 103 } 103 104 105 if (!ofw_keyboard(&bootinfo.keyboard)) { 106 printf("Error: unable to get keyboard properties, halting.\n"); 107 halt(); 108 } 109 104 110 printf("\nDevice statistics\n"); 105 111 printf(" screen at %L, resolution %dx%d, %d bpp (scanline %d bytes)\n", bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height, bootinfo.screen.bpp, bootinfo.screen.scanline); 112 printf(" keyboard at %L (size %d bytes)\n", bootinfo.keyboard.addr, bootinfo.keyboard.size); 106 113 107 114 void *real_mode_pa = ofw_translate(&real_mode); … … 152 159 153 160 printf("\nBooting the kernel...\n"); 154 jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa );161 jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa, (void *) bootinfo.screen.addr, bootinfo.screen.scanline); 155 162 } -
boot/arch/ppc64/loader/main.h
rfcf907e r3de8b81b 30 30 #define BOOT_ppc64_MAIN_H_ 31 31 32 #include <ofw.h>32 #include "ofw.h" 33 33 34 34 #define TASKMAP_MAX_RECORDS 32 … … 40 40 41 41 typedef struct { 42 unsigned intcount;42 unsigned long count; 43 43 task_t tasks[TASKMAP_MAX_RECORDS]; 44 44 } taskmap_t; 45 45 46 46 typedef struct { 47 memmap_t memmap; 47 48 taskmap_t taskmap; 48 memmap_t memmap;49 49 screen_t screen; 50 keyboard_t keyboard; 50 51 } bootinfo_t; 51 52 -
boot/arch/ppc64/loader/ofwarch.c
rfcf907e r3de8b81b 57 57 if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0) 58 58 return false; 59 keyboard->addr = (void *) macio.addr.addr_lo;59 keyboard->addr = (void *) (((unsigned long) macio.addr.addr_lo) | (((unsigned long) macio.addr.addr_hi) << 32)); 60 60 keyboard->size = macio.size_lo; 61 61
Note:
See TracChangeset
for help on using the changeset viewer.