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 <[email protected]>
---
 .../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"
+
+# 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 (#151474): 
https://lists.openembedded.org/g/openembedded-core/message/151474
Mute This Topic: https://lists.openembedded.org/mt/82674159/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to