Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- arch/sparc64/boot.c | 2 ++ arch/sparc64/boot.h | 2 ++ arch/sparc64/openbios.c | 10 ++++++++++ 3 files changed, 14 insertions(+)
diff --git a/arch/sparc64/boot.c b/arch/sparc64/boot.c index 54f6f7a..43bd562 100644 --- a/arch/sparc64/boot.c +++ b/arch/sparc64/boot.c @@ -13,6 +13,8 @@
uint64_t kernel_image; uint64_t kernel_size; +uint64_t initrd_image; +uint64_t initrd_size; uint64_t qemu_cmdline; uint64_t cmdline_size; char *boot_device; diff --git a/arch/sparc64/boot.h b/arch/sparc64/boot.h index 88beb1c..a4f5c12 100644 --- a/arch/sparc64/boot.h +++ b/arch/sparc64/boot.h @@ -12,6 +12,8 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline); // boot.c extern uint64_t kernel_image; extern uint64_t kernel_size; +extern uint64_t initrd_image; +extern uint64_t initrd_size; extern uint64_t qemu_cmdline; extern uint64_t cmdline_size; extern char *boot_device; diff --git a/arch/sparc64/openbios.c b/arch/sparc64/openbios.c index 596c5f2..a783c1f 100644 --- a/arch/sparc64/openbios.c +++ b/arch/sparc64/openbios.c @@ -580,6 +580,16 @@ void arch_nvram_get(char *data) qemu_cmdline = (uint64_t)obio_cmdline; cmdline_size = size;
+ 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); + } + if (kernel_size) printk("kernel addr %llx size %llx\n", kernel_image, kernel_size); if (size)