[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 02/24] S390: IPL: Support ELF firmware
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 02/24] S390: IPL: Support ELF firmware |
Date: |
Fri, 26 Apr 2013 20:19:11 +0200 |
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: Alexander Graf <address@hidden>
---
hw/s390x/ipl.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index c43dfcd..d1f7acd 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -82,17 +82,21 @@ static int s390_ipl_init(SysBusDevice *dev)
}
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
- bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, 4096);
- ipl->start_addr = ZIPL_IMAGE_START;
+ bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
+ 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);
if ((long)bios_size < 0) {
hw_error("could not load bootloader '%s'\n", bios_name);
}
-
- if (bios_size > 4096) {
- hw_error("stage1 bootloader is > 4k\n");
- }
return 0;
} else {
kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL, NULL,
--
1.6.0.2
- [Qemu-ppc] [PULL 00/24] s390 patch queue 2013-04-26, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 02/24] S390: IPL: Support ELF firmware,
Alexander Graf <=
- [Qemu-ppc] [PATCH 04/24] S390: ccw firmware: Add start assembly, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 01/24] S390: Make IPL reset address dynamic, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 13/24] s390-ccw.img: Take care of the elf->img transition, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 11/24] s390-ccw.img: replace while loop with a disabled wait on s390 bios, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 10/24] S390: ccw firmware: Add Makefile, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 12/24] s390-ccw.img: build s390-ccw rom on s3900 system by default, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 14/24] s390-ccw.img: Fix compile warning in s390 ccw virtio code, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 05/24] S390: ccw firmware: Add main program, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 08/24] S390: ccw firmware: Add glue header, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 09/24] S390: ccw firmware: Add bootmap interpreter, Alexander Graf, 2013/04/26