diff options
author | Jakub Luzny <jakub@luzny.cz> | 2020-07-19 17:00:08 +0200 |
---|---|---|
committer | Jakub Luzny <jakub@luzny.cz> | 2020-07-24 12:46:57 +0200 |
commit | 3f6d193683449a323a3f1d689540ab697d3d7980 (patch) | |
tree | 093ad36c5bf3f031d469a635d0f2190a57c176e0 /meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp | |
parent | c6889de97c1af6baa7ee8006aa75da170c9bd407 (diff) |
Add layer to support Jailhouse hypervisorjellyfish_9.99.2jellyfish/9.99.29.99.2
Jailhouse is a partitioning hypervisor based on Linux. It is able to run
bare-metal applications or (adapted) operating systems besides Linux.
For this purpose, it configures CPU and device virtualization features
of the hardware platform in a way that none of these domains, called
"cells" here, can interfere with each other in an unacceptable way.
This layer adds the Jailhouse package into AGL and also appends the BSPs
to allow it to run. Currently, Raspberry Pi 4 and QEMU x86-64 targets
are supported.
To enable Jailhouse and include it in the image, the AGL feature
agl-jailhouse must be enabled.
Bug-AGL: SPEC-3507
Signed-off-by: Jakub Luzny <jakub@luzny.cz>
Change-Id: I0fbc0b5d931c85d6f22b0222da8c2b106c4115e1
Diffstat (limited to 'meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp')
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend new file mode 100644 index 00000000..178c982a --- /dev/null +++ b/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -0,0 +1,27 @@ + +do_deploy_append_raspberrypi4() { + # if ARMSTUB is set, it should be set in config.txt by earlier recipes, so replace it + if [ -n "${ARMSTUB}" ]; then + sed -i 's/^armstub=.*/armstub=bl31.bin/' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + + if ! grep '^enable_gic' config.txt; then + sed -i 's/^enable_gic=.*/enable_gic=1/' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + else + echo "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + # otherwise, set it + else + echo "# ARM stub configuration" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "armstub=bl31.bin" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "enable_gic=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + + sed -i -e "s#dtoverlay=mcp2515.*##g" ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "# Enable CAN (Waveshare RS485 CAN HAT)" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25,spimaxfrequency=1000000" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + + +} + + diff --git a/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend new file mode 100644 index 00000000..158eb6e8 --- /dev/null +++ b/meta-agl-jailhouse/dynamic-layers/raspberrypi/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend @@ -0,0 +1,21 @@ +COMPATIBLE_MACHINE = "raspberrypi4" +TFA_BUILD_TARGET = "bl31" +TFA_PLATFORM = "rpi4" + +# Skip installing the binary into /lib/firmware. We only need it on the boot +# partition that is generated from the files in DEPLOYDIR +do_install[noexec] = "1" + +FILES_${PN} = "" + +do_deploy() { + if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then + BUILD_PLAT=${B}/${BUILD_DIR}/debug/ + else + BUILD_PLAT=${B}/${BUILD_DIR}/release/ + fi + + install -d ${DEPLOYDIR}/bcm2835-bootfiles + cp ${BUILD_PLAT}/bl31.bin ${DEPLOYDIR}/bcm2835-bootfiles/bl31.bin +} + |