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" |
| 3 | LICENSE = "MIT" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39346640a23c701e4f459e05f56f4449" |
| 5 | |
| 6 | SRCREV = "99f4fa4a3b266b42b52af302610b0f4f429ba5e3" |
| 7 | PV = "0.1+git${SRCPV}" |
| 8 | |
| 9 | SRC_URI = "git://github.com/aehs29/baremetal-helloqemu.git;protocol=https;branch=master" |
| 10 | |
| 11 | S = "${WORKDIR}/git/" |
| 12 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 13 | # The following variables should be set to accomodate each application |
| 14 | BAREMETAL_BINNAME ?= "hello_baremetal_${MACHINE}" |
| 15 | IMAGE_LINK_NAME ?= "baremetal-helloworld-image-${MACHINE}" |
| 16 | IMAGE_NAME_SUFFIX ?= "" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 18 | # Baremetal-Image creates the proper wiring, assumes the output is provided in |
| 19 | # binary and ELF format, installed on ${base_libdir}/firmware/ , we want a |
| 20 | # package to be created since we might have some way of updating the baremetal |
| 21 | # firmware from Linux |
| 22 | inherit baremetal-image |
| 23 | |
| 24 | |
| 25 | # These parameters are app specific for this example |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | # This will be translated automatically to the architecture and |
| 27 | # machine that QEMU uses on OE, e.g. -machine virt -cpu cortex-a57 |
| 28 | # but the examples can also be run on other architectures/machines |
| 29 | # such as vexpress-a15 by overriding the setting on the machine.conf |
| 30 | COMPATIBLE_MACHINE = "qemuarmv5|qemuarm|qemuarm64" |
| 31 | |
| 32 | BAREMETAL_QEMUARCH ?= "" |
| 33 | BAREMETAL_QEMUARCH_qemuarmv5 = "versatile" |
| 34 | BAREMETAL_QEMUARCH_qemuarm = "arm" |
| 35 | BAREMETAL_QEMUARCH_qemuarm64 = "aarch64" |
| 36 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 37 | EXTRA_OEMAKE_append = " QEMUARCH=${BAREMETAL_QEMUARCH} V=1" |
| 38 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 39 | |
| 40 | # 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] | 41 | do_install(){ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 42 | install -d ${D}/${base_libdir}/firmware |
| 43 | install -m 755 ${B}build/hello_baremetal_${BAREMETAL_QEMUARCH}.bin ${D}/${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin |
| 44 | 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] | 45 | } |
| 46 | |
| 47 | FILES_${PN} += " \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 48 | ${base_libdir}/firmware/${BAREMETAL_BINNAME}.bin \ |
| 49 | ${base_libdir}/firmware/${BAREMETAL_BINNAME}.elf \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 50 | " |