Improve 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.

Signed-off-by: Christopher Clark <[email protected]>
---
 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

diff --git a/conf/distro/include/meta-virt-xen.inc 
b/conf/distro/include/meta-virt-xen.inc
index 584cd6e..02a7810 100644
--- a/conf/distro/include/meta-virt-xen.inc
+++ b/conf/distro/include/meta-virt-xen.inc
@@ -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)}
diff --git 
a/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc 
b/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc
new file mode 100644
index 0000000..9c36255
--- /dev/null
+++ b/dynamic-layers/raspberrypi/conf/distro/include/xen-raspberrypi4-64.inc
@@ -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"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6450): 
https://lists.yoctoproject.org/g/meta-virtualization/message/6450
Mute This Topic: https://lists.yoctoproject.org/mt/82330186/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to