[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/10] hw/riscv: virt: Move create_fw_cfg() prior to loading kerne
From: |
Alistair Francis |
Subject: |
[PULL 05/10] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel |
Date: |
Fri, 14 Oct 2022 17:58:25 +1000 |
From: Sunil V L <sunilvl@ventanamicro.com>
To enable both -kernel and -pflash options, the fw_cfg needs to be
created prior to loading the kernel.
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20221004092351.18209-3-sunilvl@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
hw/riscv/virt.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index befa9d2c26..de2efccebf 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -1267,6 +1267,13 @@ static void virt_machine_done(Notifier *notifier, void
*data)
RISCV64_BIOS_BIN, start_addr, NULL);
}
+ /*
+ * Init fw_cfg. Must be done before riscv_load_fdt, otherwise the device
+ * tree cannot be altered and we get FDT_ERR_NOSPACE.
+ */
+ s->fw_cfg = create_fw_cfg(machine);
+ rom_set_fw(s->fw_cfg);
+
if (machine->kernel_filename) {
kernel_start_addr = riscv_calc_kernel_start_addr(&s->soc[0],
firmware_end_addr);
@@ -1300,13 +1307,6 @@ static void virt_machine_done(Notifier *notifier, void
*data)
start_addr = virt_memmap[VIRT_FLASH].base;
}
- /*
- * Init fw_cfg. Must be done before riscv_load_fdt, otherwise the device
- * tree cannot be altered and we get FDT_ERR_NOSPACE.
- */
- s->fw_cfg = create_fw_cfg(machine);
- rom_set_fw(s->fw_cfg);
-
/* Compute the fdt load address in dram */
fdt_load_addr = riscv_load_fdt(memmap[VIRT_DRAM].base,
machine->ram_size, machine->fdt);
--
2.37.3
- [PULL 00/10] riscv-to-apply queue, Alistair Francis, 2022/10/14
- [PULL 02/10] hw/ssi: ibex_spi: fixup coverity issue, Alistair Francis, 2022/10/14
- [PULL 01/10] hw/riscv: Update comment for qtest check in riscv_find_firmware(), Alistair Francis, 2022/10/14
- [PULL 03/10] hw/ssi: ibex_spi: fixup/add rw1c functionality, Alistair Francis, 2022/10/14
- [PULL 04/10] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location, Alistair Francis, 2022/10/14
- [PULL 06/10] hw/riscv: virt: Enable booting S-mode firmware from pflash, Alistair Francis, 2022/10/14
- [PULL 05/10] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel,
Alistair Francis <=
- [PULL 08/10] hw/intc: sifive_plic: fix hard-coded max priority level, Alistair Francis, 2022/10/14
- [PULL 07/10] disas/riscv.c: rvv: Add disas support for vector instructions, Alistair Francis, 2022/10/14
- [PULL 09/10] hw/intc: sifive_plic: change interrupt priority register to WARL field, Alistair Francis, 2022/10/14
- [PULL 10/10] target/riscv: pmp: Fixup TLB size calculation, Alistair Francis, 2022/10/14
- Re: [PULL 00/10] riscv-to-apply queue, Stefan Hajnoczi, 2022/10/16