Xen and Yocto Linux on Raspberry Pi 4
cover Xen and Yocto Linux on Raspberry Pi 4
This series enables running Xen 4.14 and 4.15, with Yocto Linux 5.10, on the Raspberry Pi 4 board.
Sets a new default kernel preference for linux-yocto for Xen on RPi4. Applies some clean up to the config settings and dynamic layer.
Tested with kernel v5.10.25:
SRCREV_machine = "cf5b0320cf4544d3db9ce3ddd6ddb7553a610651" SRCREV_meta="031f6c76e488a3563f35258c72ff1de3e25a512e"
Christopher Clark (8):
xen, rpi4: use the preferred generic multiboot,module compatible
string
xen, rpi4: drop the raspberrypi4-64 defconfig, xen_git.bbappend xen, rpi4, linux-yocto: enable linux-yocto 5.10 for RPi4 xen, rpi4: switch Xen-on-Rpi4 kernel preference to linux-yocto xen, rpi4: fix u-boot script to load binaries from boot partition xen, rpi4: apply workaround to fix crash on boot with Xen 4.14 xen, rpi4: move rpi4-machine+xen-distro cfg into dynamic layer xen, rpi4: add xen-rpi-u-boot-scr recipe for default u-boot script
conf/distro/include/meta-virt-xen.inc | 21 +---
.../distro/include/xen-raspberrypi4-64.inc | 25 ++++
.../rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 17 ---
.../files/boot.cmd.xen.in | 12 +-
.../xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | 34 +++++
.../xen/files/defconfig_raspberrypi4-64 | 117 ------------------
.../recipes-extended/xen/xen_git.bbappend | 11 --
.../linux/linux-yocto-dev.bbappend | 6 +-
.../linux/linux-yocto_5.10.bbappend | 6 +
.../linux/linux-yocto_xen-rpi.inc | 6 +
10 files changed, 87 insertions(+), 168 deletions(-)
create mode 100644 dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc
delete mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
rename dynamic-layers/raspberrypi/recipes-bsp/{rpi-u-boot-scr => xen-rpi-u-boot-scr}/files/boot.cmd.xen.in (80%)
create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb
delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64
delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.10.bbappend
create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_xen-rpi.incSignature · 1 line
2.25.1
PATCH 1/8 xen, rpi4: use the preferred generic multiboot,module compatible string
This string has been preferred since 2014 -- ref: Xen commit a860dfeec and also current documentation: docs/misc/arm/device-tree/booting.txt
--- .../recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in +1 -1
@@ -21,7 +21,7 @@ echo Add a dom0 node to chosen to put Linux boot information in fdt mknode /chosen dom0 echo Set this for the Linux boot command -fdt set /chosen/dom0 compatible "xen,linux-zimage", "xen,multiboot-module" +fdt set /chosen/dom0 compatible "multiboot,module" # Tell Xen where PCI is fdt set /scb/pcie@7d500000 device_type "pci"
Signature · 1 line
2.25.1
PATCH 2/8 xen, rpi4: drop the raspberrypi4-64 defconfig, xen_git.bbappend
In reply to Christopher ClarkSince upstream Xen 4.14 and 4.15 have working default configs for Xen on the Raspberry Pi 4, the defconfig and bbappend in the raspberrypi dynamic layer can now be removed.
--- .../xen/files/defconfig_raspberrypi4-64 | 117 ------------------ .../recipes-extended/xen/xen_git.bbappend | 11 -- 2 files changed, 128 deletions(-) delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 deleted +0 -117
@@ -1,117 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Xen/arm 4.13.0 Configuration -# -CONFIG_64BIT=y -CONFIG_ARM_64=y -CONFIG_ARM=y -CONFIG_ARCH_DEFCONFIG="arch/arm/configs/arm64_defconfig" - -# -# Architecture Features -# -CONFIG_NR_CPUS=128 -# CONFIG_ACPI is not set -CONFIG_GICV3=y -# CONFIG_HAS_ITS is not set -CONFIG_HVM=y -# CONFIG_NEW_VGIC is not set -CONFIG_SBSA_VUART_CONSOLE=y -CONFIG_ARM_SSBD=y -CONFIG_HARDEN_BRANCH_PREDICTOR=y -# CONFIG_TEE is not set - -# -# ARM errata workaround via the alternative framework -# -CONFIG_ARM64_ERRATUM_827319=y -CONFIG_ARM64_ERRATUM_824069=y -CONFIG_ARM64_ERRATUM_819472=y -CONFIG_ARM64_ERRATUM_832075=y -CONFIG_ARM64_ERRATUM_834220=y -CONFIG_ARM64_HARDEN_BRANCH_PREDICTOR=y -CONFIG_ALL_PLAT=y -# CONFIG_QEMU is not set -# CONFIG_RCAR3 is not set -# CONFIG_MPSOC is not set -# CONFIG_NO_PLAT is not set -CONFIG_ALL64_PLAT=y -# CONFIG_ALL32_PLAT is not set -CONFIG_MPSOC_PLATFORM=y - -# -# Common Features -# -CONFIG_GRANT_TABLE=y -CONFIG_HAS_ALTERNATIVE=y -CONFIG_HAS_DEVICE_TREE=y -CONFIG_HAS_FAST_MULTIPLY=y -# CONFIG_MEM_ACCESS is not set -CONFIG_HAS_PDX=y - -# -# Speculative hardening -# -CONFIG_SPECULATIVE_HARDEN_ARRAY=y -# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not set -CONFIG_XSM=y -CONFIG_XSM_FLASK=y -CONFIG_XSM_FLASK_AVC_STATS=y -# CONFIG_XSM_FLASK_POLICY is not set -CONFIG_XSM_SILO=y -# CONFIG_XSM_DUMMY_DEFAULT is not set -# CONFIG_XSM_FLASK_DEFAULT is not set -CONFIG_XSM_SILO_DEFAULT=y -# CONFIG_ARGO is not set - -# -# Schedulers -# -CONFIG_SCHED_CREDIT=y -CONFIG_SCHED_CREDIT2=y -CONFIG_SCHED_RTDS=y -CONFIG_SCHED_ARINC653=y -CONFIG_SCHED_NULL=y -# CONFIG_SCHED_CREDIT_DEFAULT is not set -CONFIG_SCHED_CREDIT2_DEFAULT=y -# CONFIG_SCHED_RTDS_DEFAULT is not set -# CONFIG_SCHED_ARINC653_DEFAULT is not set -# CONFIG_SCHED_NULL_DEFAULT is not set -CONFIG_SCHED_DEFAULT="credit2" -# CONFIG_LIVEPATCH is not set -# CONFIG_ENFORCE_UNIQUE_SYMBOLS is not set -# CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set -CONFIG_CMDLINE="" -CONFIG_DOM0_MEM="" -CONFIG_TRACEBUFFER=y - -# -# Device Drivers -# -CONFIG_HAS_NS16550=y -CONFIG_HAS_CADENCE_UART=y -CONFIG_HAS_MVEBU=y -CONFIG_HAS_MESON=y -CONFIG_HAS_PL011=y -CONFIG_HAS_SCIF=y -CONFIG_HAS_PASSTHROUGH=y -CONFIG_ARM_SMMU=y -# CONFIG_IPMMU_VMSA is not set -CONFIG_IOMMU_FORCE_PT_SHARE=y -CONFIG_DEFCONFIG_LIST="arch/arm/configs/arm64_defconfig" - -# -# Debugging Options -# -CONFIG_DEBUG=y -CONFIG_DEBUG_INFO=y -CONFIG_FRAME_POINTER=y -# CONFIG_COVERAGE is not set -# CONFIG_DEBUG_LOCK_PROFILE is not set -CONFIG_DEBUG_LOCKS=y -# CONFIG_PERF_COUNTERS is not set -CONFIG_VERBOSE_DEBUG=y -# CONFIG_DEVICE_TREE_DEBUG is not set -CONFIG_SCRUB_DEBUG=y -# CONFIG_DEBUG_TRACE is not set -CONFIG_XMEM_POOL_POISON=y
dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend deleted +0 -11
@@ -1,11 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -SRC_URI_append_raspberrypi4-64 = " \ - file://defconfig_raspberrypi4-64 \ - " - -do_post_patch_append_raspberrypi4-64() { - if [ ! -e "${WORKDIR}/defconfig" ] ; then - cp "${WORKDIR}/defconfig_raspberrypi4-64" "${WORKDIR}/defconfig" - fi -}
Signature · 1 line
2.25.1
PATCH 3/8 xen, rpi4, linux-yocto: enable linux-yocto 5.10 for RPi4
In reply to Christopher ClarkAdded to the raspberrypi dynamic layer for use with Xen as preparation for switching to it as the default preference.
--- .../recipes-kernel/linux/linux-yocto-dev.bbappend | 6 ++---- .../recipes-kernel/linux/linux-yocto_5.10.bbappend | 6 ++++++ .../recipes-kernel/linux/linux-yocto_xen-rpi.inc | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.10.bbappend create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_xen-rpi.inc
dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto-dev.bbappend +2 -4
@@ -1,10 +1,8 @@ # For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt # with Xen-on-ARM-specific command line options -DEFAULT_CMDLINE := "${CMDLINE}" -XEN_LINUX_CMDLINE ?= "console=hvc0 clk_ignore_unused earlycon=xenboot debug root=/dev/mmcblk0p2 rootwait" -CMDLINE = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_LINUX_CMDLINE}', '${DEFAULT_CMDLINE}', d)}" - KBRANCH_raspberrypi4-64 ?= "standard/bcm-2xxx-rpi" KMACHINE_raspberrypi4-64 ?= "bcm-2xxx-rpi4" COMPATIBLE_MACHINE_raspberrypi4-64 = "(raspberrypi4-64)" + +require linux-yocto_xen-rpi.inc
dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.10.bbappend new file +6 -0
@@ -0,0 +1,6 @@ +# Enable use of the linux-yocto 5.10 kernel for the Raspberry Pi 4 +KBRANCH_raspberrypi4-64 ?= "v5.10/standard/bcm-2xxx-rpi" +KMACHINE_raspberrypi4-64 ?= "bcm-2xxx-rpi4" +COMPATIBLE_MACHINE_raspberrypi4-64 = "(raspberrypi4-64)" + +require linux-yocto_xen-rpi.inc
dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_xen-rpi.inc new file +6 -0
@@ -0,0 +1,6 @@ +# For a Xen-enabled distro on the Raspberry Pi, override the contents of cmdline.txt +# with Xen-on-ARM-specific command line options + +DEFAULT_CMDLINE := "${CMDLINE}" +XEN_LINUX_CMDLINE ?= "console=hvc0 clk_ignore_unused earlycon=xenboot debug root=/dev/mmcblk0p2 rootwait" +CMDLINE = "${@bb.utils.contains('DISTRO_FEATURES', 'xen', '${XEN_LINUX_CMDLINE}', '${DEFAULT_CMDLINE}', d)}"
Signature · 1 line
2.25.1
PATCH 4/8 xen, rpi4: switch Xen-on-Rpi4 kernel preference to linux-yocto
In reply to Christopher ClarkThe 5.10 version of the Linux Yocto kernel supports running Xen on the Raspberry Pi 4, so the previous preference for linux-yocto-dev can be replaced.
Use the ?= operator to set the kernel preference now since meta-raspberrypi commit e0b4b8c5d introduced use of the weak default for kernel preference in that layer to allow this here.
KERNEL_DEVICETREE needs to be set to match the build outputs of the selected kernel, in this case: "broadcom/bcm2711-rpi-4-b.dtb"
Tested with kernel version:
SRCREV_machine = "cf5b0320cf4544d3db9ce3ddd6ddb7553a610651" SRCREV_meta="031f6c76e488a3563f35258c72ff1de3e25a512e"
--- conf/distro/include/meta-virt-xen.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
conf/distro/include/meta-virt-xen.inc +2 -1
@@ -20,4 +20,5 @@ RPI_EXTRA_CONFIG_append_raspberrypi4-64 = "\nenable_gic=1" # Increase boot partition for space for kernel and Xen BOOT_SPACE_raspberrypi4-64 = "61440" # Override the meta-raspberrypi default kernel preference -PREFERRED_PROVIDER_virtual/kernel_raspberrypi4-64 = "linux-yocto-dev" +PREFERRED_PROVIDER_virtual/kernel_raspberrypi4-64 ?= "linux-yocto" +KERNEL_DEVICETREE_raspberrypi4-64 ?= "broadcom/bcm2711-rpi-4-b.dtb"
Signature · 1 line
2.25.1
PATCH 5/8 xen, rpi4: fix u-boot script to load binaries from boot partition
In reply to Christopher Clarkfatload needs to read from mmc 1:1 to find the Xen hypervisor and Linux kernel binaries with the current Yocto Linux 5.10 kernel.
Add boot messages to to the u-boot script to indicate the size of files loaded for easier confirmation of load success.
--- .../recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in +5 -2
@@ -30,10 +30,13 @@ echo Delay to allow the MMC card to be ready sleep 1 echo Load Xen into memory -fatload mmc 0:1 ${xen_loadaddr} xen +fatload mmc 1:1 ${xen_loadaddr} xen +echo Xen loaded, size: 0x$filesize + echo Load Linux kernel into memory -fatload mmc 0:1 ${kernel_loadaddr} Image +fatload mmc 1:1 ${kernel_loadaddr} Image setenv kernel_size 0x$filesize +echo Linux loaded, size: 0x$filesize echo Set the address and size for the Linux kernel so Xen can pick it up fdt set /chosen/dom0 reg <${kernel_loadaddr} ${kernel_size}>
Signature · 1 line
2.25.1
PATCH 6/8 xen, rpi4: apply workaround to fix crash on boot with Xen 4.14
In reply to Christopher ClarkApply update to the device tree to allow Xen 4.14 to boot.
--- .../recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in | 3 +++ 1 file changed, 3 insertions(+)
dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in +3 -0
@@ -25,6 +25,9 @@ fdt set /chosen/dom0 compatible "multiboot,module" # Tell Xen where PCI is fdt set /scb/pcie@7d500000 device_type "pci" +# Workaround to fix: +# "Unable to retrieve address 0 for /scb/pcie@7d500000/pci@1,0/usb@1,0" +fdt rm /scb/pcie@7d500000/pci@1,0/usb@1,0 echo Delay to allow the MMC card to be ready sleep 1
Signature · 1 line
2.25.1
PATCH 7/8 xen, rpi4: move rpi4-machine+xen-distro cfg into dynamic layer
In reply to Christopher ClarkImprove meta-virt-xen.inc by moving all the Raspberry Pi 4 config settings to a new xen-raspberrypi4-64.inc file in the raspberrypi dynamic layer.
The new .inc file is included only for the raspberrypi4-64 MACHINE, so the config settings no longer need to be applied using overrides.
--- conf/distro/include/meta-virt-xen.inc | 22 ++++-------------- .../distro/include/xen-raspberrypi4-64.inc | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc
conf/distro/include/meta-virt-xen.inc +5 -17
@@ -5,20 +5,8 @@ PACKAGECONFIG_append_pn-qemu = " xen" PACKAGECONFIG_append_pn-qemu_arm = " fdt" PACKAGECONFIG_append_pn-qemu_aarch64 = " fdt" -# Raspberry Pi settings -# Xen uses u-boot for configuration and uses the uart -RPI_USE_U_BOOT_raspberrypi4-64 = "1" -ENABLE_UART_raspberrypi4-64 = "1" -# Build the bootable SD card image -IMAGE_CLASSES_append_raspberrypi4-64 = " sdcard_image-rpi" -IMAGE_FSTYPES_append_raspberrypi4-64 = " rpi-sdimg" -# Add Xen to the bootable SD card image -RPI_SDIMG_EXTRA_DEPENDS_append_raspberrypi4-64 = " xen:do_deploy" -DEPLOYPAYLOAD_raspberrypi4-64 = "xen-${MACHINE}:xen" -# We need the GIC enabled for Xen to work -RPI_EXTRA_CONFIG_append_raspberrypi4-64 = "\nenable_gic=1" -# Increase boot partition for space for kernel and Xen -BOOT_SPACE_raspberrypi4-64 = "61440" -# Override the meta-raspberrypi default kernel preference -PREFERRED_PROVIDER_virtual/kernel_raspberrypi4-64 ?= "linux-yocto" -KERNEL_DEVICETREE_raspberrypi4-64 ?= "broadcom/bcm2711-rpi-4-b.dtb" +# Xen on Raspberry Pi 4 64-bit support +XEN_RPI4_64_CONFIG_PATH ??= \ + 'dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc' +include ${@bb.utils.contains('MACHINE', 'raspberrypi4-64', \ + '${XEN_RPI4_64_CONFIG_PATH}', '', d)}
dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc new file +23 -0
@@ -0,0 +1,23 @@ +# Xen on Raspberry Pi 4 settings + +# Xen uses u-boot for configuration and uses the uart +RPI_USE_U_BOOT = "1" +ENABLE_UART = "1" + +# Build the bootable SD card image +IMAGE_CLASSES_append = " sdcard_image-rpi" +IMAGE_FSTYPES_append = " rpi-sdimg" + +# Add Xen to the bootable SD card image +RPI_SDIMG_EXTRA_DEPENDS_append = " xen:do_deploy" +DEPLOYPAYLOAD = "xen-${MACHINE}:xen" + +# We need the GIC enabled for Xen to work +RPI_EXTRA_CONFIG_append = "\nenable_gic=1" + +# Increase boot partition for space for kernel and Xen +BOOT_SPACE = "61440" + +# Override the meta-raspberrypi default kernel preference +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" +KERNEL_DEVICETREE ?= "broadcom/bcm2711-rpi-4-b.dtb"
Signature · 1 line
2.25.1
PATCH 8/8 xen, rpi4: add xen-rpi-u-boot-scr recipe for default u-boot script
In reply to Christopher ClarkAdd a new xen-rpi-u-boot-scr recipe to PROVIDE u-boot-default-script instead of using a bbappend to rpi-u-boot-scr.
This allows the new recipe to be selected by indicating it as PREFERRED_PROVIDER of u-boot-default-script, and then do that in the Xen on Raspberry Pi 4 config file, xen-raspberrypi4-64.inc.
---
.../distro/include/xen-raspberrypi4-64.inc | 2 ++
.../rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 17 ----------
.../files/boot.cmd.xen.in | 0
.../xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | 34 +++++++++++++++++++
4 files changed, 36 insertions(+), 17 deletions(-)
delete mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend
rename dynamic-layers/raspberrypi/recipes-bsp/{rpi-u-boot-scr => xen-rpi-u-boot-scr}/files/boot.cmd.xen.in (100%)
create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bbdynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc +2 -0
@@ -21,3 +21,5 @@ BOOT_SPACE = "61440" # Override the meta-raspberrypi default kernel preference PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto" KERNEL_DEVICETREE ?= "broadcom/bcm2711-rpi-4-b.dtb" + +PREFERRED_PROVIDER_u-boot-default-script ?= "xen-rpi-u-boot-scr"
dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend deleted +0 -17
@@ -1,17 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/files:" - -RPI_DOM0_MEM ??= "256M" -RPI_DEBUG_XEN_ARGS ??= "sync_console bootscrub=0" - -SRC_URI += "file://boot.cmd.xen.in" - -# If the distro is Xen enabled, override the default boot.cmd.in with the -# alternative boot.cmd.xen.in from this layer, with variables subsitution here -do_compile_append() { - if [ "${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'yes', 'no', d)}" = "yes" ]; then - sed -e 's/@@RPI_DOM0_MEM@@/${RPI_DOM0_MEM}/' \ - -e 's/@@RPI_DEBUG_XEN_ARGS@@/${RPI_DEBUG_XEN_ARGS}/' \ - "${WORKDIR}/boot.cmd.xen.in" > "${WORKDIR}/boot.cmd" - mkimage -A arm -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr - fi -}
dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/files/boot.cmd.xen.in renamed from dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/files/boot.cmd.xen.in +0 -0
dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb new file +34 -0
@@ -0,0 +1,34 @@ +SUMMARY = "U-boot boot script for Xen on Raspberry Pi 4" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +COMPATIBLE_MACHINE = "^raspberrypi4-64$" + +DEPENDS = "u-boot-mkimage-native" + +INHIBIT_DEFAULT_DEPS = "1" + +SRC_URI = "file://boot.cmd.xen.in" + +RPI_DOM0_MEM ??= "256M" +RPI_DEBUG_XEN_ARGS ??= "sync_console bootscrub=0" + +do_compile() { + sed -e 's/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ + -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \ + -e 's/@@RPI_DOM0_MEM@@/${RPI_DOM0_MEM}/' \ + -e 's/@@RPI_DEBUG_XEN_ARGS@@/${RPI_DEBUG_XEN_ARGS}/' \ + "${WORKDIR}/boot.cmd.xen.in" > "${WORKDIR}/boot.cmd" + + mkimage -A ${UBOOT_ARCH} -T script -C none -n "Boot script" -d "${WORKDIR}/boot.cmd" boot.scr +} + +inherit kernel-arch deploy nopackages + +do_deploy() { + install -d ${DEPLOYDIR} + install -m 0644 boot.scr ${DEPLOYDIR} +} + +addtask do_deploy after do_compile before do_build + +PROVIDES += "u-boot-default-script"
Signature · 1 line
2.25.1
In message: [meta-virtualization][PATCH 0/8] Xen and Yocto Linux on Raspberry Pi 4
Quoted 5 lines · on 24/04/2021 Christopher Clark wrote:
This series enables running Xen 4.14 and 4.15, with Yocto Linux 5.10, on the Raspberry Pi 4 board.
Sets a new default kernel preference for linux-yocto for Xen on RPi4. Applies some clean up to the config settings and dynamic layer.
Everything looks good to me. I'll have to do some similar cleanups to the xilinx layers as well .. we have a RunX talk accepted for the upcoming Xen conf, so that's a good reason for me to do that part.
I'll merge these on Wednesday if I don't hear any objections.
Bruce
Quoted 39 lines
Tested with kernel v5.10.25:
SRCREV_machine= "cf5b0320cf4544d3db9ce3ddd6ddb7553a610651" SRCREV_meta="031f6c76e488a3563f35258c72ff1de3e25a512e"Christopher Clark (8):
xen, rpi4: use the preferred generic multiboot,module compatible
string
xen, rpi4: drop the raspberrypi4-64 defconfig, xen_git.bbappend xen, rpi4, linux-yocto: enable linux-yocto 5.10 for RPi4 xen, rpi4: switch Xen-on-Rpi4 kernel preference to linux-yocto xen, rpi4: fix u-boot script to load binaries from boot partition xen, rpi4: apply workaround to fix crash on boot with Xen 4.14 xen, rpi4: move rpi4-machine+xen-distro cfg into dynamic layer xen, rpi4: add xen-rpi-u-boot-scr recipe for default u-boot scriptconf/distro/include/meta-virt-xen.inc | 21 +--- .../distro/include/xen-raspberrypi4-64.inc | 25 ++++ .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 17 --- .../files/boot.cmd.xen.in | 12 +- .../xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | 34 +++++ .../xen/files/defconfig_raspberrypi4-64 | 117 ------------------ .../recipes-extended/xen/xen_git.bbappend | 11 -- .../linux/linux-yocto-dev.bbappend | 6 +- .../linux/linux-yocto_5.10.bbappend | 6 + .../linux/linux-yocto_xen-rpi.inc | 6 + 10 files changed, 87 insertions(+), 168 deletions(-) create mode 100644 dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc delete mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend rename dynamic-layers/raspberrypi/recipes-bsp/{rpi-u-boot-scr => xen-rpi-u-boot-scr}/files/boot.cmd.xen.in (80%) create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.10.bbappend create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_xen-rpi.incSignature · 1 line
2.25.1
Bertrand Marquis
Reviewed-byHi,
Quoted 11 lines · Bruce Ashfield via lists.yoctoproject.org
In message: [meta-virtualization][PATCH 0/8] Xen and Yocto Linux on Raspberry Pi 4
Quoted 5 lines · on 24/04/2021 Christopher Clark wrote:
This series enables running Xen 4.14 and 4.15, with Yocto Linux 5.10, on the Raspberry Pi 4 board.
Sets a new default kernel preference for linux-yocto for Xen on RPi4. Applies some clean up to the config settings and dynamic layer.
Quoted 6 lines
Everything looks good to me. I'll have to do some similar cleanups to the xilinx layers as well .. we have a RunX talk accepted for the upcoming Xen conf, so that's a good reason for me to do that part.
I'll merge these on Wednesday if I don't hear any objections.
The serie looks good to me so you can add on the whole serie my:
I will not have the opportunity to actually test it this week though.
Regards
Bertrand
Quoted 44 lines
Bruce
Quoted 39 lines
Tested with kernel v5.10.25:
SRCREV_machine= "cf5b0320cf4544d3db9ce3ddd6ddb7553a610651" SRCREV_meta="031f6c76e488a3563f35258c72ff1de3e25a512e"Christopher Clark (8):
xen, rpi4: use the preferred generic multiboot,module compatible
string
xen, rpi4: drop the raspberrypi4-64 defconfig, xen_git.bbappend xen, rpi4, linux-yocto: enable linux-yocto 5.10 for RPi4 xen, rpi4: switch Xen-on-Rpi4 kernel preference to linux-yocto xen, rpi4: fix u-boot script to load binaries from boot partition xen, rpi4: apply workaround to fix crash on boot with Xen 4.14 xen, rpi4: move rpi4-machine+xen-distro cfg into dynamic layer xen, rpi4: add xen-rpi-u-boot-scr recipe for default u-boot scriptconf/distro/include/meta-virt-xen.inc | 21 +--- .../distro/include/xen-raspberrypi4-64.inc | 25 ++++ .../rpi-u-boot-scr/rpi-u-boot-scr.bbappend | 17 --- .../files/boot.cmd.xen.in | 12 +- .../xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb | 34 +++++ .../xen/files/defconfig_raspberrypi4-64 | 117 ------------------ .../recipes-extended/xen/xen_git.bbappend | 11 -- .../linux/linux-yocto-dev.bbappend | 6 +- .../linux/linux-yocto_5.10.bbappend | 6 + .../linux/linux-yocto_xen-rpi.inc | 6 + 10 files changed, 87 insertions(+), 168 deletions(-)create mode 100644 dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc delete mode 100644 dynamic-layers/raspberrypi/recipes-bsp/rpi-u-boot-scr/rpi-u-boot-scr.bbappend rename dynamic-layers/raspberrypi/recipes-bsp/{rpi-u-boot-scr => xen-rpi-u-boot-scr}/files/boot.cmd.xen.in (80%) create mode 100644 dynamic-layers/raspberrypi/recipes-bsp/xen-rpi-u-boot-scr/xen-rpi-u-boot-scr.bb delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/files/defconfig_raspberrypi4-64 delete mode 100644 dynamic-layers/raspberrypi/recipes-extended/xen/xen_git.bbappend
create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_5.10.bbappend create mode 100644 dynamic-layers/raspberrypi/recipes-kernel/linux/linux-yocto_xen-rpi.inc--
2.25.1
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.