All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sunil V L <sunilvl@ventanamicro.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Xiaojuan Yang" <yangxiaojuan@loongson.cn>,
	"Song Gao" <gaosong@loongson.cn>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Andrew Jones" <ajones@ventanamicro.com>,
	"Anup Patel" <apatel@ventanamicro.com>,
	"Atish Kumar Patra" <atishp@rivosinc.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Sunil V L" <sunilvl@ventanamicro.com>
Subject: [PATCH V4 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel
Date: Tue,  6 Sep 2022 14:32:18 +0530	[thread overview]
Message-ID: <20220906090219.412517-3-sunilvl@ventanamicro.com> (raw)
In-Reply-To: <20220906090219.412517-1-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>
---
 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 ff8c0df5cd..b6bbf03f61 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -1251,6 +1251,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);
@@ -1284,13 +1291,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.25.1



  parent reply	other threads:[~2022-09-06  9:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  9:02 [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash Sunil V L
2022-09-06  9:02 ` [PATCH V4 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location Sunil V L
2022-09-06 13:32   ` [PATCH V4 1/3] hw/arm,loongarch: " Philippe Mathieu-Daudé via
2022-09-06 13:32     ` Philippe Mathieu-Daudé
2022-09-08  9:17   ` [PATCH V4 1/3] hw/arm, loongarch: " Alistair Francis
2022-09-15 11:59     ` Sunil V L
2022-09-15 12:56       ` gaosong
2022-09-22 11:28         ` Sunil V L
2022-09-06  9:02 ` Sunil V L [this message]
2022-09-08  9:20   ` [PATCH V4 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel Alistair Francis
2022-09-06  9:02 ` [PATCH V4 3/3] hw/riscv: virt: Enable booting S-mode firmware from pflash Sunil V L
2022-09-06 10:41 ` [PATCH V4 0/3] " Gerd Hoffmann
2022-09-06 12:32   ` Sunil V L
2022-09-07  7:10     ` Gerd Hoffmann
2022-09-08 10:25       ` [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflashy Sunil V L
2022-09-08 10:44         ` [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash Sunil V L
2022-09-08 11:19         ` [PATCH V4 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflashy Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220906090219.412517-3-sunilvl@ventanamicro.com \
    --to=sunilvl@ventanamicro.com \
    --cc=ajones@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=apatel@ventanamicro.com \
    --cc=atishp@rivosinc.com \
    --cc=bin.meng@windriver.com \
    --cc=f4bug@amsat.org \
    --cc=gaosong@loongson.cn \
    --cc=kraxel@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=yangxiaojuan@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.