diff options
| author | Alejandro Hernandez Samaniego <alejandro@enedino.org> | 2021-05-10 23:31:34 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-12 23:06:04 +0100 |
| commit | 4ba09d6a2b6f100eb68dfc6940b5c1c0b74c18f3 (patch) | |
| tree | 6e82aeeae6f8da12bd02af6e7675176af1d94afd | |
| parent | d875ba64e9c66543bc47c2518f27651b67be8a7e (diff) | |
| download | poky-4ba09d6a2b6f100eb68dfc6940b5c1c0b74c18f3.tar.gz | |
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 <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta-skeleton/recipes-baremetal/baremetal-examples/baremetal-helloworld_git.bb | 5 | ||||
| -rw-r--r-- | meta/classes/baremetal-image.bbclass | 14 |
2 files changed, 16 insertions, 3 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..19ef16988f 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 | |||
| 4 | LICENSE = "MIT" | 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" | 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" |
| 6 | 6 | ||
| 7 | SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3" | 7 | SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93" |
| 8 | PV = "0.1+git${SRCPV}" | 8 | PV = "0.1+git${SRCPV}" |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" | 10 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" |
| @@ -28,12 +28,13 @@ inherit baremetal-image | |||
| 28 | # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57 | 28 | # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57 |
| 29 | # but the examples can also be run on other architectures/machines | 29 | # but the examples can also be run on other architectures/machines |
| 30 | # such as vexpress-a15 by overriding the setting on the machine.conf | 30 | # such as vexpress-a15 by overriding the setting on the machine.conf |
| 31 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64" | 31 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64" |
| 32 | 32 | ||
| 33 | BAREMETAL_QEMUARCH ?= "" | 33 | BAREMETAL_QEMUARCH ?= "" |
| 34 | BAREMETAL_QEMUARCH_qemuarmv5 = "versatile" | 34 | BAREMETAL_QEMUARCH_qemuarmv5 = "versatile" |
| 35 | BAREMETAL_QEMUARCH_qemuarm = "arm" | 35 | BAREMETAL_QEMUARCH_qemuarm = "arm" |
| 36 | BAREMETAL_QEMUARCH_qemuarm64 = "aarch64" | 36 | BAREMETAL_QEMUARCH_qemuarm64 = "aarch64" |
| 37 | BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64" | ||
| 37 | 38 | ||
| 38 | EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" | 39 | EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" |
| 39 | 40 | ||
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" | |||
| 73 | QB_MEM ?= "-m 256" | 73 | QB_MEM ?= "-m 256" |
| 74 | QB_DEFAULT_FSTYPE ?= "bin" | 74 | QB_DEFAULT_FSTYPE ?= "bin" |
| 75 | QB_DTB ?= "" | 75 | QB_DTB ?= "" |
| 76 | QB_OPT_APPEND = "-nographic" | 76 | QB_OPT_APPEND_append = " -nographic" |
| 77 | |||
| 78 | # RISC-V tunes set the BIOS, unset, and instruct QEMU to | ||
| 79 | # ignore the BIOS and boot from -kernel | ||
| 80 | QB_DEFAULT_BIOS_qemuriscv64 = "" | ||
| 81 | QB_OPT_APPEND_append_qemuriscv64 = " -bios none" | ||
| 82 | |||
| 83 | |||
| 84 | # Use the medium-any code model for the RISC-V 64 bit implementation, | ||
| 85 | # since medlow can only access addresses below 0x80000000 and RAM | ||
| 86 | # starts at 0x80000000 on RISC-V 64 | ||
| 87 | CFLAGS_append_qemuriscv64 = " -mcmodel=medany" | ||
| 88 | |||
| 77 | 89 | ||
| 78 | # This next part is necessary to trick the build system into thinking | 90 | # This next part is necessary to trick the build system into thinking |
| 79 | # its building an image recipe so it generates the qemuboot.conf | 91 | # its building an image recipe so it generates the qemuboot.conf |
