From: Alistair Francis <alistair23@gmail.com>
To: Sunil V L <sunilvl@ventanamicro.com>
Cc: qemu-arm <qemu-arm@nongnu.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"open list:RISC-V" <qemu-riscv@nongnu.org>,
"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>
Subject: Re: [PATCH V4 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel
Date: Thu, 8 Sep 2022 11:20:23 +0200 [thread overview]
Message-ID: <CAKmqyKNws0a4o-aO9OzDa9DJRF9PCBP_pHWgvJgUPdxWTF=hSg@mail.gmail.com> (raw)
In-Reply-To: <20220906090219.412517-3-sunilvl@ventanamicro.com>
On Tue, Sep 6, 2022 at 11:44 AM Sunil V L <sunilvl@ventanamicro.com> wrote:
>
> 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>
Alistair
> ---
> 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
>
>
next prev parent reply other threads:[~2022-09-08 9:22 UTC|newest]
Thread overview: 16+ 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-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 ` [PATCH V4 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel Sunil V L
2022-09-08 9:20 ` Alistair Francis [this message]
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='CAKmqyKNws0a4o-aO9OzDa9DJRF9PCBP_pHWgvJgUPdxWTF=hSg@mail.gmail.com' \
--to=alistair23@gmail.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=sunilvl@ventanamicro.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).