diff mbox series

[2/2] riscv: sifive_u: Update BIOS_FILENAME for 32-bit

Message ID 1582209758-2996-2-git-send-email-bmeng.cn@gmail.com
State Superseded
Headers show
Series [1/2] riscv: roms: Add 32-bit OpenSBI firmware image for sifive_u | expand

Commit Message

Bin Meng Feb. 20, 2020, 2:42 p.m. UTC
Update BIOS_FILENAME to consider 32-bit bios image file name.

Tested booting Linux v5.5 32-bit image (built from rv32_defconfig
plus CONFIG_SOC_SIFIVE) with the default 32-bit bios image.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 hw/riscv/sifive_u.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Alistair Francis Feb. 21, 2020, 7:51 p.m. UTC | #1
On Thu, Feb 20, 2020 at 6:43 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Update BIOS_FILENAME to consider 32-bit bios image file name.
>
> Tested booting Linux v5.5 32-bit image (built from rv32_defconfig
> plus CONFIG_SOC_SIFIVE) with the default 32-bit bios image.

Do we really want to support a 32-bit sifive_u machine?

Alistair

>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  hw/riscv/sifive_u.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index ca561d3..371133e 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -57,7 +57,11 @@
>
>  #include <libfdt.h>
>
> -#define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
> +#if defined(TARGET_RISCV32)
> +# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin"
> +#else
> +# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
> +#endif
>
>  static const struct MemmapEntry {
>      hwaddr base;
> --
> 2.7.4
>
>
Bin Meng Feb. 22, 2020, 2:52 a.m. UTC | #2
On Sat, Feb 22, 2020 at 3:51 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Thu, Feb 20, 2020 at 6:43 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> >
> > Update BIOS_FILENAME to consider 32-bit bios image file name.
> >
> > Tested booting Linux v5.5 32-bit image (built from rv32_defconfig
> > plus CONFIG_SOC_SIFIVE) with the default 32-bit bios image.
>
> Do we really want to support a 32-bit sifive_u machine?
>

QEMU is an emulator, why not? With 32-bit sifive_u machine, we can
have 32-bit test coverage for SiFive specific drivers that cannot be
done with the 'virt' machine.

Regards,
Bin
Alistair Francis Feb. 22, 2020, 3:55 a.m. UTC | #3
On Fri, Feb 21, 2020 at 6:53 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Sat, Feb 22, 2020 at 3:51 AM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Thu, Feb 20, 2020 at 6:43 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > Update BIOS_FILENAME to consider 32-bit bios image file name.
> > >
> > > Tested booting Linux v5.5 32-bit image (built from rv32_defconfig
> > > plus CONFIG_SOC_SIFIVE) with the default 32-bit bios image.
> >
> > Do we really want to support a 32-bit sifive_u machine?
> >
>
> QEMU is an emulator, why not? With 32-bit sifive_u machine, we can
> have 32-bit test coverage for SiFive specific drivers that cannot be
> done with the 'virt' machine.

That is a good point.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

>
> Regards,
> Bin
diff mbox series

Patch

diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index ca561d3..371133e 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -57,7 +57,11 @@ 
 
 #include <libfdt.h>
 
-#define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
+#if defined(TARGET_RISCV32)
+# define BIOS_FILENAME "opensbi-riscv32-sifive_u-fw_jump.bin"
+#else
+# define BIOS_FILENAME "opensbi-riscv64-sifive_u-fw_jump.bin"
+#endif
 
 static const struct MemmapEntry {
     hwaddr base;