From 1c763d493abb1cebf06341af72a61b9c1271ac43 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 8 Mar 2021 12:33:48 -0500 Subject: meta-agl-bsp: clean up Raspberry Pi Xen support 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 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 --- meta-agl-bsp/conf/include/agl_raspberrypi3.inc | 3 +++ meta-agl-bsp/conf/include/agl_raspberrypi4.inc | 3 +++ .../recipes-bsp/bootfiles/rpi-config_git.bbappend | 3 --- .../0003-Fix-PCIe-in-dom0-for-RPi4.patch | 31 ---------------------- .../linux/linux-raspberrypi_%.bbappend | 12 ++++++--- .../linux/linux-raspberrypi_4.19.bbappend | 17 ------------ .../linux/linux-raspberrypi_5.4.bbappend | 4 +++ 7 files changed, 19 insertions(+), 54 deletions(-) delete mode 100644 meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Fix-PCIe-in-dom0-for-RPi4.patch delete mode 100644 meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend create mode 100644 meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend (limited to 'meta-agl-bsp') diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc index a4989b79a..8b3d80d56 100644 --- a/meta-agl-bsp/conf/include/agl_raspberrypi3.inc +++ b/meta-agl-bsp/conf/include/agl_raspberrypi3.inc @@ -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" diff --git a/meta-agl-bsp/conf/include/agl_raspberrypi4.inc b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc index c44d44f8f..e590cb2f9 100644 --- a/meta-agl-bsp/conf/include/agl_raspberrypi4.inc +++ b/meta-agl-bsp/conf/include/agl_raspberrypi4.inc @@ -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" diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index bbab3df46..dc9df4ad8 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -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 index 835f36da3..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/0003-Fix-PCIe-in-dom0-for-RPi4.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 77765c2a47ce43911b8fe7b09f037c9bc13008ca Mon Sep 17 00:00:00 2001 -From: Jeff Kubascik -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 - diff --git a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index dd850669f..5069e1ee1 100644 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -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 index 2d100cb43..000000000 --- a/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend +++ /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 index 000000000..399aa1974 --- /dev/null +++ b/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_5.4.bbappend @@ -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)} \ +" -- cgit 1.2.3-korg