[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 030/113] rx: move BIOS load from MCU to board
From: |
Paolo Bonzini |
Subject: |
[PULL 030/113] rx: move BIOS load from MCU to board |
Date: |
Wed, 2 Dec 2020 03:07:26 -0500 |
The ROM loader state is global and not part of the MCU, and the
BIOS is in machine->firmware. So just like the kernel case,
load it in the board.
Due to the ordering between CPU reset and ROM reset, the ROM
has to be registered before the CPU is realized, otherwise
the reset vector is loaded before the ROM is there.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/rx/rx-gdbsim.c | 10 ++++++++++
hw/rx/rx62n.c | 9 ---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c
index 285549c79b..b1d7c2488f 100644
--- a/hw/rx/rx-gdbsim.c
+++ b/hw/rx/rx-gdbsim.c
@@ -106,6 +106,16 @@ static void rx_gdbsim_init(MachineState *machine)
rxc->xtal_freq_hz, &error_abort);
object_property_set_bool(OBJECT(&s->mcu), "load-kernel",
kernel_filename != NULL, &error_abort);
+
+ if (!kernel_filename) {
+ if (machine->firmware) {
+ rom_add_file_fixed(machine->firmware, RX62N_CFLASH_BASE, 0);
+ } else if (!qtest_enabled()) {
+ error_report("No bios or kernel specified");
+ exit(1);
+ }
+ }
+
qdev_realize(DEVICE(&s->mcu), NULL, &error_abort);
/* Load kernel and dtb */
diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c
index 6eb4eea700..17ec73fc7b 100644
--- a/hw/rx/rx62n.c
+++ b/hw/rx/rx62n.c
@@ -245,15 +245,6 @@ static void rx62n_realize(DeviceState *dev, Error **errp)
rxc->rom_flash_size, &error_abort);
memory_region_add_subregion(s->sysmem, RX62N_CFLASH_BASE, &s->c_flash);
- if (!s->kernel) {
- if (bios_name) {
- rom_add_file_fixed(bios_name, RX62N_CFLASH_BASE, 0);
- } else if (!qtest_enabled()) {
- error_report("No bios or kernel specified");
- exit(1);
- }
- }
-
/* Initialize CPU */
object_initialize_child(OBJECT(s), "cpu", &s->cpu, TYPE_RX62N_CPU);
qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
--
2.26.2
- [PULL 024/113] i386: remove bios_name, (continued)
- [PULL 024/113] i386: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 025/113] lm32: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 020/113] hw/net/xilinx_axienet: Rename StreamSlave as StreamSink, Paolo Bonzini, 2020/12/02
- [PULL 027/113] mips: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 018/113] hw/core/stream: Rename StreamSlave as StreamSink, Paolo Bonzini, 2020/12/02
- [PULL 016/113] hw/ssi: Update coding style to make checkpatch.pl happy, Paolo Bonzini, 2020/12/02
- [PULL 028/113] moxie: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 017/113] hw/ssi: Rename SSI 'slave' as 'peripheral', Paolo Bonzini, 2020/12/02
- [PULL 023/113] hppa: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 026/113] m68k: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 030/113] rx: move BIOS load from MCU to board,
Paolo Bonzini <=
- [PULL 037/113] cris: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 031/113] s390: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 038/113] hppa: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 036/113] arm: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 029/113] ppc: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 032/113] sh4: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 035/113] vl: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 034/113] digic: remove bios_name, Paolo Bonzini, 2020/12/02
- [PULL 040/113] m68k: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 033/113] sparc: remove bios_name, Paolo Bonzini, 2020/12/02