[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 09/18] ppc405_boards: Don't enforce presence of firmwar
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PULL 09/18] ppc405_boards: Don't enforce presence of firmware for qtest |
Date: |
Mon, 2 Sep 2013 10:11:24 +0200 |
From: Andreas Färber <address@hidden>
Adopt error_report() while at it.
Signed-off-by: Andreas Färber <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/ppc405_boards.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 807ada0..75b2177 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -27,9 +27,11 @@
#include "hw/timer/m48t59.h"
#include "hw/block/flash.h"
#include "sysemu/sysemu.h"
+#include "sysemu/qtest.h"
#include "block/block.h"
#include "hw/boards.h"
#include "qemu/log.h"
+#include "qemu/error-report.h"
#include "hw/loader.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
@@ -252,17 +254,20 @@ static void ref405ep_init(QEMUMachineInitArgs *args)
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
g_free(filename);
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
+ }
+ bios_size = (bios_size + 0xfff) & ~0xfff;
+ memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+ } else if (!qtest_enabled() || kernel_filename != NULL) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
} else {
+ /* Avoid an uninitialized variable warning */
bios_size = -1;
}
- if (bios_size < 0 || bios_size > BIOS_SIZE) {
- fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
- bios_name);
- exit(1);
- }
- bios_size = (bios_size + 0xfff) & ~0xfff;
memory_region_set_readonly(bios, true);
- memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
}
/* Register FPGA */
#ifdef DEBUG_BOARD_INIT
@@ -569,17 +574,17 @@ static void taihu_405ep_init(QEMUMachineInitArgs *args)
if (filename) {
bios_size = load_image(filename, memory_region_get_ram_ptr(bios));
g_free(filename);
- } else {
- bios_size = -1;
- }
- if (bios_size < 0 || bios_size > BIOS_SIZE) {
- fprintf(stderr, "qemu: could not load PowerPC bios '%s'\n",
- bios_name);
+ if (bios_size < 0 || bios_size > BIOS_SIZE) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
+ exit(1);
+ }
+ bios_size = (bios_size + 0xfff) & ~0xfff;
+ memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
+ } else if (!qtest_enabled()) {
+ error_report("Could not load PowerPC BIOS '%s'", bios_name);
exit(1);
}
- bios_size = (bios_size + 0xfff) & ~0xfff;
memory_region_set_readonly(bios, true);
- memory_region_add_subregion(sysmem, (uint32_t)(-bios_size), bios);
}
/* Register Linux flash */
dinfo = drive_get(IF_PFLASH, 0, fl_idx);
--
1.8.1.4
- [Qemu-ppc] [PULL 02/18] pseries: Fix stalls on hypervisor virtual console, (continued)
- [Qemu-ppc] [PULL 02/18] pseries: Fix stalls on hypervisor virtual console, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 07/18] ppc405_boards: Disable debug output, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 08/18] ppc405_uc: Disable debug output, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 03/18] target-ppc: USE LPCR_ILE to control exception endian on POWER7, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 01/18] PPC: E500: Generate device tree on reset, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 04/18] target-ppc: POWER7 supports the MSR_LE bit, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 14/18] xics: move registration of global state to realize(), Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 16/18] PPC: KVM: Compile fix for qemu_notify_event, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 17/18] spapr: add "stop-self" RTAS call required to support hot CPU unplug, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 11/18] spapr-pci: fix config space access to support bridges, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 09/18] ppc405_boards: Don't enforce presence of firmware for qtest,
Alexander Graf <=
- [Qemu-ppc] [PULL 18/18] PPC: spapr: iommu: rework traces, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 12/18] target-ppc: Use #define instead of opencoding SLB valid bit, Alexander Graf, 2013/09/02
- [Qemu-ppc] [PULL 13/18] spapr-pci: rework MSI/MSIX, Alexander Graf, 2013/09/02
- Re: [Qemu-ppc] [PULL 00/18] ppc patch queue 2013-09-02, Aurelien Jarno, 2013/09/03