meta-agl-bsp: clean up Raspberry Pi Xen support 75/26075/2
authorScott Murray <scott.murray@konsulko.com>
Mon, 8 Mar 2021 17:33:48 +0000 (12:33 -0500)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 9 Mar 2021 11:41:23 +0000 (11:41 +0000)
Changes:
- Rename bbappend for Xen support to work with 5.4 kernel.
- Drop one of the Xen support patches that no longer applies, as it
  seems no longer required due to upstream changes.
- Move Xen kernel configuration fragment use to non-versioned kernel
  bbappend to simplify future upgrades.
- Move ENABLE_UART definition to machine template inc files instead
  of duplicating it in multiple bbappends.  This is more in line with
  how upstream indicates it be used.

Note that these changes have been compile tested with the agl-virt-xen
feature, but the resulting image has not yet been tested with Xen.
This is still an improvement, as agl-virt-xen would have silently not
affected kernel configuration previously.  As well, some of the
reshuffling done here will simplify the kernel upgrade in the next
branch.

Bug-AGL: SPEC-3841

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I022cccef00fcd0a82ceef89d4aab1894004543a3
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26075
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-agl-bsp/conf/include/agl_raspberrypi3.inc
meta-agl-bsp/conf/include/agl_raspberrypi4.inc
meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Fix-PCIe-in-dom0-for-RPi4.patch [deleted file]
meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend [deleted file]
meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend [new file with mode: 0644]

index a4989b7..8b3d80d 100644 (file)
@@ -9,6 +9,9 @@ OSTREE_KERNEL_ARGS_sota_append = " cma=256M"
 # use u-boot always
 RPI_USE_U_BOOT = "1"
 
+# Use UART for serial console
+ENABLE_UART ?= "1"
+
 #RPI_KERNEL_DEVICETREE_remove_raspberrypi3 = "bcm2708-rpi-0-w.dtb"
 #RPI_KERNEL_DEVICETREE_OVERLAYS_remove_raspberrypi3 = "overlays/lirc-rpi.dtbo"
 #RPI_KERNEL_DEVICETREE_OVERLAYS_append_raspberrypi3 = " overlays/vc4-fkms-v3d.dtbo"
index c44d44f..e590cb2 100644 (file)
@@ -7,6 +7,9 @@ OSTREE_KERNEL_ARGS_sota_append = " cma=256M"
 # use u-boot always
 RPI_USE_U_BOOT = "1"
 
+# Use UART for serial console
+ENABLE_UART ?= "1"
+
 # For libomxil
 #LICENSE_FLAGS_WHITELIST = "commercial"
 
index bbab3df..dc9df4a 100644 (file)
@@ -48,6 +48,3 @@ do_deploy_append_raspberrypi4() {
 do_deploy_append_sota() {
     echo "device_tree_address=0x0c800000" >> ${DEPLOYDIR}/bootfiles/config.txt
 }
-
-ENABLE_UART_raspberrypi3 = "1"
-ENABLE_UART_raspberrypi4 = "1"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Fix-PCIe-in-dom0-for-RPi4.patch b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Fix-PCIe-in-dom0-for-RPi4.patch
deleted file mode 100644 (file)
index 835f36d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 77765c2a47ce43911b8fe7b09f037c9bc13008ca Mon Sep 17 00:00:00 2001
-From: Jeff Kubascik <jeff.kubascik@dornerworks.com>
-Date: Tue, 30 Jul 2019 08:49:56 -0400
-Subject: [PATCH 3/4] Fix PCIe in dom0 for RPi4
-
-There is an issue where the Broadcom PCIe driver and Xen swiotlb layer
-invoke each other's dma alloc function recursively until the stack blows
-up. The cause appears to be due to arch_setup_dma_ops being called
-more than once for the device, possibly through of_dma_configure, and
-screwing up the dma_ops pointers. This patch adds a check to make sure
-that the xen_dma_ops are applied only once for a device.
----
- arch/arm64/mm/dma-mapping.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
-index d3a5bb16f..243a3b9be 100644
---- a/arch/arm64/mm/dma-mapping.c
-+++ b/arch/arm64/mm/dma-mapping.c
-@@ -895,7 +895,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
-       __iommu_setup_dma_ops(dev, dma_base, size, iommu);
- #ifdef CONFIG_XEN
--      if (xen_initial_domain()) {
-+      if (!dev->archdata.dev_dma_ops && xen_initial_domain()) {
-               dev->archdata.dev_dma_ops = dev->dma_ops;
-               dev->dma_ops = xen_dma_ops;
-       }
--- 
-2.17.1
-
index dd85066..5069e1e 100644 (file)
@@ -6,16 +6,22 @@ SRC_URI_append = "\
     ${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \
     file://0001-mconf-menuconfig.patch \
 "
+
+# For Xen
+SRC_URI_append = "\
+    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://xen-be.cfg','',d)} \
+"
+
 #take in account that linux under xen should use the hvc0 console
-SERIAL_OPTION = "${@bb.utils.contains('AGL_XEN_WANTED','1','hvc0','115200;ttyS0',d)}"
+SERIAL_OPTION = "${@bb.utils.contains('AGL_XEN_WANTED','1','hvc0','ttyS0,115200',d)}"
 SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=${SERIAL_OPTION}", "", d)}"
 
 CMDLINE_DEBUG = ""
 
-#XEN related option
+# XEN related option
 CMDLINE_append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','clk_ignore_unused','',d)}'
 
-#workaround for crash during brcmfmac loading. Disable it at this moment
+# Workaround for crash during brcmfmac loading. Disable it at this moment
 CMDLINE_append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','modprobe.blacklist=brcmfmac','',d)}'
 
 CMDLINE_append = " usbhid.mousepoll=0"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend
deleted file mode 100644 (file)
index 2d100cb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-require recipes-kernel/linux/linux-agl-4.19.inc
-
-ENABLE_UART_raspberrypi4 = "1"
-
-# For Xen
-
-SRC_URI_append =" \
-    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://0002-Disable-DMA-in-sdhci-driver.patch','',d)} \
-"
-
-SRC_URI_append =" \
-    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://0003-Fix-PCIe-in-dom0-for-RPi4.patch','',d)} \
-"
-
-SRC_URI_append = " \
-    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://xen-be.cfg','',d)} \
-"
diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend
new file mode 100644 (file)
index 0000000..399aa19
--- /dev/null
@@ -0,0 +1,4 @@
+# For Xen
+SRC_URI_append =" \
+    ${@bb.utils.contains('AGL_XEN_WANTED','1','file://0002-Disable-DMA-in-sdhci-driver.patch','',d)} \
+"