From 4ba09d6a2b6f100eb68dfc6940b5c1c0b74c18f3 Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Samaniego Date: Mon, 10 May 2021 23:31:34 -0600 Subject: baremetal-helloworld: Enable RISC-V 64 port Add support for MACHINE=qemuriscv64. $ runqemu nographic KERNEL: [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin] MACHINE: [qemuriscv64] FSTYPE: [bin] 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! (From OE-Core rev: 31fde82640bf0d185eab55d2cbaf663c9faae801) Signed-off-by: Alejandro Enedino Hernandez Samaniego Signed-off-by: Richard Purdie --- meta/classes/baremetal-image.bbclass | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'meta/classes/baremetal-image.bbclass') diff --git a/meta/classes/baremetal-image.bbclass b/meta/classes/baremetal-image.bbclass index b0f5e885b5..319b61c7cd 100644 --- a/meta/classes/baremetal-image.bbclass +++ b/meta/classes/baremetal-image.bbclass @@ -73,7 +73,19 @@ QB_DEFAULT_KERNEL ?= "${IMAGE_LINK_NAME}.bin" QB_MEM ?= "-m 256" QB_DEFAULT_FSTYPE ?= "bin" QB_DTB ?= "" -QB_OPT_APPEND = "-nographic" +QB_OPT_APPEND_append = " -nographic" + +# RISC-V tunes set the BIOS, unset, and instruct QEMU to +# ignore the BIOS and boot from -kernel +QB_DEFAULT_BIOS_qemuriscv64 = "" +QB_OPT_APPEND_append_qemuriscv64 = " -bios none" + + +# Use the medium-any code model for the RISC-V 64 bit implementation, +# since medlow can only access addresses below 0x80000000 and RAM +# starts at 0x80000000 on RISC-V 64 +CFLAGS_append_qemuriscv64 = " -mcmodel=medany" + # This next part is necessary to trick the build system into thinking # its building an image recipe so it generates the qemuboot.conf -- cgit v1.2.3-54-g00ecf