Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- arch/sparc32/boot.c | 2 ++ arch/sparc32/openbios.c | 10 ++++++++++ include/drivers/drivers.h | 2 ++ 3 files changed, 14 insertions(+)
diff --git a/arch/sparc32/boot.c b/arch/sparc32/boot.c index e9605f5..bb5a579 100644 --- a/arch/sparc32/boot.c +++ b/arch/sparc32/boot.c @@ -17,6 +17,8 @@
uint32_t kernel_image; uint32_t kernel_size; +uint32_t initrd_image; +uint32_t initrd_size; uint32_t qemu_cmdline; uint32_t cmdline_size; char boot_device; diff --git a/arch/sparc32/openbios.c b/arch/sparc32/openbios.c index 030f4ed..78005e0 100644 --- a/arch/sparc32/openbios.c +++ b/arch/sparc32/openbios.c @@ -932,6 +932,16 @@ arch_init( void ) obp_arg.argv[1] = cmdline; qemu_cmdline = (uint32_t)cmdline;
+ initrd_size = fw_cfg_read_i32(FW_CFG_INITRD_SIZE); + if (initrd_size) { + initrd_image = fw_cfg_read_i32(FW_CFG_INITRD_ADDR); + + /* Mark initrd memory as mapped 1:1 and in use */ + ofmem_claim_phys(PAGE_ALIGN(initrd_image), PAGE_ALIGN(initrd_size), 0); + ofmem_claim_virt(PAGE_ALIGN(initrd_image), PAGE_ALIGN(initrd_size), 0); + ofmem_map(PAGE_ALIGN(initrd_image), PAGE_ALIGN(initrd_image), PAGE_ALIGN(initrd_size), -1); + } + /* Setup nvram variables */ push_str("/options"); fword("find-device"); diff --git a/include/drivers/drivers.h b/include/drivers/drivers.h index d162901..e568f28 100644 --- a/include/drivers/drivers.h +++ b/include/drivers/drivers.h @@ -106,6 +106,8 @@ void ob_intr(int intr); /* arch/sparc32/boot.c */ extern uint32_t kernel_image; extern uint32_t kernel_size; +extern uint32_t initrd_image; +extern uint32_t initrd_size; extern uint32_t qemu_cmdline; extern uint32_t cmdline_size; extern char boot_device;