提交 33259956 编写于 作者: A Alexander Graf

S390: IPL: Support ELF firmware

Our firmware blob is always a raw file that we load at a fixed address today.
Support loading an ELF blob instead that we can map high up in memory.

This way we don't have to be so conscious about size constraints.
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 74ad2d22
...@@ -82,17 +82,21 @@ static int s390_ipl_init(SysBusDevice *dev) ...@@ -82,17 +82,21 @@ static int s390_ipl_init(SysBusDevice *dev)
} }
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, 4096); bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
ipl->start_addr = ZIPL_IMAGE_START; NULL, 1, ELF_MACHINE, 0);
if (bios_size == -1UL) {
bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START,
4096);
ipl->start_addr = ZIPL_IMAGE_START;
if (bios_size > 4096) {
hw_error("stage1 bootloader is > 4k\n");
}
}
g_free(bios_filename); g_free(bios_filename);
if ((long)bios_size < 0) { if ((long)bios_size < 0) {
hw_error("could not load bootloader '%s'\n", bios_name); hw_error("could not load bootloader '%s'\n", bios_name);
} }
if (bios_size > 4096) {
hw_error("stage1 bootloader is > 4k\n");
}
return 0; return 0;
} else { } else {
kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL, NULL, kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL, NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册