On Sun, May 9, 2021, 7:25 PM Alistair Francis <alistai...@gmail.com> wrote:

> On Sat, May 8, 2021 at 6:30 PM Alejandro Hernandez Samaniego
> <alejan...@enedino.org> wrote:
> >
> > Add support for MACHINE=qemuriscv64.
> >
> > $ runqemu nographic
> >
> > BIOS:
> [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.elf]
> > MACHINE: [qemuriscv64]
> >
> > runqemu - INFO - Running
> tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64
> >
> > Hello OpenEmbedded on RISC-V 64!
> >
> > Signed-off-by: Alejandro Enedino Hernandez Samaniego <
> alejan...@enedino.org>
> > ---
> >  .../baremetal-examples/baremetal-helloworld_git.bb   | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> b/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > index ee945c1ff0..3b7b8193a7 100644
> > --- a/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > +++ b/meta-skeleton/recipes-baremetal/baremetal-examples/
> baremetal-helloworld_git.bb
> > @@ -4,7 +4,7 @@ DESCRIPTION = "These are introductory examples to
> showcase the use of QEMU to ru
> >  LICENSE = "MIT"
> >  LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449"
> >
> > -SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3"
> > +SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93"
> >  PV = "0.1+git${SRCPV}"
> >
> >  SRC_URI = "git://
> github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master"
> > @@ -28,12 +28,13 @@ inherit baremetal-image
> >  # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57
> >  # but the examples can also be run on other architectures/machines
> >  # such as vexpress-a15 by overriding the setting on the machine.conf
> > -COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64"
> > +COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64"
> >
> >  BAREMETAL_QEMUARCH ?= ""
> >  BAREMETAL_QEMUARCH_qemuarmv5 = "versatile"
> >  BAREMETAL_QEMUARCH_qemuarm = "arm"
> >  BAREMETAL_QEMUARCH_qemuarm64 = "aarch64"
> > +BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64"
> >
> >  EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1"
> >
> > @@ -49,3 +50,10 @@ FILES_${PN} += " \
> >      ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \
> >      ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \
> >  "
> > +
> > +# RISC-V tunes set the BIOS, redefine since runqemu jumps there
> > +QB_DEFAULT_BIOS_qemuriscv64 = "${IMAGE_LINK_NAME}.elf"
>
>
>
> Hey Alistair,

The issue here is that the runqemu script doesn't have wiring to pass
"-bios none", if a Bios isn't defined the bios paremeter isn't passed at
all and it ends up booting to opensbi, if it makes more sense I can force
"-bios none" using QB_OPT_APPEND and unset QB_DEFAULT_BIOS

Cheers,

Alejandro


> You should also just be able to say `-bios none` and then use the
> -kernel argument as normal.
>
> Alistair
>
> > +
> > +# Use the medium-any code model for the RISC-V 64 bit implementation,
> > +# since medlow can only access addresses below 0x80000000
> > +CFLAGS_append_qemuriscv64 = " -mcmodel=medany"
> > --
> > 2.25.1
> >
> >
> > 
> >
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151566): 
https://lists.openembedded.org/g/openembedded-core/message/151566
Mute This Topic: https://lists.openembedded.org/mt/82674159/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to