/branches/dynload/boot/arch/ppc32/loader/debug.inc |
---|
File deleted |
/branches/dynload/boot/arch/ppc32/loader/_link.ld.in |
---|
3,7 → 3,7 |
ENTRY(start) |
SECTIONS { |
.boot 0x10000000: AT (0) { |
.boot 0x01000000: AT (0) { |
*(BOOTSTRAP); |
*(REALMODE); |
*(.text); |
/branches/dynload/boot/arch/ppc32/loader/asm.S |
---|
28,8 → 28,26 |
#include "asm.h" |
#include "regname.h" |
#include "debug.inc" |
.macro SMC_COHERENCY addr |
dcbst 0, \addr |
sync |
icbi 0, \addr |
sync |
isync |
.endm |
.macro FLUSH_DCACHE addr |
dcbst 0, \addr |
sync |
isync |
.endm |
.macro TLB_FLUSH reg |
tlbie \reg |
addi \reg, \reg, 0x1000 |
.endm |
.text |
.global halt |
140,9 → 158,6 |
real_mode: |
DEBUG_INIT |
DEBUG_real_mode |
# copy kernel to proper location |
# |
# r5 = trans (pa) |
163,14 → 178,13 |
mtctr r31 |
lwz r29, 0(r5) |
DEBUG_INIT |
DEBUG_copy_loop |
copy_loop: |
lwz r28, 0(r29) |
stw r28, 0(r30) |
SMC_COHERENCY r30 |
addi r29, r29, 4 |
addi r30, r30, 4 |
subi r6, r6, 4 |
180,15 → 194,11 |
bdnz copy_loop |
DEBUG_end_copy_loop |
addi r5, r5, 4 |
b page_copy |
copy_end: |
DEBUG_segments |
# initially fill segment registers |
li r31, 0 |
220,8 → 230,6 |
# invalidate block address translation registers |
DEBUG_bat |
li r30, 0 |
mtspr ibat0u, r30 |
251,8 → 259,6 |
# create empty Page Hash Table |
# on top of memory, size 64 KB |
DEBUG_pht |
lwz r31, 0(r3) # r31 = memory size |
lis r30, 65536@h |
274,6 → 280,7 |
# write zeroes |
stw r29, 0(r31) |
FLUSH_DCACHE r31 |
addi r31, r31, 4 |
subi r30, r30, 4 |
283,8 → 290,6 |
bdnz pht_clear |
DEBUG_end_pht_clear |
clear_end: |
#ifdef CONFIG_BAT |
291,8 → 296,6 |
# create BAT identity mapping |
DEBUG_mapping |
lwz r31, 0(r3) # r31 = memory size |
lis r29, 0x0002 |
315,8 → 318,6 |
bdnz bat_mask |
DEBUG_bat_mask |
andi. r31, r31, 0x07ff # mask = mask & 0x07ff (BAT can map up to 256 MB) |
li r29, 2 |
339,13 → 340,87 |
#endif |
DEBUG_tlb |
# flush TLB |
tlbia |
li r31, 0 |
sync |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
TLB_FLUSH r31 |
eieio |
tlbsync |
sync |
DEBUG_prepare |
# start the kernel |
# |
# pc = KERNEL_START_ADDR |
373,8 → 448,6 |
sync |
isync |
DEBUG_rfi |
rfi |
.align PAGE_WIDTH |
/branches/dynload/boot/arch/ppc32/loader/regname.h |
---|
208,11 → 208,13 |
#define hid0 1008 |
/* MSR bits */ |
#define msr_ir (1 << 4) |
#define msr_dr (1 << 5) |
#define msr_dr (1 << 4) |
#define msr_ir (1 << 5) |
#define msr_pr (1 << 14) |
#define msr_ee (1 << 15) |
/* HID0 bits */ |
#define hid0_sten (1 << 24) |
#define hid0_ice (1 << 15) |
#define hid0_dce (1 << 14) |
#define hid0_icfi (1 << 11) |
/branches/dynload/boot/arch/ppc32/loader/main.c |
---|
89,7 → 89,7 |
/** Print version information. */ |
static void version_print(void) |
{ |
printf("HelenOS PPC32 Bootloader\nRelease %s%s%s\nCopyright (c) 2006 HelenOS project\n", release, revision, timestamp); |
printf("HelenOS PPC32 Bootloader\nRelease %s%s%s\nCopyright (c) 2006 HelenOS project\n\n", release, revision, timestamp); |
} |
void bootstrap(void) |
107,25 → 107,29 |
check_align(&trans, "translation table"); |
if (!ofw_memmap(&bootinfo.memmap)) { |
printf("Error: unable to get memory map, halting.\n"); |
printf("Error: Unable to get memory map, halting.\n"); |
halt(); |
} |
if (bootinfo.memmap.total == 0) { |
printf("Error: no memory detected, halting.\n"); |
printf("Error: No memory detected, halting.\n"); |
halt(); |
} |
if (!ofw_screen(&bootinfo.screen)) |
printf("Warning: unable to get screen properties.\n"); |
printf("Warning: Unable to get screen properties.\n"); |
if (!ofw_keyboard(&bootinfo.keyboard)) |
printf("Warning: unable to get keyboard properties.\n"); |
if (!ofw_macio(&bootinfo.macio)) |
printf("Warning: Unable to get macio properties.\n"); |
printf("\nDevice statistics\n"); |
printf("Device statistics\n"); |
if (bootinfo.screen.addr) |
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); |
printf(" keyboard at %L (size %d bytes)\n", bootinfo.keyboard.addr, bootinfo.keyboard.size); |
if (bootinfo.macio.addr) |
printf(" macio at %L (size %d bytes)\n", bootinfo.macio.addr, bootinfo.macio.size); |
void *real_mode_pa = ofw_translate(&real_mode); |
void *trans_pa = ofw_translate(&trans); |
void *bootinfo_pa = ofw_translate(&bootinfo); |
/branches/dynload/boot/arch/ppc32/loader/main.h |
---|
47,7 → 47,7 |
memmap_t memmap; |
taskmap_t taskmap; |
screen_t screen; |
keyboard_t keyboard; |
macio_t macio; |
} bootinfo_t; |
extern void start(void); |
/branches/dynload/boot/arch/ppc32/loader/ofwarch.c |
---|
48,7 → 48,7 |
} |
} |
int ofw_keyboard(keyboard_t *keyboard) |
int ofw_macio(macio_t *macio) |
{ |
char device_name[BUF_SIZE]; |
59,12 → 59,13 |
if (device == -1) |
return false; |
pci_reg_t macio; |
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0) |
pci_reg_t pci_reg; |
if (ofw_get_property(device, "assigned-addresses", &pci_reg, sizeof(pci_reg)) <= 0) |
return false; |
keyboard->addr = (void *) macio.addr.addr_lo; |
keyboard->size = macio.size_lo; |
macio->addr = (void *) pci_reg.addr.addr_lo; |
macio->size = pci_reg.size_lo; |
return true; |
} |