/kernel/trunk/arch/ppc32/include/asm/spr.h |
---|
29,8 → 29,8 |
#ifndef __ppc32_SPR_H__ |
#define __ppc32_SPR_H__ |
#define MSR_DR (1<<27) |
#define MSR_IR (1<<26) |
#define MSR_IR (1 << 4) |
#define MSR_DR (1 << 5) |
#define SPRN_SRR0 0x1a |
#define SPRN_SRR1 0x1b |
/kernel/trunk/arch/ppc32/include/arch.h |
---|
29,6 → 29,4 |
#ifndef __ppc32_ARCH_H__ |
#define __ppc32_ARCH_H__ |
#include <genarch/ofw/ofw.h> |
#endif |
/kernel/trunk/arch/ppc32/include/mm/memory_init.h |
---|
32,6 → 32,5 |
#include <typedefs.h> |
size_t get_memory_size(void); |
void preboot_read_config(void); |
#endif |
/kernel/trunk/arch/ppc32/src/console.c |
---|
27,7 → 27,6 |
*/ |
#include <arch/console.h> |
#include <genarch/ofw/ofw.h> |
#include <console/chardev.h> |
#include <console/console.h> |
#include <genarch/fb/fb.h> |
37,5 → 36,5 |
void ppc32_console_init(void) |
{ |
/* TODO: PCI detection etc. etc. - this is fine in PearPC for now */ |
fb_init(0x84000000,800,600,4); |
fb_init(0x84000000, 800, 600, 4); |
} |
/kernel/trunk/arch/ppc32/src/mm/frame.c |
---|
29,11 → 29,9 |
#include <arch/mm/frame.h> |
#include <arch/mm/memory_init.h> |
#include <mm/frame.h> |
#include <genarch/ofw/memory_init.h> |
void frame_arch_init(void) |
{ |
ofw_init_zones(); |
/* First is exception vector, second is 'implementation specific' */ |
frame_mark_unavailable(0, 2); |
} |
/kernel/trunk/arch/ppc32/src/mm/memory_init.c |
---|
27,15 → 27,9 |
*/ |
#include <arch/mm/memory_init.h> |
#include <genarch/ofw/memory_init.h> |
#include <typedefs.h> |
void preboot_read_config(void) |
{ |
ofw_init_memmap(); |
} |
size_t get_memory_size(void) |
{ |
return ofw_get_memory_size(); |
return 0; |
} |
/kernel/trunk/arch/ppc32/src/start.S |
---|
33,65 → 33,5 |
.global kernel_image_start |
.org 0x0 |
/* 256 bytes of some data */ |
/* exception table - must use 'ba' instructions for branches, |
* because it is elsewhere than the linker thinks |
*/ |
.space 4096 |
kernel_image_start: |
/* Initialize OFW, might be needed before relocate_kernel? */ |
lis r4, ofw@ha |
addi r4, r4, ofw@l |
stw r5, 0(r4) |
bl ofw_init |
bl preboot_read_config |
bl relocate_kernel |
__after_reloc: |
/* Set stack to some more meaningful value */ |
/* TODO: This is hardcoded for PearPC, must be changed later */ |
lis r1, 0x70 |
b main_bsp |
relocate_kernel: |
/* TODO: We _know_ that pearpc loads it to 8MB, and |
* but it should be really generic |
*/ |
lis r4, 0x80 /* r4 is where data was loaded - 8MB */ |
bl to_real_mode |
/* Now we are in real mode, copy first block and jump to it, |
* we are running in the loaded kernel now |
* We still have in r3 physical load kernel address |
*/ |
b __after_reloc /* We know in pearpc we are ok, so return, |
* otherwise we should relocate kernel |
* here |
*/ |
/* Turn off page translation |
* - assume that physical-loaded address is in r4 |
*/ |
to_real_mode: |
mflr r0 |
lis r5, ktext_start@ha // Expected start of kernel |
addi r5, r5, ktext_start@l |
add r0, r4, r0 |
sub r0, r0, r5 // r0 now contains physical return address |
mfmsr r3 |
andis. r3, r3, (~MSR_DR | MSR_IR) >> 16 |
mtspr SPRN_SRR0, r0 |
mtspr SPRN_SRR1, r3 |
sync // Really needed? RFI should do it as well? |
RFI |