Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Baremetal examples to work with the several QEMU architectures supported on OpenEmbedded" |
| 2 | HOMEPAGE = "https://github.com/aehs29/baremetal-helloqemu" |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 3 | DESCRIPTION = "These are introductory examples to showcase the use of QEMU to run baremetal applications." |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" |
| 6 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame^] | 7 | SRCREV = "0bf9ea216e6f76be50726a3a74e527b7bbb0ad93" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | PV = "0.1+git${SRCPV}" |
| 9 | |
| 10 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" |
| 11 | |
Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 12 | S = "${WORKDIR}/git" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 14 | # The following variables should be set to accomodate each application |
| 15 | BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}" |
| 16 | IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}" |
| 17 | IMAGE_NAME_SUFFIX ?= "" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 19 | # Baremetal-Image creates the proper wiring, assumes the output is provided in |
| 20 | # binary and ELF format, installed on ${base_libdir}/firmware/ , we want a |
| 21 | # package to be created since we might have some way of updating the baremetal |
| 22 | # firmware from Linux |
| 23 | inherit baremetal-image |
| 24 | |
| 25 | |
| 26 | # These parameters are app specific for this example |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | # This will be translated automatically to the architecture and |
| 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 |
| 30 | # such as vexpress-a15 by overriding the setting on the machine.conf |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame^] | 31 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64|qemuriscv64" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | |
| 33 | BAREMETAL_QEMUARCH ?= "" |
| 34 | BAREMETAL_QEMUARCH_qemuarmv5 = "versatile" |
| 35 | BAREMETAL_QEMUARCH_qemuarm = "arm" |
| 36 | BAREMETAL_QEMUARCH_qemuarm64 = "aarch64" |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame^] | 37 | BAREMETAL_QEMUARCH_qemuriscv64 = "riscv64" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 39 | EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" |
| 40 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 41 | |
| 42 | # Install binaries on the proper location for baremetal-image to fetch and deploy |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 43 | do_install(){ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 44 | install -d ${D}/${base_libdir}/firmware |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame] | 45 | install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.bin ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin |
| 46 | install -m 755 ${B}/build/hello_baremetal_${BAREMETAL_QEMUARCH}.elf ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | FILES_${PN} += " \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 50 | ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \ |
| 51 | ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | " |