summaryrefslogtreecommitdiffstats
path: root/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel')
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb3
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch39
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend10
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch25
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch31
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg50
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc140
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend13
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend1
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb16
-rw-r--r--meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend18
13 files changed, 136 insertions, 212 deletions
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
index c82e6fd2..c365715f 100644
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/create-combined-dtb/create-combined-dtb_1.0.0.bb
@@ -22,7 +22,8 @@ do_compile () {
if [ -f "${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb" ]; then
fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2710-rpi-3-b.dtb -o bcm2710-rpi-3-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/${VC4DTBO}.dtbo
fi
- if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" ]; then
+ # NOTE: meta-updater currently disables rpi-ft5406.dtbo on rpi4, so need to check if it is present
+ if [ -f "${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb" -a -f "${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo" ]; then
fdtoverlay -v -i ${DEPLOY_DIR_IMAGE}/bcm2711-rpi-4-b.dtb -o bcm2711-rpi-4-b+vc4+ft5406.dtb ${DEPLOY_DIR_IMAGE}/rpi-ft5406.dtbo ${DEPLOY_DIR_IMAGE}/${VC4DTBO}.dtbo
fi
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch
deleted file mode 100644
index 1ad0fd1b..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro/0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From c9d4f263131cb8e62597e0a296968b5cdbfe0019 Mon Sep 17 00:00:00 2001
-From: Andrei Gherzan <andrei@gherzan.ro>
-Date: Thu, 27 Jun 2019 20:49:10 +0100
-Subject: [PATCH] brcmfmac43455-sdio.txt: Follow raspbian change for
- boardflags3
-
-Without this change the WiFi interface on RPi4 never comes up. Also the
-upstream repository doesn't include this change. It is only (as far as I
-know) part of the raspberrypi deb repository with the following
-changelog:
-
-firmware-nonfree (1:20190114-1+rpt2) buster; urgency=medium
- * Update brcmfmac43455-sdio.txt
- - Update boardflags3
- -- Serge Schneider <serge@raspberrypi.org> Thu, 18 Apr 2019 14:35:34
-+0100
-
-Upstream-status: Pending
-Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
----
- brcm/brcmfmac43455-sdio.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/brcm/brcmfmac43455-sdio.txt b/brcm/brcmfmac43455-sdio.txt
-index 54d9321..6801286 100644
---- a/brcm/brcmfmac43455-sdio.txt
-+++ b/brcm/brcmfmac43455-sdio.txt
-@@ -21,7 +21,7 @@ btc_mode=1
- # bit1 for btcoex
- boardflags=0x00480201
- boardflags2=0x40800000
--boardflags3=0x48200100
-+boardflags3=0x44200100
- phycal_tempdelta=15
- rxchain=1
- txchain=1
---
-2.17.1
-
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend
deleted file mode 100644
index 30c18fb0..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-firmware-rpidistro_%.bbappend
+++ /dev/null
@@ -1,10 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SRC_URI += "file://0001-brcmfmac43455-sdio.txt-Follow-raspbian-change-for-bo.patch"
-
-do_unpack_append() {
- bb.build.exec_func('do_clean_pc', d)
-}
-do_clean_pc() {
- rm -rf ${S}/.pc
-}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch
new file mode 100644
index 00000000..04a8733f
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0002-Disable-DMA-in-sdhci-driver.patch
@@ -0,0 +1,25 @@
+From 758bc9b917469bc4e527dc3aae821c91cbc3d426 Mon Sep 17 00:00:00 2001
+From: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
+Date: Thu, 18 Jul 2019 00:01:27 -0400
+Subject: [PATCH 2/4] Disable DMA in sdhci driver
+
+---
+ drivers/mmc/host/sdhci-iproc.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
+index 983cddce9..150f7bfc8 100644
+--- a/drivers/mmc/host/sdhci-iproc.c
++++ b/drivers/mmc/host/sdhci-iproc.c
+@@ -252,6 +252,8 @@ static const struct sdhci_iproc_data bcm2835_data = {
+
+ static const struct sdhci_pltfm_data sdhci_bcm2838_pltfm_data = {
+ .ops = &sdhci_iproc_32only_ops,
++ .quirks = SDHCI_QUIRK_BROKEN_DMA |
++ SDHCI_QUIRK_BROKEN_ADMA,
+ };
+
+ static const struct sdhci_iproc_data bcm2838_data = {
+--
+2.17.1
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch
new file mode 100644
index 00000000..835f36da
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/0003-Fix-PCIe-in-dom0-for-RPi4.patch
@@ -0,0 +1,31 @@
+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
+
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg
deleted file mode 100644
index 07b14371..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/rpi-kernel-misc.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_SENSORS_RPI_POE_FAN=m
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg
new file mode 100644
index 00000000..36f39018
--- /dev/null
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/files/xen-be.cfg
@@ -0,0 +1,50 @@
+# global stuff - these enable us to allow some
+# of the not so generic stuff below for xen
+CONFIG_PARAVIRT=y
+CONFIG_NET=y
+CONFIG_NET_CORE=y
+CONFIG_NETDEVICES=y
+CONFIG_BLOCK=y
+CONFIG_WATCHDOG=y
+CONFIG_TARGET_CORE=y
+CONFIG_SCSI=y
+CONFIG_FB=y
+CONFIG_INPUT_MISC=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_TTY=y
+# Technically not required but otherwise produces
+# pretty useless systems starting from allnoconfig
+# You want TCP/IP and ELF binaries right?
+CONFIG_INET=y
+CONFIG_BINFMT_ELF=y
+# generic config
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+# backend drivers
+CONFIG_XEN_BACKEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_HVC_XEN=y
+CONFIG_XEN_WDT=m
+CONFIG_XEN_SCSI_BACKEND=m
+# frontend drivers
+CONFIG_XEN_FBDEV_FRONTEND=m
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m
+CONFIG_XEN_SCSI_FRONTEND=m
+# others
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=m
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XENFS=m
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=m
+CONFIG_XEN_GRANT_DEV_ALLOC=m
+CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PRIVCMD=m
+CONFIG_DEBUG_INFO=y
+CONFIG_FRAME_POINTER=y
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg
deleted file mode 100644
index 4a67a7e6..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/disable_kprobes.cfg
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_KPROBES=n
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc
deleted file mode 100644
index ea7f7783..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi4.inc
+++ /dev/null
@@ -1,140 +0,0 @@
-DESCRIPTION = "Linux Kernel for Raspberry Pi"
-SECTION = "kernel"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-
-COMPATIBLE_MACHINE = "^rpi$"
-
-PE = "1"
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-inherit kernel siteinfo
-require recipes-kernel/linux/linux-yocto.inc
-
-SRC_URI += "file://rpi-kernel-misc.cfg"
-
-KCONFIG_MODE = "--alldefconfig"
-KBUILD_DEFCONFIG_raspberrypi0-wifi ?= "bcmrpi_defconfig"
-KBUILD_DEFCONFIG_raspberrypi ?= "bcmrpi_defconfig"
-KBUILD_DEFCONFIG_raspberrypi2 ?= "bcm2709_defconfig"
-KBUILD_DEFCONFIG_raspberrypi3 ?= "bcm2709_defconfig"
-KBUILD_DEFCONFIG_raspberrypi3-64 ?= "bcmrpi3_defconfig"
-KBUILD_DEFCONFIG_raspberrypi4 ?= "bcm2711_defconfig"
-KBUILD_DEFCONFIG_raspberrypi4-64 ?= "bcm2711_defconfig"
-
-# CMDLINE for raspberrypi
-SERIAL = "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
-CMDLINE ?= "dwc_otg.lpm_enable=0 ${SERIAL} root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
-
-# Add the kernel debugger over console kernel command line option if enabled
-CMDLINE_append = ' ${@oe.utils.conditional("ENABLE_KGDB", "1", "kgdboc=serial0,115200", "", d)}'
-
-# Disable rpi logo on boot
-CMDLINE_append += ' ${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nologo", "", d)}'
-
-# You can define CMDLINE_DEBUG as "debug" in your local.conf or distro.conf
-# to enable kernel debugging.
-CMDLINE_DEBUG ?= ""
-CMDLINE_append = " ${CMDLINE_DEBUG}"
-
-KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains("MACHINE_FEATURES", "pitft28r", "stmpe-ts", "", d)}"
-
-# A LOADADDR is needed when building a uImage format kernel. This value is not
-# set by default in rpi-4.8.y and later branches so we need to provide it
-# manually. This value unused if KERNEL_IMAGETYPE is not uImage.
-KERNEL_EXTRA_ARGS += "LOADADDR=0x00008000"
-
-# Set a variable in .configure
-# $1 - Configure variable to be set
-# $2 - value [n/y/value]
-kernel_configure_variable() {
- # Remove the config
- CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
- if test "$2" = "n"
- then
- echo "# CONFIG_$1 is not set" >> ${B}/.config
- else
- echo "CONFIG_$1=$2" >> ${B}/.config
- fi
-}
-
-config_setup() {
- # From kernel.bbclass. Unfortunately, this is needed to support builds that
- # use devtool. The reason is as follows:
- #
- # - In devtool builds, externalsrc.bbclass gets inherited and sets a list of
- # SRCTREECOVEREDTASKS, which don't get run because they affect the source
- # tree and, when using devtool, we want the developer's changes to be the
- # single source of truth. kernel-yocto.bbclass adds do_kernel_configme to
- # SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal
- # non-devtool build, do_kernel_configme creates ${B}.config.
- #
- # - Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme
- # doesn't run, because the first few lines of do_configure in kernel.bbclass
- # populate ${B}.config from either ${S}.config (if it exists) for custom
- # developer changes, or otherwise from ${WORDIR}/defconfig.
- #
- # - In linux-raspberrypi, we add do_configure_prepend, which tweaks
- # ${B}.config. Since this runs *before* the kernel.bbclass do_configure,
- # ${B}.config doesn't yet exist and we hit an error. Thus we need to move
- # the logic from do_configure up to before our do_configure_prepend. Because
- # we are copying only a portion of do_configure and not the whole thing,
- # there is no clean way to do it using OE functionality, so we just
- # copy-and-paste.
- if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
- mv "${S}/.config" "${B}/.config"
- fi
-
- # Copy defconfig to .config if .config does not exist. This allows
- # recipes to manage the .config themselves in do_configure_prepend().
- if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
- cp "${WORKDIR}/defconfig" "${B}/.config"
- fi
-}
-
-do_configure_prepend() {
- config_setup
-
- mv -f ${B}/.config ${B}/.config.patched
- CONF_SED_SCRIPT=""
-
- # Localversion
- kernel_configure_variable LOCALVERSION "\"\""
-
- if [ "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
- kernel_configure_variable OVERLAY_FS y
- kernel_configure_variable SQUASHFS y
- kernel_configure_variable UBIFS_FS y
- fi
-
- # Activate the configuration options for VC4
- VC4GRAPHICS="${@bb.utils.contains("MACHINE_FEATURES", "vc4graphics", "1", "0", d)}"
- if [ "${VC4GRAPHICS}" = "1" ]; then
- kernel_configure_variable I2C_BCM2835 y
- kernel_configure_variable DRM y
- kernel_configure_variable DRM_FBDEV_EMULATION y
- kernel_configure_variable DRM_VC4 y
- fi
-
- # Keep this the last line
- # Remove all modified configs and add the rest to .config
- sed -e "${CONF_SED_SCRIPT}" < '${B}/.config.patched' >> '${B}/.config'
- rm -f ${B}/.config.patched
-}
-
-do_compile_append() {
- if [ "${SITEINFO_BITS}" = "64" ]; then
- cc_extra=$(get_cc_option)
- oe_runmake dtbs CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
- fi
-}
-
-do_deploy_append() {
- # Deploy cmdline.txt
- install -d ${DEPLOYDIR}/bcm2835-bootfiles
- PITFT="${@bb.utils.contains("MACHINE_FEATURES", "pitft", "1", "0", d)}"
- if [ ${PITFT} = "1" ]; then
- PITFT_PARAMS="fbcon=map:10 fbcon=font:VGA8x8"
- fi
- echo "${CMDLINE}${PITFT_PARAMS}" > ${DEPLOYDIR}/bcm2835-bootfiles/cmdline.txt
-}
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
index c12cd6c5..f78e0b5e 100644
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
@@ -2,14 +2,21 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
require recipes-kernel/linux/linux-agl.inc
-# NOTE: Kprobes need to be disabled until linux-raspberrypi gets updated
-# to newer than 4.14.104 to avoid lttng-modules failing to build.
SRC_URI_append = "\
${@oe.utils.conditional('USE_FAYTECH_MONITOR', '1', 'file://0002-faytech-fix-rpi.patch', '', d)} \
- file://disable_kprobes.cfg \
"
+#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 = "${@oe.utils.conditional("ENABLE_UART", "1", "console=${SERIAL_OPTION}", "", d)}"
CMDLINE_DEBUG = ""
+
+#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
+CMDLINE_append = ' ${@bb.utils.contains('AGL_XEN_WANTED','1','modprobe.blacklist=brcmfmac','',d)}'
+
CMDLINE_append = " usbhid.mousepoll=0"
# Add options to allow CMA to operate
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend
deleted file mode 100644
index ba11890b..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14%.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-require recipes-kernel/linux/linux-agl-4.14.inc
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb
deleted file mode 100644
index c1df2274..00000000
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-raspberrypi:"
-
-LINUX_VERSION ?= "4.19.80"
-LINUX_RPI_BRANCH ?= "rpi-4.19.y"
-
-SRCREV = "3492a1b003494535eb1b17aa7f258469036b1de7"
-SRC_URI = " \
- git://github.com/raspberrypi/linux.git;protocol=git;branch=${LINUX_RPI_BRANCH} \
- "
-SRC_URI_append_raspberrypi4-64 = " file://rpi4-64-kernel-misc.cfg"
-
-require linux-raspberrypi4.inc
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-
-KERNEL_EXTRA_ARGS_append_rpi = " DTC_FLAGS='-@ -H epapr'"
diff --git a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend
index 35a09b02..7f17f0c3 100644
--- a/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend
+++ b/meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.19.bbappend
@@ -1,2 +1,20 @@
+require recipes-kernel/linux/linux-agl-4.19.inc
+
ENABLE_UART_raspberrypi4 = "1"
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+
+# 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)} \
+"