summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux')
-rw-r--r--recipes-kernel/linux/device-tree-overlays-mainline_git.bb21
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.cfg14
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.scc4
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.cfg5
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.scc4
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline.inc27
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline_%.bbappend1
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline_5.4.bb24
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-ARM-dts-imx6qdl-apalis-Add-usdhc-aliases.patch38
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-freescale-imx8mp-verdin-replace-sleep-m.patch120
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-ti-k3-am62-verdin-replace-sleep-moci-ho.patch67
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-drm-bridge-lt8912b-Add-suspend-resume-support.patch68
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch52
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-add-verdin-imx8mm-mallow-board.patch44
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch110
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-thermal-imx-Update-critical-temp-threshold.patch40
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch68
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx-Add-support-for-Apalis-Evaluation-Board-.patch530
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx6qdl-colibri-Add-usdhc-aliases.patch38
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch61
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-imx8mp-verdin-dahlia-support-.patch99
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch273
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-ti-k3-am62-verdin-dahlia-support-sleep-.patch70
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-drm-bridge-lt8912b-Add-power-supplies.patch92
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch103
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0003-ARM-dts-imx7d-colibri-emmc-Add-usdhc-aliases.patch35
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch120
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch45
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0004-arm64-dts-freescale-imx8mm-verdin-dahlia-support-.patch90
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0004-media-i2c-ov5640-Implement-get_mbus_config.patch54
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch54
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-rt_6.6.bb16
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream.inc51
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream/0001-thermal-imx-Update-critical-temp-threshold.patch40
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch68
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch61
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream/0004-media-i2c-ov5640-Implement-get_mbus_config.patch54
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream_6.6.bb37
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream_mainline.bb19
-rw-r--r--recipes-kernel/linux/linux-toradex_%.bbappend1
40 files changed, 2623 insertions, 95 deletions
diff --git a/recipes-kernel/linux/device-tree-overlays-mainline_git.bb b/recipes-kernel/linux/device-tree-overlays-mainline_git.bb
index c8ef7ce..805a2ac 100644
--- a/recipes-kernel/linux/device-tree-overlays-mainline_git.bb
+++ b/recipes-kernel/linux/device-tree-overlays-mainline_git.bb
@@ -1,17 +1,8 @@
-SUMMARY = "Toradex BSP device tree overlays"
-DESCRIPTION = "Toradex BSP device tree overlays from within layer."
+inherit toradex-devicetree
-SRC_URI = "git://git.toradex.com/device-tree-overlays.git;branch=${SRCBRANCH};protocol=https"
+SRCBRANCH = "master"
+SRCREV = "1e210e85bc2fc462d874412a855b10d9f86b31fd"
+SRCREV:use-head-next = "${AUTOREV}"
-SRCBRANCH = "toradex_5.4.y"
-
-SRCREV = "c03596b50198bd3ec6e58ca669b01323b1f21815"
-SRCREV_use-head-next = "${AUTOREV}"
-
-PV = "${SRCBRANCH}+git${SRCPV}"
-
-inherit devicetree
-
-S = "${WORKDIR}/git/overlays"
-
-COMPATIBLE_MACHINE = ".*(mx[678]|tegra124).*"
+COMPATIBLE_MACHINE:tdx = ".*"
+COMPATIBLE_MACHINE = "^$"
diff --git a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.cfg b/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.cfg
deleted file mode 100644
index a9c88bd..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.cfg
+++ /dev/null
@@ -1,14 +0,0 @@
-# CONFIG_PM_DEBUG is not set
-# CONFIG_6LOWPAN_DEBUGFS is not set
-# CONFIG_BT_DEBUGFS is not set
-# CONFIG_ATH9K_DEBUGFS is not set
-# CONFIG_ATH9K_HTC_DEBUGFS is not set
-# CONFIG_ATH10K_DEBUGFS is not set
-# CONFIG_RTLWIFI_DEBUG is not set
-# CONFIG_IEEE802154_AT86RF230_DEBUGFS is not set
-# CONFIG_DYNAMIC_DEBUG is not set
-# CONFIG_DETECT_HUNG_TASK is not set
-# CONFIG_SCHEDSTATS is not set
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-# CONFIG_CORESIGHT is not set
diff --git a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.scc b/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.scc
deleted file mode 100644
index edd1519..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt-less-latency.scc
+++ /dev/null
@@ -1,4 +0,0 @@
-define KFEATURE_DESCRIPTION "Disable configs that could lead to preempt-rt latency"
-define KFEATURE_COMPATIBILITY board
-
-kconf non-hardware preempt-rt-less-latency.cfg
diff --git a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.cfg b/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.cfg
deleted file mode 100644
index f76e447..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-CONFIG_EXPERT=y
-# CONFIG_PREEMPT_NONE is not set
-# CONFIG_PREEMPT_VOLUNTARY is not set
-# CONFIG_PREEMPT is not set
-CONFIG_PREEMPT_RT=y
diff --git a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.scc b/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.scc
deleted file mode 100644
index 82d27dc..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline-5.4/preempt-rt.scc
+++ /dev/null
@@ -1,4 +0,0 @@
-define KFEATURE_DESCRIPTION "Enable Features needed by preempt-rt"
-define KFEATURE_COMPATIBILITY board
-
-kconf non-hardware preempt-rt.cfg
diff --git a/recipes-kernel/linux/linux-toradex-mainline.inc b/recipes-kernel/linux/linux-toradex-mainline.inc
deleted file mode 100644
index ffee627..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-SUMMARY = "Toradex mainline Linux kernel"
-SUMMARY_preempt-rt = "Toradex mainline real-Time Linux kernel"
-SECTION = "kernel"
-LICENSE = "GPLv2"
-
-LIC_FILES_CHKSUM ?= "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
-
-inherit kernel-yocto kernel toradex-kernel-localversion
-
-SRC_URI = " \
- git://git.toradex.com/linux-toradex.git;protocol=https;branch=${KBRANCH};name=machine \
-"
-
-S = "${WORKDIR}/git"
-
-DEPENDS += "coreutils-native lzop-native"
-
-# Additional file deployed by recent mainline kernels
-FILES_${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo"
-
-KERNEL_CONFIG_NAME ?= "${KERNEL_PACKAGE_NAME}-config-${KERNEL_ARTIFACT_NAME}"
-KERNEL_CONFIG_LINK_NAME ?= "${KERNEL_PACKAGE_NAME}-config"
-
-do_deploy_append() {
- cp -a ${B}/.config ${DEPLOYDIR}/${KERNEL_CONFIG_NAME}
- ln -sf ${KERNEL_CONFIG_NAME} ${DEPLOYDIR}/${KERNEL_CONFIG_LINK_NAME}
-}
diff --git a/recipes-kernel/linux/linux-toradex-mainline_%.bbappend b/recipes-kernel/linux/linux-toradex-mainline_%.bbappend
deleted file mode 100644
index a4bc867..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline_%.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_OEMAKE += "DTC_FLAGS=-@ "
diff --git a/recipes-kernel/linux/linux-toradex-mainline_5.4.bb b/recipes-kernel/linux/linux-toradex-mainline_5.4.bb
deleted file mode 100644
index 594819f..0000000
--- a/recipes-kernel/linux/linux-toradex-mainline_5.4.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.4:"
-
-LINUX_VERSION ?= "5.4.61"
-PV = "${LINUX_VERSION}+git${SRCPV}"
-
-SRCREV_machine = "26abb5b86e1735ed03660550a5e1a49e96554264"
-SRCREV_machine_use-head-next = "${AUTOREV}"
-
-KCONFIG_MODE="--alldefconfig"
-
-KBRANCH = "toradex_5.4.y"
-
-require recipes-kernel/linux/linux-toradex-mainline.inc
-
-SRC_URI_append_preempt-rt = " \
- ${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.4/older/patch-5.4.61-rt37.patch.xz;name=rt-patch \
- file://preempt-rt.scc \
- file://preempt-rt-less-latency.scc \
-"
-SRC_URI[rt-patch.md5sum] = "5a72e4f56ffdd79c8c668197f989f8d1"
-SRC_URI[rt-patch.sha256sum] = "b2b52be0ef8b56a44a898ffc6a54515508e3cc9b2faece7a7d9f5d617a29ede1"
-
-KBUILD_DEFCONFIG ?= "toradex-imx_v6_v7_defconfig"
-KBUILD_DEFCONFIG_apalis-tk1 ?= "tegra_defconfig"
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-ARM-dts-imx6qdl-apalis-Add-usdhc-aliases.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-ARM-dts-imx6qdl-apalis-Add-usdhc-aliases.patch
new file mode 100644
index 0000000..276288a
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-ARM-dts-imx6qdl-apalis-Add-usdhc-aliases.patch
@@ -0,0 +1,38 @@
+From 301d47dae8429cc48cc91a059c2b24a9612b6254 Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Mon, 20 Nov 2023 21:58:16 +0100
+Subject: [PATCH 1/3] ARM: dts: imx6qdl-apalis: Add usdhc aliases
+
+Add mmc aliases to ensure a consistent mmc device naming across the
+Toradex SoM family, with this commit mmc0 is the on-module eMMC
+boot device and the not available mmc interfaces are removed.
+
+Upstream-Status: Backport [cdb7389abe3065be80e70e8112afb1f625e7a770]
+
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ arch/arm/boot/dts/nxp/imx/imx6qdl-apalis.dtsi | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl-apalis.dtsi
+index 4cc965277c521..dec2a1c9db142 100644
+--- a/arch/arm/boot/dts/nxp/imx/imx6qdl-apalis.dtsi
++++ b/arch/arm/boot/dts/nxp/imx/imx6qdl-apalis.dtsi
+@@ -12,6 +12,13 @@ / {
+ model = "Toradex Apalis iMX6Q/D Module";
+ compatible = "toradex,apalis_imx6q", "fsl,imx6q";
+
++ aliases {
++ mmc0 = &usdhc3; /* eMMC */
++ mmc1 = &usdhc1; /* MMC1 slot */
++ mmc2 = &usdhc2; /* SD1 slot */
++ /delete-property/ mmc3;
++ };
++
+ /* Will be filled by the bootloader */
+ memory@10000000 {
+ device_type = "memory";
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-freescale-imx8mp-verdin-replace-sleep-m.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-freescale-imx8mp-verdin-replace-sleep-m.patch
new file mode 100644
index 0000000..c05aa10
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-freescale-imx8mp-verdin-replace-sleep-m.patch
@@ -0,0 +1,120 @@
+From 85eba60ab304cfc9d7053298a6aa7dc4234f2cad Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 26 Jan 2024 13:33:05 +0100
+Subject: [PATCH v1 1/4] arm64: dts: freescale: imx8mp-verdin: replace
+ sleep-moci hog with regulator
+
+The Verdin family has a signal called sleep-moci which can be used to
+turn off peripherals on the carrier board when the SoM goes into
+suspend. So far we have hogged this signal, which means the peripherals
+are always on and it is not possible to add peripherals that depend on
+the sleep-moci to be on. With this change, we replace the hog with a
+regulator so that peripherals can add their own regulators that use the
+same gpio. Carrier boards that allow peripherals to be powered off in
+suspend can disable this regulator and implement their own regulator to
+control the sleep-moci.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240405160720.5977-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ .../dts/freescale/imx8mp-verdin-dahlia.dtsi | 5 ++++
+ .../boot/dts/freescale/imx8mp-verdin-dev.dtsi | 5 ++++
+ .../dts/freescale/imx8mp-verdin-yavia.dtsi | 5 ++++
+ .../boot/dts/freescale/imx8mp-verdin.dtsi | 26 ++++++++++++-------
+ 4 files changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
+index 7e9e4b13b5c5..e68e0e6f21e9 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
+@@ -70,6 +70,11 @@ &flexspi {
+ status = "okay";
+ };
+
++&gpio4 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ /* Current measurement into module VCC */
+ &hwmon {
+ status = "okay";
+diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi
+index a509b2b7fa85..1a2520d4d6cf 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi
+@@ -93,6 +93,11 @@ &flexspi {
+ status = "okay";
+ };
+
++&gpio4 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ &gpio_expander_21 {
+ status = "okay";
+ vcc-supply = <&reg_1p8v>;
+diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi
+index db1722f0d80e..27160024d5b5 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi
+@@ -100,6 +100,11 @@ &flexcan1 {
+ status = "okay";
+ };
+
++&gpio4 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ &hwmon_temp {
+ status = "okay";
+ };
+diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
+index faa17cbbe2fd..e523762947aa 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
+@@ -116,6 +116,22 @@ reg_module_eth1phy: regulator-module-eth1phy {
+ vin-supply = <&reg_vdd_3v3>;
+ };
+
++ /*
++ * By default we enable CTRL_SLEEP_MOCI#, this is required to have
++ * peripherals on the carrier board powered.
++ * If more granularity or power saving is required this can be disabled
++ * in the carrier board device tree files.
++ */
++ reg_force_sleep_moci: regulator-force-sleep-moci {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
++ regulator-always-on;
++ regulator-boot-on;
++ regulator-name = "CTRL_SLEEP_MOCI#";
++ };
++
+ reg_usb1_vbus: regulator-usb1-vbus {
+ compatible = "regulator-fixed";
+ enable-active-high;
+@@ -439,16 +455,6 @@ &gpio4 {
+ "SODIMM_256",
+ "SODIMM_48",
+ "SODIMM_44";
+-
+- ctrl-sleep-moci-hog {
+- gpio-hog;
+- /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+- gpios = <29 GPIO_ACTIVE_HIGH>;
+- line-name = "CTRL_SLEEP_MOCI#";
+- output-high;
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+- };
+ };
+
+ /* On-module I2C */
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-ti-k3-am62-verdin-replace-sleep-moci-ho.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-ti-k3-am62-verdin-replace-sleep-moci-ho.patch
new file mode 100644
index 0000000..b00c911
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-arm64-dts-ti-k3-am62-verdin-replace-sleep-moci-ho.patch
@@ -0,0 +1,67 @@
+From 4f65d10d84e26e48818e8c16b604fcdcd6b9f2a3 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 26 Jan 2024 13:55:00 +0100
+Subject: [PATCH v1 1/2] arm64: dts: ti: k3-am62-verdin: replace sleep-moci hog
+ with regulator
+
+The Verdin family has a signal called sleep-moci which can be used to
+turn off peripherals on the carrier board when the SoM goes into
+suspend. So far we have hogged this signal, which means the peripherals
+are always on and it is not possible to add peripherals that depend on
+the sleep-moci to be on. With this change, we replace the hog with a
+regulator so that peripherals can add their own regulators that use the
+same gpio. Carrier boards that allow peripherals to be powered off in
+suspend can disable this regulator and implement their own regulator to
+control the sleep-moci.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240301084901.16656-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 24 ++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
+index 6a06724b6d16..ba3b3e18a46d 100644
+--- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
++++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi
+@@ -122,6 +122,22 @@ reg_1v8_eth: regulator-1v8-eth {
+ vin-supply = <&reg_1v8>;
+ };
+
++ /*
++ * By default we enable CTRL_SLEEP_MOCI#, this is required to have
++ * peripherals on the carrier board powered.
++ * If more granularity or power saving is required this can be disabled
++ * in the carrier board device tree files.
++ */
++ reg_force_sleep_moci: regulator-force-sleep-moci {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&main_gpio0 31 GPIO_ACTIVE_HIGH>;
++ regulator-always-on;
++ regulator-boot-on;
++ regulator-name = "CTRL_SLEEP_MOCI#";
++ };
++
+ /* Verdin SD_1 Power Supply */
+ reg_sdhc1_vmmc: regulator-sdhci1 {
+ compatible = "regulator-fixed";
+@@ -951,14 +967,6 @@ &main_gpio0 {
+ "",
+ "",
+ "";
+-
+- verdin_ctrl_sleep_moci: ctrl-sleep-moci-hog {
+- gpio-hog;
+- /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+- gpios = <31 GPIO_ACTIVE_HIGH>;
+- line-name = "CTRL_SLEEP_MOCI#";
+- output-high;
+- };
+ };
+
+ &main_gpio1 {
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-drm-bridge-lt8912b-Add-suspend-resume-support.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-drm-bridge-lt8912b-Add-suspend-resume-support.patch
new file mode 100644
index 0000000..347c4f2
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-drm-bridge-lt8912b-Add-suspend-resume-support.patch
@@ -0,0 +1,68 @@
+From 0b82a2b70f890e8dd7a46dfbfcce00bd7e434762 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Wed, 15 Nov 2023 13:13:36 +0100
+Subject: [PATCH] drm/bridge: lt8912b: Add suspend/resume support
+
+Add support for suspend and resume. The lt8912b will power off when
+going into suspend and power on when resuming.
+
+Upstream-Status: Backport [0b82a2b70f890e8dd7a46dfbfcce00bd7e434762]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Reviewed-by: Robert Foss <rfoss@kernel.org>
+Signed-off-by: Robert Foss <rfoss@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231115121338.22959-2-francesco@dolcini.it
+---
+ drivers/gpu/drm/bridge/lontium-lt8912b.c | 28 ++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
+index 03532efb893b..097ab04234b7 100644
+--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
++++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
+@@ -634,6 +634,33 @@ static const struct drm_bridge_funcs lt8912_bridge_funcs = {
+ .get_edid = lt8912_bridge_get_edid,
+ };
+
++static int lt8912_bridge_resume(struct device *dev)
++{
++ struct lt8912 *lt = dev_get_drvdata(dev);
++ int ret;
++
++ ret = lt8912_hard_power_on(lt);
++ if (ret)
++ return ret;
++
++ ret = lt8912_soft_power_on(lt);
++ if (ret)
++ return ret;
++
++ return lt8912_video_on(lt);
++}
++
++static int lt8912_bridge_suspend(struct device *dev)
++{
++ struct lt8912 *lt = dev_get_drvdata(dev);
++
++ lt8912_hard_power_off(lt);
++
++ return 0;
++}
++
++static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspend, lt8912_bridge_resume);
++
+ static int lt8912_parse_dt(struct lt8912 *lt)
+ {
+ struct gpio_desc *gp_reset;
+@@ -770,6 +797,7 @@ static struct i2c_driver lt8912_i2c_driver = {
+ .driver = {
+ .name = "lt8912",
+ .of_match_table = lt8912_dt_match,
++ .pm = pm_sleep_ptr(&lt8912_bridge_pm_ops),
+ },
+ .probe = lt8912_probe,
+ .remove = lt8912_remove,
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch
new file mode 100644
index 0000000..3405ee4
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch
@@ -0,0 +1,52 @@
+From 07aff3753a49d9c70cd98571a7bf58e61f8d9fed Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Wed, 24 Jan 2024 11:13:19 -0300
+Subject: [PATCH 1/2] dt-bindings: arm: fsl: Add toradex,apalis_imx6q-eval-v1.2
+ board
+
+Add the toradex,apalis_imx6q-eval-v1.2 compatible string for version 1.2
+of the Apalis Evaluation Board.
+
+Version v1.2 includes the following changes compared to v1.1:
+
+- 8-bit MMC connector replaced with a 4-bit uSD connector.
+- Audio codec NAU88C22 added.
+- M24C02 EEPROM i2c added.
+- MIPI-CSI-2 connector directly to the board added.
+- PCIe switch PEX8605 removed and PCIe now is routed directly to Mini
+ PCIe connector.
+- Power measurement IC INA219 added.
+- Replaced DVI with HDMI connector.
+- Single-channel USB to UART converter replaced with four-channel USB
+ to UART/JTAG.
+- Temperature sensor TMP75 added.
+
+Please note that version v1.0 (which reached EOL) is compatible with
+v1.1, therefore toradex,apalis_imx6q-eval compatible string should be
+used for both v1.0 and v1.1.
+
+Upstream-Status: Submitted [https://lore.kernel.org/lkml/20240122123526.43400-1-hiagofranco@gmail.com/]
+
+Acked-by: Conor Dooley <conor.dooley@microchip.com>
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ Documentation/devicetree/bindings/arm/fsl.yaml | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml b/Documentation/devicetree/bindings/arm/fsl.yaml
+index 9450b2c8a678f..9a3262ca169e2 100644
+--- a/Documentation/devicetree/bindings/arm/fsl.yaml
++++ b/Documentation/devicetree/bindings/arm/fsl.yaml
+@@ -381,7 +381,8 @@ properties:
+ - toradex,apalis_imx6q-ixora # Apalis iMX6Q/D Module on Ixora Carrier Board
+ - toradex,apalis_imx6q-ixora-v1.1 # Apalis iMX6Q/D Module on Ixora V1.1 Carrier Board
+ - toradex,apalis_imx6q-ixora-v1.2 # Apalis iMX6Q/D Module on Ixora V1.2 Carrier Board
+- - toradex,apalis_imx6q-eval # Apalis iMX6Q/D Module on Apalis Evaluation Board
++ - toradex,apalis_imx6q-eval # Apalis iMX6Q/D Module on Apalis Evaluation Board v1.0/v1.1
++ - toradex,apalis_imx6q-eval-v1.2 # Apalis iMX6Q/D Module on Apalis Evaluation Board v1.2
+ - const: toradex,apalis_imx6q
+ - const: fsl,imx6q
+
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-add-verdin-imx8mm-mallow-board.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-add-verdin-imx8mm-mallow-board.patch
new file mode 100644
index 0000000..7f14070
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-dt-bindings-arm-fsl-add-verdin-imx8mm-mallow-board.patch
@@ -0,0 +1,44 @@
+From b12afbf0aba29a6a5b70c356146e2dc8b530998c Mon Sep 17 00:00:00 2001
+From: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+Date: Fri, 1 Dec 2023 16:07:32 +0100
+Subject: [PATCH 1/2] dt-bindings: arm: fsl: add verdin imx8mm mallow board
+
+Add Mallow carrier board for wifi and nonwifi variants of Toradex Verdin
+IMX8MM SoM. Mallow is a low-cost carrier board in the Verdin family with
+a small form factor and build for volume production making it ideal for
+industrial and embedded applications.
+
+https://www.toradex.com/products/carrier-board/mallow-carrier-board
+
+Upstream-Status: Backport [ffce67b61108aaab6061f122b5cffe6c4e59fee2]
+
+Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ Documentation/devicetree/bindings/arm/fsl.yaml | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml b/Documentation/devicetree/bindings/arm/fsl.yaml
+index 9450b2c8a678f..beca54b61999b 100644
+--- a/Documentation/devicetree/bindings/arm/fsl.yaml
++++ b/Documentation/devicetree/bindings/arm/fsl.yaml
+@@ -958,6 +958,7 @@ properties:
+ - menlo,mx8menlo # Verdin iMX8M Mini Module on i.MX8MM Menlo board
+ - toradex,verdin-imx8mm-nonwifi-dahlia # Verdin iMX8M Mini Module on Dahlia
+ - toradex,verdin-imx8mm-nonwifi-dev # Verdin iMX8M Mini Module on Verdin Development Board
++ - toradex,verdin-imx8mm-nonwifi-mallow # Verdin iMX8M Mini Module on Mallow
+ - toradex,verdin-imx8mm-nonwifi-yavia # Verdin iMX8M Mini Module on Yavia
+ - const: toradex,verdin-imx8mm-nonwifi # Verdin iMX8M Mini Module without Wi-Fi / BT
+ - const: toradex,verdin-imx8mm # Verdin iMX8M Mini Module
+@@ -968,6 +969,7 @@ properties:
+ - enum:
+ - toradex,verdin-imx8mm-wifi-dahlia # Verdin iMX8M Mini Wi-Fi / BT Module on Dahlia
+ - toradex,verdin-imx8mm-wifi-dev # Verdin iMX8M Mini Wi-Fi / BT M. on Verdin Development B.
++ - toradex,verdin-imx8mm-wifi-mallow # Verdin iMX8M Mini Wi-Fi / BT Module on Mallow
+ - toradex,verdin-imx8mm-wifi-yavia # Verdin iMX8M Mini Wi-Fi / BT Module on Yavia
+ - const: toradex,verdin-imx8mm-wifi # Verdin iMX8M Mini Wi-Fi / BT Module
+ - const: toradex,verdin-imx8mm # Verdin iMX8M Mini Module
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch
new file mode 100644
index 0000000..561091f
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch
@@ -0,0 +1,110 @@
+From 248de784e6db9afc2eb9b01a123ce27324d16457 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 6 Oct 2023 10:04:25 -0300
+Subject: [PATCH 1/4] power: reset: gpio-poweroff: use a struct to store the
+ module variables
+
+Use a struct to store the module variables. This is required to later
+move to notifier_blocks where we can have several instances.
+
+Upstream-Status: Backport [13b4c6964665cadb9b06c085029710c43a0c662]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Link: https://lore.kernel.org/r/20231006130428.11259-2-francesco@dolcini.it
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+---
+ drivers/power/reset/gpio-poweroff.c | 48 +++++++++++++++++++----------
+ 1 file changed, 31 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
+index b28f24da1b3cd..dea550e422f3c 100644
+--- a/drivers/power/reset/gpio-poweroff.c
++++ b/drivers/power/reset/gpio-poweroff.c
+@@ -17,32 +17,37 @@
+ #include <linux/module.h>
+
+ #define DEFAULT_TIMEOUT_MS 3000
++
++struct gpio_poweroff {
++ struct gpio_desc *reset_gpio;
++ u32 timeout_ms;
++ u32 active_delay_ms;
++ u32 inactive_delay_ms;
++};
++
+ /*
+ * Hold configuration here, cannot be more than one instance of the driver
+ * since pm_power_off itself is global.
+ */
+-static struct gpio_desc *reset_gpio;
+-static u32 timeout = DEFAULT_TIMEOUT_MS;
+-static u32 active_delay = 100;
+-static u32 inactive_delay = 100;
++static struct gpio_poweroff *gpio_poweroff;
+
+ static void gpio_poweroff_do_poweroff(void)
+ {
+- BUG_ON(!reset_gpio);
++ BUG_ON(!gpio_poweroff);
+
+ /* drive it active, also inactive->active edge */
+- gpiod_direction_output(reset_gpio, 1);
+- mdelay(active_delay);
++ gpiod_direction_output(gpio_poweroff->reset_gpio, 1);
++ mdelay(gpio_poweroff->active_delay_ms);
+
+ /* drive inactive, also active->inactive edge */
+- gpiod_set_value_cansleep(reset_gpio, 0);
+- mdelay(inactive_delay);
++ gpiod_set_value_cansleep(gpio_poweroff->reset_gpio, 0);
++ mdelay(gpio_poweroff->inactive_delay_ms);
+
+ /* drive it active, also inactive->active edge */
+- gpiod_set_value_cansleep(reset_gpio, 1);
++ gpiod_set_value_cansleep(gpio_poweroff->reset_gpio, 1);
+
+ /* give it some time */
+- mdelay(timeout);
++ mdelay(gpio_poweroff->timeout_ms);
+
+ WARN_ON(1);
+ }
+@@ -60,20 +65,29 @@ static int gpio_poweroff_probe(struct platform_device *pdev)
+ return -EBUSY;
+ }
+
++ gpio_poweroff = devm_kzalloc(&pdev->dev, sizeof(*gpio_poweroff), GFP_KERNEL);
++ if (!gpio_poweroff)
++ return -ENOMEM;
++
+ input = device_property_read_bool(&pdev->dev, "input");
+ if (input)
+ flags = GPIOD_IN;
+ else
+ flags = GPIOD_OUT_LOW;
+
+- device_property_read_u32(&pdev->dev, "active-delay-ms", &active_delay);
++
++ gpio_poweroff->active_delay_ms = 100;
++ gpio_poweroff->inactive_delay_ms = 100;
++ gpio_poweroff->timeout_ms = DEFAULT_TIMEOUT_MS;
++
++ device_property_read_u32(&pdev->dev, "active-delay-ms", &gpio_poweroff->active_delay_ms);
+ device_property_read_u32(&pdev->dev, "inactive-delay-ms",
+- &inactive_delay);
+- device_property_read_u32(&pdev->dev, "timeout-ms", &timeout);
++ &gpio_poweroff->inactive_delay_ms);
++ device_property_read_u32(&pdev->dev, "timeout-ms", &gpio_poweroff->timeout_ms);
+
+- reset_gpio = devm_gpiod_get(&pdev->dev, NULL, flags);
+- if (IS_ERR(reset_gpio))
+- return PTR_ERR(reset_gpio);
++ gpio_poweroff->reset_gpio = devm_gpiod_get(&pdev->dev, NULL, flags);
++ if (IS_ERR(gpio_poweroff->reset_gpio))
++ return PTR_ERR(gpio_poweroff->reset_gpio);
+
+ pm_power_off = &gpio_poweroff_do_poweroff;
+ return 0;
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-thermal-imx-Update-critical-temp-threshold.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-thermal-imx-Update-critical-temp-threshold.patch
new file mode 100644
index 0000000..c09abb9
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-thermal-imx-Update-critical-temp-threshold.patch
@@ -0,0 +1,40 @@
+From 212abec626e1c82616a1cf6e492e467cf79aef23 Mon Sep 17 00:00:00 2001
+From: Francesco Dolcini <francesco.dolcini@toradex.com>
+Date: Wed, 20 Apr 2022 11:13:00 +0200
+Subject: [PATCH 1/4] thermal: imx: Update critical temp threshold
+
+Increase the critical temperature threshold to the datasheet defined
+value according to the temperature grade of the SoC, increasing the
+actual critical temperature value of 5 degrees.
+
+Without this change the emergency shutdown will trigger earlier then
+required affecting applications that are expected to be working on this
+close to the limit, but yet valid, temperature range.
+
+Upstream-Status: Denied [https://lore.kernel.org/all/20220420091300.179753-1-francesco.dolcini@toradex.com/]
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+---
+ drivers/thermal/imx_thermal.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
+index 826358cbe810..4fcbf15b2768 100644
+--- a/drivers/thermal/imx_thermal.c
++++ b/drivers/thermal/imx_thermal.c
+@@ -458,11 +458,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
+ }
+
+ /*
+- * Set the critical trip point at 5 °C under max
++ * Set the critical trip point at max
+ * Set the passive trip point at 10 °C under max (changeable via sysfs)
+ */
+ trips[IMX_TRIP_PASSIVE].temperature = data->temp_max - (1000 * 10);
+- trips[IMX_TRIP_CRITICAL].temperature = data->temp_max - (1000 * 5);
++ trips[IMX_TRIP_CRITICAL].temperature = data->temp_max;
+ }
+
+ static int imx_init_from_tempmon_data(struct platform_device *pdev)
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch
new file mode 100644
index 0000000..dfdd723
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch
@@ -0,0 +1,68 @@
+From 2147c8ddfaa746cdb8857db070f907fa9abfcb60 Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Tue, 19 Dec 2023 11:52:07 -0300
+Subject: [PATCH] usb: gadget: f_ncm: Apply workaround for packet clogging
+
+The existing size of 32 is causing significant slowness and freezing when
+utilizing the NCM protocol with a VNC client. This issue likely arises
+because the VNC protocol relies on sending numerous small packets, which
+accumulate until the 16KB limit is reached, leading to transmission
+delays.
+
+By decreasing TX_MAX_NUM_DPE to 4, we ensure that the NCM driver transmits
+packets at a reduced interval, thereby resolving the VNC performance
+issues. To comprehend how these packets are sent, refer to the code
+snippet below from f_ncm.c:
+
+```
+ /* If the new skb is too big for the current NCM NTB then
+ * set the current stored skb to be sent now and clear it
+ * ready for new data.
+ * NOTE: Assume maximum align for speed of calculation.
+ */
+ if (ncm->skb_tx_data
+ && (ncm->ndp_dgram_count >= TX_MAX_NUM_DPE
+ || (ncm->skb_tx_data->len +
+ div + rem + skb->len +
+ ncm->skb_tx_ndp->len + ndp_align + (2 * dgram_idx_len))
+ > max_size)) {
+ skb2 = package_for_tx(ncm);
+ if (!skb2)
+ goto err;
+ }
+```
+
+This issue is presently under investigation on the Linux kernel mailing
+list, and you can find the entire discussion at [1].
+
+[1] https://lore.kernel.org/all/20231204183751.64202-1-hiagofranco@gmail.com/
+
+Upstream-Status: Inappropriate [other]
+
+There is no proper patch for now, so instead we're using this patch that
+makes VNC work again as a temporarily solution until the mainline code
+gets fixed.
+
+Related-to: TEI-1078
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+---
+ drivers/usb/gadget/function/f_ncm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
+index e0c183234283..5e972d1c1a0c 100644
+--- a/drivers/usb/gadget/function/f_ncm.c
++++ b/drivers/usb/gadget/function/f_ncm.c
+@@ -113,7 +113,7 @@ static inline unsigned ncm_bitrate(struct usb_gadget *g)
+ * Smaller packets are not likely to be trying to maximize the
+ * throughput and will be mstly sending smaller infrequent frames.
+ */
+-#define TX_MAX_NUM_DPE 32
++#define TX_MAX_NUM_DPE 4
+
+ /* Delay for the transmit to wait before sending an unfilled NTB frame. */
+ #define TX_TIMEOUT_NSECS 300000
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx-Add-support-for-Apalis-Evaluation-Board-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx-Add-support-for-Apalis-Evaluation-Board-.patch
new file mode 100644
index 0000000..3237bcd
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx-Add-support-for-Apalis-Evaluation-Board-.patch
@@ -0,0 +1,530 @@
+From d01ee78a6990a2bc5572ea7839c0c549386d41d2 Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Wed, 24 Jan 2024 11:13:20 -0300
+Subject: [PATCH 2/2] ARM: dts: imx: Add support for Apalis Evaluation Board
+ v1.2
+
+Add support for the new Apalis Evaluation Board v1.2. Because
+only the imx6q-apalis-eval.dts was available, the imx6q-apalis-eval.dtsi
+has been created which has common hardware configurations for v1.0, v1.1
+and v1.2. Both imx6q-apalis-eval.dts and imx6q-apalis-eval-v1.2.dts
+files include imx6q-apalis-eval.dtsi.
+
+Versions 1.0 and 1.1 are compatible with each other and should
+use imx6q-apalis-eval.dts file. Now for v1.2, the new device-tree file
+should be used.
+
+Upstream-Status: Submitted [https://lore.kernel.org/lkml/20240122123526.43400-1-hiagofranco@gmail.com/]
+
+Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ arch/arm/boot/dts/nxp/imx/Makefile | 1 +
+ .../dts/nxp/imx/imx6q-apalis-eval-v1.2.dts | 200 ++++++++++++++++++
+ .../boot/dts/nxp/imx/imx6q-apalis-eval.dts | 108 +---------
+ .../boot/dts/nxp/imx/imx6q-apalis-eval.dtsi | 120 +++++++++++
+ 4 files changed, 323 insertions(+), 106 deletions(-)
+ create mode 100644 arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval-v1.2.dts
+ create mode 100644 arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dtsi
+
+diff --git a/arch/arm/boot/dts/nxp/imx/Makefile b/arch/arm/boot/dts/nxp/imx/Makefile
+index 3629e343d3225..9c4b2f14fb395 100644
+--- a/arch/arm/boot/dts/nxp/imx/Makefile
++++ b/arch/arm/boot/dts/nxp/imx/Makefile
+@@ -145,6 +145,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
+ imx6dl-yapp4-phoenix.dtb \
+ imx6dl-yapp4-ursa.dtb \
+ imx6q-apalis-eval.dtb \
++ imx6q-apalis-eval-v1.2.dtb \
+ imx6q-apalis-ixora.dtb \
+ imx6q-apalis-ixora-v1.1.dtb \
+ imx6q-apalis-ixora-v1.2.dtb \
+diff --git a/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval-v1.2.dts b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval-v1.2.dts
+new file mode 100644
+index 0000000000000..15d4a98ee9765
+--- /dev/null
++++ b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval-v1.2.dts
+@@ -0,0 +1,200 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright 2024 Toradex
++ */
++
++/dts-v1/;
++
++#include "imx6q-apalis-eval.dtsi"
++
++/ {
++ model = "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board v1.2";
++ compatible = "toradex,apalis_imx6q-eval-v1.2", "toradex,apalis_imx6q",
++ "fsl,imx6q";
++
++ reg_3v3_mmc: regulator-3v3-mmc {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio2 0 GPIO_ACTIVE_HIGH>;
++ off-on-delay-us = <100000>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_enable_3v3_mmc>;
++ regulator-max-microvolt = <3300000>;
++ regulator-min-microvolt = <3300000>;
++ regulator-name = "3.3V_MMC";
++ startup-delay-us = <10000>;
++ };
++
++ reg_3v3_sd: regulator-3v3-sd {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>;
++ off-on-delay-us = <100000>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_enable_3v3_sd>;
++ regulator-max-microvolt = <3300000>;
++ regulator-min-microvolt = <3300000>;
++ regulator-name = "3.3V_SD";
++ startup-delay-us = <10000>;
++ };
++
++ reg_can1: regulator-can1 {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio2 3 GPIO_ACTIVE_HIGH>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_enable_can1_power>;
++ regulator-name = "5V_SW_CAN1";
++ startup-delay-us = <10000>;
++ };
++
++ reg_can2: regulator-can2 {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio2 2 GPIO_ACTIVE_HIGH>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_enable_can2_power>;
++ regulator-name = "5V_SW_CAN2";
++ startup-delay-us = <10000>;
++ };
++
++ sound-carrier {
++ compatible = "simple-audio-card";
++ simple-audio-card,bitclock-master = <&codec_dai>;
++ simple-audio-card,format = "i2s";
++ simple-audio-card,frame-master = <&codec_dai>;
++ simple-audio-card,name = "apalis-nau8822";
++ simple-audio-card,routing =
++ "Headphones", "LHP",
++ "Headphones", "RHP",
++ "Speaker", "LSPK",
++ "Speaker", "RSPK",
++ "Line Out", "AUXOUT1",
++ "Line Out", "AUXOUT2",
++ "LAUX", "Line In",
++ "RAUX", "Line In",
++ "LMICP", "Mic In",
++ "RMICP", "Mic In";
++ simple-audio-card,widgets =
++ "Headphones", "Headphones",
++ "Line Out", "Line Out",
++ "Speaker", "Speaker",
++ "Microphone", "Mic In",
++ "Line", "Line In";
++
++ codec_dai: simple-audio-card,codec {
++ sound-dai = <&nau8822_1a>;
++ system-clock-frequency = <12288000>;
++ };
++
++ simple-audio-card,cpu {
++ sound-dai = <&ssi2>;
++ };
++ };
++};
++
++&can1 {
++ xceiver-supply = <&reg_can1>;
++ status = "okay";
++};
++
++&can2 {
++ xceiver-supply = <&reg_can2>;
++ status = "okay";
++};
++
++/* I2C1_SDA/SCL on MXM3 209/211 */
++&i2c1 {
++ /* Audio Codec */
++ nau8822_1a: audio-codec@1a {
++ compatible = "nuvoton,nau8822";
++ reg = <0x1a>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_nau8822>;
++ #sound-dai-cells = <0>;
++ };
++
++ /* Current measurement into module VCC */
++ hwmon@40 {
++ compatible = "ti,ina219";
++ reg = <0x40>;
++ shunt-resistor = <5000>;
++ };
++
++ /* Temperature Sensor */
++ temperature-sensor@4f {
++ compatible = "ti,tmp75c";
++ reg = <0x4f>;
++ };
++
++ /* EEPROM */
++ eeprom@57 {
++ compatible = "st,24c02", "atmel,24c02";
++ reg = <0x57>;
++ pagesize = <16>;
++ size = <256>;
++ };
++};
++
++&pcie {
++ status = "okay";
++};
++
++&ssi2 {
++ status = "okay";
++};
++
++/* MMC1 */
++&usdhc1 {
++ bus-width = <4>;
++ pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_mmc_cd>;
++ vmmc-supply = <&reg_3v3_mmc>;
++ status = "okay";
++};
++
++/* SD1 */
++&usdhc2 {
++ cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
++ pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_sd_cd>;
++ vmmc-supply = <&reg_3v3_sd>;
++ status = "okay";
++};
++
++&iomuxc {
++ pinctrl_enable_3v3_mmc: enable3v3mmcgrp {
++ fsl,pins = <
++ /* MMC1_PWR_CTRL */
++ MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x1b0b0
++ >;
++ };
++
++ pinctrl_enable_3v3_sd: enable3v3sdgrp {
++ fsl,pins = <
++ /* SD1_PWR_CTRL */
++ MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
++ >;
++ };
++
++ pinctrl_enable_can1_power: enablecan1powergrp {
++ fsl,pins = <
++ /* CAN1_PWR_EN */
++ MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0
++ >;
++ };
++
++ pinctrl_enable_can2_power: enablecan2powergrp {
++ fsl,pins = <
++ /* CAN2_PWR_EN */
++ MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
++ >;
++ };
++
++ pinctrl_nau8822: nau8822grp {
++ fsl,pins = <
++ MX6QDL_PAD_DISP0_DAT16__AUD5_TXC 0x130b0
++ MX6QDL_PAD_DISP0_DAT17__AUD5_TXD 0x130b0
++ MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS 0x130b0
++ MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x130b0
++ >;
++ };
++};
+diff --git a/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dts b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dts
+index 3fc079dfd61ee..e1077e2da5f42 100644
+--- a/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dts
++++ b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dts
+@@ -7,29 +7,13 @@
+
+ /dts-v1/;
+
+-#include <dt-bindings/gpio/gpio.h>
+-#include <dt-bindings/input/input.h>
+-#include <dt-bindings/interrupt-controller/irq.h>
+-#include "imx6q.dtsi"
+-#include "imx6qdl-apalis.dtsi"
++#include "imx6q-apalis-eval.dtsi"
+
+ / {
+ model = "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board";
+ compatible = "toradex,apalis_imx6q-eval", "toradex,apalis_imx6q",
+ "fsl,imx6q";
+
+- aliases {
+- i2c0 = &i2c1;
+- i2c1 = &i2c3;
+- i2c2 = &i2c2;
+- rtc0 = &rtc_i2c;
+- rtc1 = &snvs_rtc;
+- };
+-
+- chosen {
+- stdout-path = "serial0:115200n8";
+- };
+-
+ reg_pcie_switch: regulator-pcie-switch {
+ compatible = "regulator-fixed";
+ enable-active-high;
+@@ -40,14 +24,6 @@ reg_pcie_switch: regulator-pcie-switch {
+ startup-delay-us = <100000>;
+ status = "okay";
+ };
+-
+- reg_3v3_sw: regulator-3v3-sw {
+- compatible = "regulator-fixed";
+- regulator-always-on;
+- regulator-max-microvolt = <3300000>;
+- regulator-min-microvolt = <3300000>;
+- regulator-name = "3.3V_SW";
+- };
+ };
+
+ &can1 {
+@@ -62,102 +38,22 @@ &can2 {
+
+ /* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
+ &i2c1 {
+- status = "okay";
+-
++ /* PCIe Switch */
+ pcie-switch@58 {
+ compatible = "plx,pex8605";
+ reg = <0x58>;
+ };
+-
+- /* M41T0M6 real time clock on carrier board */
+- rtc_i2c: rtc@68 {
+- compatible = "st,m41t0";
+- reg = <0x68>;
+- };
+-};
+-
+-/*
+- * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier
+- * board)
+- */
+-&i2c3 {
+- status = "okay";
+ };
+
+ &pcie {
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_reset_moci>;
+- /* active-high meaning opposite of regular PERST# active-low polarity */
+- reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
+- reset-gpio-active-high;
+ vpcie-supply = <&reg_pcie_switch>;
+ status = "okay";
+ };
+
+-&pwm1 {
+- status = "okay";
+-};
+-
+-&pwm2 {
+- status = "okay";
+-};
+-
+-&pwm3 {
+- status = "okay";
+-};
+-
+-&pwm4 {
+- status = "okay";
+-};
+-
+-&reg_usb_host_vbus {
+- status = "okay";
+-};
+-
+-&reg_usb_otg_vbus {
+- status = "okay";
+-};
+-
+-&sata {
+- status = "okay";
+-};
+-
+ &sound_spdif {
+ status = "okay";
+ };
+
+-&spdif {
+- status = "okay";
+-};
+-
+-&uart1 {
+- status = "okay";
+-};
+-
+-&uart2 {
+- status = "okay";
+-};
+-
+-&uart4 {
+- status = "okay";
+-};
+-
+-&uart5 {
+- status = "okay";
+-};
+-
+-&usbh1 {
+- disable-over-current;
+- vbus-supply = <&reg_usb_host_vbus>;
+- status = "okay";
+-};
+-
+-&usbotg {
+- disable-over-current;
+- vbus-supply = <&reg_usb_otg_vbus>;
+- status = "okay";
+-};
+-
+ /* MMC1 */
+ &usdhc1 {
+ status = "okay";
+diff --git a/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dtsi b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dtsi
+new file mode 100644
+index 0000000000000..b6c45ad3f4304
+--- /dev/null
++++ b/arch/arm/boot/dts/nxp/imx/imx6q-apalis-eval.dtsi
+@@ -0,0 +1,120 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright 2014-2024 Toradex
++ */
++
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/interrupt-controller/irq.h>
++#include "imx6q.dtsi"
++#include "imx6qdl-apalis.dtsi"
++
++/ {
++ aliases {
++ i2c0 = &i2c1;
++ i2c1 = &i2c3;
++ i2c2 = &i2c2;
++ rtc0 = &rtc_i2c;
++ rtc1 = &snvs_rtc;
++ };
++
++ chosen {
++ stdout-path = "serial0:115200n8";
++ };
++
++ reg_3v3_sw: regulator-3v3-sw {
++ compatible = "regulator-fixed";
++ regulator-always-on;
++ regulator-max-microvolt = <3300000>;
++ regulator-min-microvolt = <3300000>;
++ regulator-name = "3.3V_SW";
++ };
++};
++
++&i2c1 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "okay";
++
++ /* M41T0M6 real time clock on carrier board */
++ rtc_i2c: rtc@68 {
++ compatible = "st,m41t0";
++ reg = <0x68>;
++ };
++};
++
++/*
++ * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier
++ * board)
++ */
++&i2c3 {
++ status = "okay";
++};
++
++&pcie {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_reset_moci>;
++ /* active-high meaning opposite of regular PERST# active-low polarity */
++ reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
++ reset-gpio-active-high;
++};
++
++&pwm1 {
++ status = "okay";
++};
++
++&pwm2 {
++ status = "okay";
++};
++
++&pwm3 {
++ status = "okay";
++};
++
++&pwm4 {
++ status = "okay";
++};
++
++&reg_usb_host_vbus {
++ status = "okay";
++};
++
++&reg_usb_otg_vbus {
++ status = "okay";
++};
++
++&sata {
++ status = "okay";
++};
++
++&spdif {
++ status = "okay";
++};
++
++&uart1 {
++ status = "okay";
++};
++
++&uart2 {
++ status = "okay";
++};
++
++&uart4 {
++ status = "okay";
++};
++
++&uart5 {
++ status = "okay";
++};
++
++&usbh1 {
++ disable-over-current;
++ vbus-supply = <&reg_usb_host_vbus>;
++ status = "okay";
++};
++
++&usbotg {
++ disable-over-current;
++ vbus-supply = <&reg_usb_otg_vbus>;
++ status = "okay";
++};
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx6qdl-colibri-Add-usdhc-aliases.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx6qdl-colibri-Add-usdhc-aliases.patch
new file mode 100644
index 0000000..8923abb
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-ARM-dts-imx6qdl-colibri-Add-usdhc-aliases.patch
@@ -0,0 +1,38 @@
+From 0fd10dbe5a88a882340d604bf55affeb7dbe03b7 Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Mon, 20 Nov 2023 21:58:17 +0100
+Subject: [PATCH 2/3] ARM: dts: imx6qdl-colibri: Add usdhc aliases
+
+Add mmc aliases to ensure a consistent mmc device naming across the
+Toradex SoM family, with this commit mmc0 is the on-module eMMC
+boot device and the not available mmc interfaces are removed.
+
+Upstream-Status: Backport [265f56542a936fa2edac21ee2cd45f0d331707a6]
+
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ arch/arm/boot/dts/nxp/imx/imx6qdl-colibri.dtsi | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl-colibri.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl-colibri.dtsi
+index 11d9c7a2dacb1..55c90f6393ad5 100644
+--- a/arch/arm/boot/dts/nxp/imx/imx6qdl-colibri.dtsi
++++ b/arch/arm/boot/dts/nxp/imx/imx6qdl-colibri.dtsi
+@@ -12,6 +12,13 @@ / {
+ model = "Toradex Colibri iMX6DL/S Module";
+ compatible = "toradex,colibri_imx6dl", "fsl,imx6dl";
+
++ aliases {
++ mmc0 = &usdhc3; /* eMMC */
++ mmc1 = &usdhc1; /* MMC/SD Slot */
++ /delete-property/ mmc2;
++ /delete-property/ mmc3;
++ };
++
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ brightness-levels = <0 45 63 88 119 158 203 255>;
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch
new file mode 100644
index 0000000..10ecd8f
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch
@@ -0,0 +1,61 @@
+From fdd0972a24818dc336b2235ce93000ee7b88240e Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Thu, 1 Sep 2022 14:04:50 +0200
+Subject: [PATCH 2/4] Revert "drm/panel-simple: drop use of data-mapping
+ property"
+
+This reverts commit d021d751c14752a0266865700f6f212fab40a18c.
+
+Re-enable the data-mapping property which was already used in the
+5.4-2.3.0 downstream kernel.
+
+In addition to the revert set bpc from the data-mapping value
+as a WARN_ON is printed if missing.
+In addition to the revert have mapping pointing to the empty string to
+prevent a kernel panic if data-mapping can not be read from the dt and
+then an uninitialized pointer is used in strcmp.
+
+Upstream-Status: Denied [Alternative solution being discused]
+https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ drivers/gpu/drm/panel/panel-simple.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
+index 95959dcc6e0e..4518eb5d7acb 100644
+--- a/drivers/gpu/drm/panel/panel-simple.c
++++ b/drivers/gpu/drm/panel/panel-simple.c
+@@ -464,6 +464,7 @@ static int panel_dpi_probe(struct device *dev,
+ struct panel_desc *desc;
+ unsigned int bus_flags;
+ struct videomode vm;
++ const char *mapping = "";
+ int ret;
+
+ np = dev->of_node;
+@@ -488,6 +489,21 @@ static int panel_dpi_probe(struct device *dev,
+ of_property_read_u32(np, "width-mm", &desc->size.width);
+ of_property_read_u32(np, "height-mm", &desc->size.height);
+
++ of_property_read_string(np, "data-mapping", &mapping);
++ if (!strcmp(mapping, "rgb24")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
++ desc->bpc = 8;
++ } else if (!strcmp(mapping, "rgb565")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
++ desc->bpc = 6;
++ } else if (!strcmp(mapping, "bgr666")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
++ desc->bpc = 6;
++ } else if (!strcmp(mapping, "lvds666")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
++ desc->bpc = 6;
++ }
++
+ /* Extract bus_flags from display_timing */
+ bus_flags = 0;
+ vm.flags = timing->flags;
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-imx8mp-verdin-dahlia-support-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-imx8mp-verdin-dahlia-support-.patch
new file mode 100644
index 0000000..ac9e06c
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-imx8mp-verdin-dahlia-support-.patch
@@ -0,0 +1,99 @@
+From 9a7d42b76d21916d2eef2dfd6d61a7bdde97fb2b Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 12 Jan 2024 16:12:14 +0100
+Subject: [PATCH v1 2/4] arm64: dts: freescale: imx8mp-verdin-dahlia: support
+ sleep-moci
+
+Previously, we had the sleep-moci pin set to always on. However, the
+Dahlia carrier board supports disabling the sleep-moci when the system
+is suspended to power down peripherals that support it. This reduces
+overall power consumption. This commit adds support for this feature by
+disabling the reg_force_sleep_moci regulator and adding two new
+regulators for the USB hub and PCIe that can be turned off when the
+system is suspended.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240405160720.5977-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ .../dts/freescale/imx8mp-verdin-dahlia.dtsi | 44 +++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
+index e68e0e6f21e9..abad1887040a 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi
+@@ -32,6 +32,25 @@ simple-audio-card,cpu {
+ sound-dai = <&sai1>;
+ };
+ };
++
++ reg_usb_hub: regulator-usb-hub {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
++ regulator-boot-on;
++ regulator-name = "HUB_PWR_EN";
++ };
++
++ reg_pcie: regulator-pcie {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
++ regulator-boot-on;
++ regulator-name = "PCIE_1_PWR_EN";
++ startup-delay-us = <100000>;
++ };
+ };
+
+ &backlight {
+@@ -117,6 +136,7 @@ wm8904_1a: audio-codec@1a {
+
+ /* Verdin PCIE_1 */
+ &pcie {
++ vpcie-supply = <&reg_pcie>;
+ status = "okay";
+ };
+
+@@ -143,6 +163,11 @@ &reg_usdhc2_vmmc {
+ vin-supply = <&reg_3p3v>;
+ };
+
++/* We support turning off sleep moci on Dahlia */
++&reg_force_sleep_moci {
++ status = "disabled";
++};
++
+ /* Verdin I2S_1 */
+ &sai1 {
+ assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
+@@ -186,6 +211,25 @@ &usb3_phy1 {
+ status = "okay";
+ };
+
++&usb_dwc3_1 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ usb_hub_3_0: usb-hub@1 {
++ compatible = "usb424,5744";
++ reg = <1>;
++ peer-hub = <&usb_hub_2_0>;
++ vdd-supply = <&reg_usb_hub>;
++ };
++
++ usb_hub_2_0: usb-hub@2 {
++ compatible = "usb424,2744";
++ reg = <2>;
++ peer-hub = <&usb_hub_3_0>;
++ vdd-supply = <&reg_usb_hub>;
++ };
++};
++
+ /* Verdin SD_1 */
+ &usdhc2 {
+ status = "okay";
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch
new file mode 100644
index 0000000..95c8ea4
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch
@@ -0,0 +1,273 @@
+From 4d6ab01eaa1065bda3446736d265f113ca168c02 Mon Sep 17 00:00:00 2001
+From: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+Date: Fri, 1 Dec 2023 16:07:33 +0100
+Subject: [PATCH 2/2] arm64: dts: freescale: verdin-imx8mm: add support to
+ mallow board
+
+Add Toradex Verdin IMX8MM Mallow carrier board support. Mallow is a
+low-cost carrier board in the Verdin family with a small form factor and
+build for volume production making it ideal for industrial and embedded
+applications.
+
+https://www.toradex.com/products/carrier-board/mallow-carrier-board
+
+Upstream-Status: Backport [eb9348865fabe4e0bc0b0453813dba8ecbfd9deb]
+
+Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ arch/arm64/boot/dts/freescale/Makefile | 2 +
+ .../dts/freescale/imx8mm-verdin-mallow.dtsi | 173 ++++++++++++++++++
+ .../imx8mm-verdin-nonwifi-mallow.dts | 18 ++
+ .../freescale/imx8mm-verdin-wifi-mallow.dts | 18 ++
+ 4 files changed, 211 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-verdin-mallow.dtsi
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-mallow.dts
+ create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-mallow.dts
+
+diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
+index 89aee6c925760..2c2a76dff875d 100644
+--- a/arch/arm64/boot/dts/freescale/Makefile
++++ b/arch/arm64/boot/dts/freescale/Makefile
+@@ -79,9 +79,11 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7904.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7905-0x.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-dahlia.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-dev.dtb
++dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-mallow.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-nonwifi-yavia.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-dahlia.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-dev.dtb
++dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-mallow.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mm-verdin-wifi-yavia.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mn-beacon-kit.dtb
+ dtb-$(CONFIG_ARCH_MXC) += imx8mn-bsh-smm-s2.dtb
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-mallow.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-mallow.dtsi
+new file mode 100644
+index 0000000000000..4a0799d63446c
+--- /dev/null
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-mallow.dtsi
+@@ -0,0 +1,173 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright 2023 Toradex
++ *
++ * Common dtsi for Verdin IMX8MM SoM on Mallow carrier board
++ *
++ * https://www.toradex.com/computer-on-modules/verdin-arm-family/nxp-imx-8m-mini-nano
++ * https://www.toradex.com/products/carrier-board/mallow-carrier-board
++ */
++
++#include <dt-bindings/leds/common.h>
++
++/ {
++ leds {
++ compatible = "gpio-leds";
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_leds>;
++
++ /* SODIMM 52 - USER_LED_1_RED */
++ led-0 {
++ color = <LED_COLOR_ID_RED>;
++ function = LED_FUNCTION_DEBUG;
++ function-enumerator = <1>;
++ gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
++ };
++
++ /* SODIMM 54 - USER_LED_1_GREEN */
++ led-1 {
++ color = <LED_COLOR_ID_GREEN>;
++ function = LED_FUNCTION_DEBUG;
++ function-enumerator = <1>;
++ gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
++ };
++
++ /* SODIMM 56 - USER_LED_2_RED */
++ led-2 {
++ color = <LED_COLOR_ID_RED>;
++ function = LED_FUNCTION_DEBUG;
++ function-enumerator = <2>;
++ gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>;
++ };
++
++ /* SODIMM 58 - USER_LED_2_GREEN */
++ led-3 {
++ color = <LED_COLOR_ID_GREEN>;
++ function = LED_FUNCTION_DEBUG;
++ function-enumerator = <2>;
++ gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>;
++ };
++ };
++};
++
++/* Verdin SPI_1 */
++&ecspi2 {
++ pinctrl-0 = <&pinctrl_ecspi2>, <&pinctrl_tpm_cs>;
++ cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>, <&gpio3 2 GPIO_ACTIVE_LOW>;
++ status = "okay";
++
++ tpm@1 {
++ compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
++ reg = <1>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_tpm_irq>;
++ interrupt-parent = <&gpio3>;
++ interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
++ spi-max-frequency = <18500000>;
++ };
++};
++
++/* EEPROM on Mallow */
++&eeprom_carrier_board {
++ status = "okay";
++};
++
++/* Verdin ETH_1 */
++&fec1 {
++ status = "okay";
++};
++
++/* Temperature sensor on Mallow */
++&hwmon_temp {
++ compatible = "ti,tmp1075";
++ status = "okay";
++};
++
++/* Verdin I2C_2_DSI */
++&i2c2 {
++ status = "okay";
++};
++
++/* Verdin I2C_4_CSI */
++&i2c3 {
++ status = "okay";
++};
++
++/* Verdin I2C_1 */
++&i2c4 {
++ status = "okay";
++};
++
++/* Verdin PCIE_1 */
++&pcie0 {
++ status = "okay";
++};
++
++&pcie_phy {
++ status = "okay";
++};
++
++/* Verdin PWM_3_DSI */
++&pwm1 {
++ status = "okay";
++};
++
++/* Verdin PWM_1 */
++&pwm2 {
++ status = "okay";
++};
++
++/* Verdin PWM_2 */
++&pwm3 {
++ status = "okay";
++};
++
++/* Verdin UART_3 */
++&uart1 {
++ status = "okay";
++};
++
++/* Verdin UART_1 */
++&uart2 {
++ status = "okay";
++};
++
++/* Verdin UART_2 */
++&uart3 {
++ status = "okay";
++};
++
++/* Verdin USB_1 */
++&usbotg1 {
++ status = "okay";
++};
++
++/* Verdin USB_2 */
++&usbotg2 {
++ status = "okay";
++};
++
++/* Verdin SD_1 */
++&usdhc2 {
++ status = "okay";
++};
++
++&iomuxc {
++ pinctrl_leds: ledsgrp {
++ fsl,pins =
++ <MX8MM_IOMUXC_NAND_ALE_GPIO3_IO0 0x106>, /* SODIMM 52 */
++ <MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x106>, /* SODIMM 54 */
++ <MX8MM_IOMUXC_NAND_DATA00_GPIO3_IO6 0x106>, /* SODIMM 56 */
++ <MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7 0x106>; /* SODIMM 58 */
++ };
++
++ pinctrl_tpm_cs: tpmcsgrp {
++ fsl,pins =
++ <MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x146>; /* SODIMM 64 */
++ };
++
++ pinctrl_tpm_irq: tpmirqgrp {
++ fsl,pins =
++ <MX8MM_IOMUXC_NAND_DQS_GPIO3_IO14 0x141>; /* SODIMM 66 */
++ };
++};
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-mallow.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-mallow.dts
+new file mode 100644
+index 0000000000000..1b1999f3a80e8
+--- /dev/null
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-nonwifi-mallow.dts
+@@ -0,0 +1,18 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright 2023 Toradex
++ */
++
++/dts-v1/;
++
++#include "imx8mm-verdin.dtsi"
++#include "imx8mm-verdin-nonwifi.dtsi"
++#include "imx8mm-verdin-mallow.dtsi"
++
++/ {
++ model = "Toradex Verdin iMX8M Mini on Mallow";
++ compatible = "toradex,verdin-imx8mm-nonwifi-mallow",
++ "toradex,verdin-imx8mm-nonwifi",
++ "toradex,verdin-imx8mm",
++ "fsl,imx8mm";
++};
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-mallow.dts b/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-mallow.dts
+new file mode 100644
+index 0000000000000..2916145f31bbe
+--- /dev/null
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-wifi-mallow.dts
+@@ -0,0 +1,18 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright 2023 Toradex
++ */
++
++/dts-v1/;
++
++#include "imx8mm-verdin.dtsi"
++#include "imx8mm-verdin-wifi.dtsi"
++#include "imx8mm-verdin-mallow.dtsi"
++
++/ {
++ model = "Toradex Verdin iMX8M Mini WB on Mallow";
++ compatible = "toradex,verdin-imx8mm-wifi-mallow",
++ "toradex,verdin-imx8mm-wifi",
++ "toradex,verdin-imx8mm",
++ "fsl,imx8mm";
++};
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-ti-k3-am62-verdin-dahlia-support-sleep-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-ti-k3-am62-verdin-dahlia-support-sleep-.patch
new file mode 100644
index 0000000..9f02980
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-arm64-dts-ti-k3-am62-verdin-dahlia-support-sleep-.patch
@@ -0,0 +1,70 @@
+From ae6bfe80045f0b01b352dc03ff99c9afdcaff98b Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 26 Jan 2024 13:58:53 +0100
+Subject: [PATCH v1 2/2] arm64: dts: ti: k3-am62-verdin-dahlia: support
+ sleep-moci
+
+Previously, we had the sleep-moci pin set to always on. However, the
+Dahlia carrier board supports disabling the sleep-moci when the system
+is suspended to power down peripherals that support it. This reduces
+overall power consumption. This commit adds support for this feature by
+disabling the reg_force_sleep_moci regulator and adding a new regulator
+for the USB hub that can be turned off when the system is suspended.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240301084901.16656-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ .../boot/dts/ti/k3-am62-verdin-dahlia.dtsi | 22 +++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
+index bf6d27e70bc4..bb066e726527 100644
+--- a/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
++++ b/arch/arm64/boot/dts/ti/k3-am62-verdin-dahlia.dtsi
+@@ -43,6 +43,15 @@ simple-audio-card,cpu {
+ sound-dai = <&mcasp0>;
+ };
+ };
++
++ reg_usb_hub: regulator-usb-hub {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&main_gpio0 31 GPIO_ACTIVE_HIGH>;
++ regulator-boot-on;
++ regulator-name = "HUB_PWR_EN";
++ };
+ };
+
+ /* Verdin ETHs */
+@@ -183,6 +192,11 @@ &ospi0 {
+ status = "okay";
+ };
+
++/* Do not force CTRL_SLEEP_MOCI# always enabled */
++&reg_force_sleep_moci {
++ status = "disabled";
++};
++
+ /* Verdin SD_1 */
+ &sdhci1 {
+ ti,driver-strength-ohm = <33>;
+@@ -204,7 +218,15 @@ &usbss1 {
+ };
+
+ &usb1 {
++ #address-cells = <1>;
++ #size-cells = <0>;
+ status = "okay";
++
++ usb-hub@1 {
++ compatible = "usb424,2744";
++ reg = <1>;
++ vdd-supply = <&reg_usb_hub>;
++ };
+ };
+
+ /* Verdin CTRL_WAKE1_MICO# */
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-drm-bridge-lt8912b-Add-power-supplies.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-drm-bridge-lt8912b-Add-power-supplies.patch
new file mode 100644
index 0000000..e4a81b3
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-drm-bridge-lt8912b-Add-power-supplies.patch
@@ -0,0 +1,92 @@
+From f6d8a80f1d10ff01cff3ac26e242165a270bbbad Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Wed, 15 Nov 2023 13:13:38 +0100
+Subject: [PATCH] drm/bridge: lt8912b: Add power supplies
+
+Add supplies to the driver that can be used to turn the Lontium lt8912b
+on and off. It can have up to 7 independent supplies, we add them all
+and enable/disable them with bulk_enable/disable.
+
+Upstream-Status: Backport [f168c7f7d1a0cb12a4888af9f3f907139372f137]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Reviewed-by: Robert Foss <rfoss@kernel.org>
+Signed-off-by: Robert Foss <rfoss@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231115121338.22959-4-francesco@dolcini.it
+---
+ drivers/gpu/drm/bridge/lontium-lt8912b.c | 30 ++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
+index 097ab04234b7..273157428c82 100644
+--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
++++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
+@@ -43,6 +43,8 @@ struct lt8912 {
+
+ struct videomode mode;
+
++ struct regulator_bulk_data supplies[7];
++
+ u8 data_lanes;
+ bool is_power_on;
+ };
+@@ -257,6 +259,12 @@ static int lt8912_free_i2c(struct lt8912 *lt)
+
+ static int lt8912_hard_power_on(struct lt8912 *lt)
+ {
++ int ret;
++
++ ret = regulator_bulk_enable(ARRAY_SIZE(lt->supplies), lt->supplies);
++ if (ret)
++ return ret;
++
+ gpiod_set_value_cansleep(lt->gp_reset, 0);
+ msleep(20);
+
+@@ -267,6 +275,9 @@ static void lt8912_hard_power_off(struct lt8912 *lt)
+ {
+ gpiod_set_value_cansleep(lt->gp_reset, 1);
+ msleep(20);
++
++ regulator_bulk_disable(ARRAY_SIZE(lt->supplies), lt->supplies);
++
+ lt->is_power_on = false;
+ }
+
+@@ -661,6 +672,21 @@ static int lt8912_bridge_suspend(struct device *dev)
+
+ static DEFINE_SIMPLE_DEV_PM_OPS(lt8912_bridge_pm_ops, lt8912_bridge_suspend, lt8912_bridge_resume);
+
++static int lt8912_get_regulators(struct lt8912 *lt)
++{
++ unsigned int i;
++ const char * const supply_names[] = {
++ "vdd", "vccmipirx", "vccsysclk", "vcclvdstx",
++ "vcchdmitx", "vcclvdspll", "vcchdmipll"
++ };
++
++ for (i = 0; i < ARRAY_SIZE(lt->supplies); i++)
++ lt->supplies[i].supply = supply_names[i];
++
++ return devm_regulator_bulk_get(lt->dev, ARRAY_SIZE(lt->supplies),
++ lt->supplies);
++}
++
+ static int lt8912_parse_dt(struct lt8912 *lt)
+ {
+ struct gpio_desc *gp_reset;
+@@ -712,6 +738,10 @@ static int lt8912_parse_dt(struct lt8912 *lt)
+ goto err_free_host_node;
+ }
+
++ ret = lt8912_get_regulators(lt);
++ if (ret)
++ goto err_free_host_node;
++
+ of_node_put(port_node);
+ return 0;
+
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch
new file mode 100644
index 0000000..f42a3ca
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch
@@ -0,0 +1,103 @@
+From 7db43d423bda4566732b04a2535346c5eaea0be1 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 6 Oct 2023 10:04:26 -0300
+Subject: [PATCH 2/4] power: reset: gpio-poweroff: use sys-off handler API
+
+Use the new sys-off handler API for gpio-poweroff. This allows us to
+have more than one poweroff handler and prioritise them.
+
+Upstream-Status: Backport [b16d9f49735f3d26e23f0ba4a2cf21668fc6b66]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Link: https://lore.kernel.org/r/20231006130428.11259-3-francesco@dolcini.it
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+---
+ drivers/power/reset/gpio-poweroff.c | 37 ++++++++++-------------------
+ 1 file changed, 12 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
+index dea550e422f3c..0deb293eb2d66 100644
+--- a/drivers/power/reset/gpio-poweroff.c
++++ b/drivers/power/reset/gpio-poweroff.c
+@@ -15,6 +15,7 @@
+ #include <linux/gpio/consumer.h>
+ #include <linux/mod_devicetable.h>
+ #include <linux/module.h>
++#include <linux/reboot.h>
+
+ #define DEFAULT_TIMEOUT_MS 3000
+
+@@ -25,15 +26,9 @@ struct gpio_poweroff {
+ u32 inactive_delay_ms;
+ };
+
+-/*
+- * Hold configuration here, cannot be more than one instance of the driver
+- * since pm_power_off itself is global.
+- */
+-static struct gpio_poweroff *gpio_poweroff;
+-
+-static void gpio_poweroff_do_poweroff(void)
++static int gpio_poweroff_do_poweroff(struct sys_off_data *data)
+ {
+- BUG_ON(!gpio_poweroff);
++ struct gpio_poweroff *gpio_poweroff = data->cb_data;
+
+ /* drive it active, also inactive->active edge */
+ gpiod_direction_output(gpio_poweroff->reset_gpio, 1);
+@@ -50,20 +45,16 @@ static void gpio_poweroff_do_poweroff(void)
+ mdelay(gpio_poweroff->timeout_ms);
+
+ WARN_ON(1);
++
++ return NOTIFY_DONE;
+ }
+
+ static int gpio_poweroff_probe(struct platform_device *pdev)
+ {
++ struct gpio_poweroff *gpio_poweroff;
+ bool input = false;
+ enum gpiod_flags flags;
+-
+- /* If a pm_power_off function has already been added, leave it alone */
+- if (pm_power_off != NULL) {
+- dev_err(&pdev->dev,
+- "%s: pm_power_off function already registered\n",
+- __func__);
+- return -EBUSY;
+- }
++ int ret;
+
+ gpio_poweroff = devm_kzalloc(&pdev->dev, sizeof(*gpio_poweroff), GFP_KERNEL);
+ if (!gpio_poweroff)
+@@ -89,14 +80,11 @@ static int gpio_poweroff_probe(struct platform_device *pdev)
+ if (IS_ERR(gpio_poweroff->reset_gpio))
+ return PTR_ERR(gpio_poweroff->reset_gpio);
+
+- pm_power_off = &gpio_poweroff_do_poweroff;
+- return 0;
+-}
+-
+-static int gpio_poweroff_remove(struct platform_device *pdev)
+-{
+- if (pm_power_off == &gpio_poweroff_do_poweroff)
+- pm_power_off = NULL;
++ ret = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF,
++ SYS_OFF_PRIO_DEFAULT, gpio_poweroff_do_poweroff,
++ gpio_poweroff);
++ if (ret)
++ return dev_err_probe(&pdev->dev, ret, "Cannot register poweroff handler\n");
+
+ return 0;
+ }
+@@ -109,7 +97,6 @@ MODULE_DEVICE_TABLE(of, of_gpio_poweroff_match);
+
+ static struct platform_driver gpio_poweroff_driver = {
+ .probe = gpio_poweroff_probe,
+- .remove = gpio_poweroff_remove,
+ .driver = {
+ .name = "poweroff-gpio",
+ .of_match_table = of_gpio_poweroff_match,
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-ARM-dts-imx7d-colibri-emmc-Add-usdhc-aliases.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-ARM-dts-imx7d-colibri-emmc-Add-usdhc-aliases.patch
new file mode 100644
index 0000000..bdd44eb
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-ARM-dts-imx7d-colibri-emmc-Add-usdhc-aliases.patch
@@ -0,0 +1,35 @@
+From dfddfac32dd5854b2b05e66abbedbddf6814485f Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Mon, 20 Nov 2023 21:58:18 +0100
+Subject: [PATCH 3/3] ARM: dts: imx7d-colibri-emmc: Add usdhc aliases
+
+Add mmc aliases to ensure a consistent mmc device naming across the
+Toradex SoM family, with this commit mmc0 is the on-module eMMC
+boot device and the not available mmc interfaces are removed.
+
+Upstream-Status: Backport [d53314dd068e782ba0fa808405026f37dbedeb1e]
+
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Signed-off-by: Shawn Guo <shawnguo@kernel.org>
+---
+ arch/arm/boot/dts/nxp/imx/imx7d-colibri-emmc.dtsi | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/boot/dts/nxp/imx/imx7d-colibri-emmc.dtsi b/arch/arm/boot/dts/nxp/imx/imx7d-colibri-emmc.dtsi
+index 3740e34ef99f1..9670f45eab3ba 100644
+--- a/arch/arm/boot/dts/nxp/imx/imx7d-colibri-emmc.dtsi
++++ b/arch/arm/boot/dts/nxp/imx/imx7d-colibri-emmc.dtsi
+@@ -11,6 +11,10 @@ aliases {
+ /* Required to properly pass MAC addresses from bootloader. */
+ ethernet0 = &fec1;
+ ethernet1 = &fec2;
++ mmc0 = &usdhc3; /* eMMC */
++ mmc1 = &usdhc1; /* MMC/SD slot */
++ /delete-property/ mmc2;
++ /delete-property/ mmc3;
+ };
+
+ memory@80000000 {
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch
new file mode 100644
index 0000000..2fdde24
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch
@@ -0,0 +1,120 @@
+From dbe145ebf4edaec4bcd9cc632defe58dad030626 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 26 Jan 2024 13:37:52 +0100
+Subject: [PATCH v1 3/4] arm64: dts: freescale: imx8mm-verdin: replace
+ sleep-moci hog with regulator
+
+The Verdin family has a signal called sleep-moci which can be used to
+turn off peripherals on the carrier board when the SoM goes into
+suspend. So far we have hogged this signal, which means the peripherals
+are always on and it is not possible to add peripherals that depend on
+the sleep-moci to be on. With this change, we replace the hog with a
+regulator so that peripherals can add their own regulators that use the
+same gpio. Carrier boards that allow peripherals to be powered off in
+suspend can disable this regulator and implement their own regulator to
+control the sleep-moci.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240405160720.5977-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ .../dts/freescale/imx8mm-verdin-dahlia.dtsi | 5 ++++
+ .../boot/dts/freescale/imx8mm-verdin-dev.dtsi | 5 ++++
+ .../dts/freescale/imx8mm-verdin-yavia.dtsi | 5 ++++
+ .../boot/dts/freescale/imx8mm-verdin.dtsi | 26 ++++++++++++-------
+ 4 files changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
+index 1cff0b829357..b64dac4f29c2 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
+@@ -58,6 +58,11 @@ &flexspi {
+ status = "okay";
+ };
+
++&gpio5 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ /* Current measurement into module VCC */
+ &hwmon {
+ status = "okay";
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
+index 3c4b8ca125e3..95b7c9a03a23 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
+@@ -78,6 +78,11 @@ &i2c3 {
+ status = "okay";
+ };
+
++&gpio5 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ &gpio_expander_21 {
+ status = "okay";
+ };
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi
+index 1e28c78e381f..763f069e8405 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi
+@@ -81,6 +81,11 @@ &gpio3 {
+ pinctrl-0 = <&pinctrl_gpios_ext_yavia>;
+ };
+
++&gpio5 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
++};
++
+ &hwmon_temp {
+ status = "okay";
+ };
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
+index 6f0811587142..4768b05fd765 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
+@@ -110,6 +110,22 @@ reg_ethphy: regulator-ethphy {
+ startup-delay-us = <200000>;
+ };
+
++ /*
++ * By default we enable CTRL_SLEEP_MOCI#, this is required to have
++ * peripherals on the carrier board powered.
++ * If more granularity or power saving is required this can be disabled
++ * in the carrier board device tree files.
++ */
++ reg_force_sleep_moci: regulator-force-sleep-moci {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>;
++ regulator-always-on;
++ regulator-boot-on;
++ regulator-name = "CTRL_SLEEP_MOCI#";
++ };
++
+ reg_usb_otg1_vbus: regulator-usb-otg1 {
+ compatible = "regulator-fixed";
+ enable-active-high;
+@@ -333,16 +349,6 @@ &gpio5 {
+ "SODIMM_212",
+ "SODIMM_151",
+ "SODIMM_153";
+-
+- ctrl-sleep-moci-hog {
+- gpio-hog;
+- /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
+- gpios = <1 GPIO_ACTIVE_HIGH>;
+- line-name = "CTRL_SLEEP_MOCI#";
+- output-high;
+- pinctrl-names = "default";
+- pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+- };
+ };
+
+ /* On-module I2C */
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch
new file mode 100644
index 0000000..2544c32
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch
@@ -0,0 +1,45 @@
+From 30569e1ff44369f9d1aec5987cdcc0cedba7cc71 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 6 Oct 2023 10:04:27 -0300
+Subject: [PATCH 3/4] dt-bindings: power: reset: gpio-poweroff: Add priority
+ property
+
+Add the priority property to the gpio-poweroff bindings description.
+
+Upstream-Status: Backport [4ee17bd30788496a279ceaabc7ecaaf39f61cfc4]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Link: https://lore.kernel.org/r/20231006130428.11259-4-francesco@dolcini.it
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+---
+ .../devicetree/bindings/power/reset/gpio-poweroff.yaml | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
+index b54ec003a1e03..a4b437fce37cf 100644
+--- a/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
++++ b/Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml
+@@ -18,6 +18,9 @@ description: >
+ Finally the operating system assumes the power off failed if
+ the system is still running after waiting some time (timeout-ms).
+
++allOf:
++ - $ref: restart-handler.yaml#
++
+ properties:
+ compatible:
+ const: gpio-poweroff
+@@ -40,6 +43,9 @@ properties:
+ default: 100
+ description: Delay to wait after driving gpio inactive
+
++ priority:
++ default: 0
++
+ timeout-ms:
+ default: 3000
+ description: Time to wait before assuming the power off sequence failed.
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-arm64-dts-freescale-imx8mm-verdin-dahlia-support-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-arm64-dts-freescale-imx8mm-verdin-dahlia-support-.patch
new file mode 100644
index 0000000..7749b0e
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-arm64-dts-freescale-imx8mm-verdin-dahlia-support-.patch
@@ -0,0 +1,90 @@
+From fad8b15c2eabbded61c821a04238b5fa2fb596c9 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 26 Jan 2024 13:41:14 +0100
+Subject: [PATCH v1 4/4] arm64: dts: freescale: imx8mm-verdin-dahlia: support
+ sleep-moci
+
+Previously, we had the sleep-moci pin set to always on. However, the
+Dahlia carrier board supports disabling the sleep-moci when the system
+is suspended to power down peripherals that support it. This reduces
+overall power consumption. This commit adds support for this feature by
+disabling the reg_force_sleep_moci regulator and adding two new
+regulators for the USB hub and PCIe that can be turned off when the
+system is suspended.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20240405160720.5977-1-eichest@gmail.com/]
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+---
+ .../dts/freescale/imx8mm-verdin-dahlia.dtsi | 33 +++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
+index b64dac4f29c2..393fc9e20423 100644
+--- a/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
++++ b/arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
+@@ -32,6 +32,25 @@ simple-audio-card,cpu {
+ sound-dai = <&sai2>;
+ };
+ };
++
++ reg_usb_hub: regulator-usb-hub {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>;
++ regulator-boot-on;
++ regulator-name = "HUB_PWR_EN";
++ };
++
++ reg_pcie: regulator-pcie {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ /* Verdin CTRL_SLEEP_MOCI# (SODIMM 256) */
++ gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>;
++ regulator-boot-on;
++ regulator-name = "PCIE_1_PWR_EN";
++ startup-delay-us = <100000>;
++ };
+ };
+
+ /* Verdin SPI_1 */
+@@ -98,6 +117,7 @@ wm8904_1a: audio-codec@1a {
+
+ /* Verdin PCIE_1 */
+ &pcie0 {
++ vpcie-supply = <&reg_pcie>;
+ status = "okay";
+ };
+
+@@ -120,6 +140,11 @@ &pwm3 {
+ status = "okay";
+ };
+
++/* We support turning off sleep moci on Dahlia */
++&reg_force_sleep_moci {
++ status = "disabled";
++};
++
+ /* Verdin I2S_1 */
+ &sai2 {
+ status = "okay";
+@@ -148,8 +173,16 @@ &usbotg1 {
+
+ /* Verdin USB_2 */
+ &usbotg2 {
++ #address-cells = <1>;
++ #size-cells = <0>;
+ disable-over-current;
+ status = "okay";
++
++ usb-hub@1 {
++ compatible = "usb424,2744";
++ reg = <1>;
++ vdd-supply = <&reg_usb_hub>;
++ };
+ };
+
+ /* Verdin SD_1 */
+--
+2.40.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-media-i2c-ov5640-Implement-get_mbus_config.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-media-i2c-ov5640-Implement-get_mbus_config.patch
new file mode 100644
index 0000000..7205135
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-media-i2c-ov5640-Implement-get_mbus_config.patch
@@ -0,0 +1,54 @@
+From 3317d3298cd06213d457ad7090ec0fd56eefc5d2 Mon Sep 17 00:00:00 2001
+From: Aishwarya Kothari <aishwarya.kothari@toradex.com>
+Date: Wed, 25 Jan 2023 13:09:15 +0100
+Subject: [PATCH 4/4] media: i2c: ov5640: Implement get_mbus_config
+
+Implement the introduced get_mbus_config operation to report the
+config of the MIPI CSI-2, BT.656 and Parallel interface.
+
+Signed-off-by: Aishwarya Kothari <aishwarya.kothari@toradex.com>
+Upstream-Status: Submitted [https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/]
+---
+ drivers/media/i2c/ov5640.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
+index 5fe85aa2d2ec..8cb966fb1b79 100644
+--- a/drivers/media/i2c/ov5640.c
++++ b/drivers/media/i2c/ov5640.c
+@@ -3755,6 +3755,24 @@ static int ov5640_init_cfg(struct v4l2_subdev *sd,
+ return 0;
+ }
+
++static int ov5640_get_mbus_config(struct v4l2_subdev *sd,
++ unsigned int pad,
++ struct v4l2_mbus_config *cfg)
++{
++ struct ov5640_dev *sensor = to_ov5640_dev(sd);
++
++ cfg->type = sensor->ep.bus_type;
++ if (ov5640_is_csi2(sensor)) {
++ cfg->bus.mipi_csi2.num_data_lanes =
++ sensor->ep.bus.mipi_csi2.num_data_lanes;
++ cfg->bus.mipi_csi2.flags = sensor->ep.bus.mipi_csi2.flags;
++ } else {
++ cfg->bus.parallel.flags = sensor->ep.bus.parallel.flags;
++ }
++
++ return 0;
++}
++
+ static const struct v4l2_subdev_core_ops ov5640_core_ops = {
+ .log_status = v4l2_ctrl_subdev_log_status,
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+@@ -3775,6 +3793,7 @@ static const struct v4l2_subdev_pad_ops ov5640_pad_ops = {
+ .get_selection = ov5640_get_selection,
+ .enum_frame_size = ov5640_enum_frame_size,
+ .enum_frame_interval = ov5640_enum_frame_interval,
++ .get_mbus_config = ov5640_get_mbus_config,
+ };
+
+ static const struct v4l2_subdev_ops ov5640_subdev_ops = {
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch
new file mode 100644
index 0000000..6b94e1a
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-6.6/0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch
@@ -0,0 +1,54 @@
+From 0af4e07ee7510a04d0ba3fba26a0675068c43780 Mon Sep 17 00:00:00 2001
+From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Date: Fri, 6 Oct 2023 10:04:28 -0300
+Subject: [PATCH 4/4] power: reset: gpio-poweroff: make sys handler priority
+ configurable
+
+Add a priority property equal to gpio-restart to allow increasing the
+priority of the gpio-poweroff handler.
+
+Upstream-Status: Backport [d03d2a8cdefe86f04cfb53934a708620e7dfbfcb]
+
+Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+Link: https://lore.kernel.org/r/20231006130428.11259-5-francesco@dolcini.it
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+---
+ drivers/power/reset/gpio-poweroff.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
+index 0deb293eb2d66..52cfeee2cb284 100644
+--- a/drivers/power/reset/gpio-poweroff.c
++++ b/drivers/power/reset/gpio-poweroff.c
+@@ -54,6 +54,7 @@ static int gpio_poweroff_probe(struct platform_device *pdev)
+ struct gpio_poweroff *gpio_poweroff;
+ bool input = false;
+ enum gpiod_flags flags;
++ int priority = SYS_OFF_PRIO_DEFAULT;
+ int ret;
+
+ gpio_poweroff = devm_kzalloc(&pdev->dev, sizeof(*gpio_poweroff), GFP_KERNEL);
+@@ -75,14 +76,18 @@ static int gpio_poweroff_probe(struct platform_device *pdev)
+ device_property_read_u32(&pdev->dev, "inactive-delay-ms",
+ &gpio_poweroff->inactive_delay_ms);
+ device_property_read_u32(&pdev->dev, "timeout-ms", &gpio_poweroff->timeout_ms);
++ device_property_read_u32(&pdev->dev, "priority", &priority);
++ if (priority > 255) {
++ dev_err(&pdev->dev, "Invalid priority property: %u\n", priority);
++ return -EINVAL;
++ }
+
+ gpio_poweroff->reset_gpio = devm_gpiod_get(&pdev->dev, NULL, flags);
+ if (IS_ERR(gpio_poweroff->reset_gpio))
+ return PTR_ERR(gpio_poweroff->reset_gpio);
+
+ ret = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_POWER_OFF,
+- SYS_OFF_PRIO_DEFAULT, gpio_poweroff_do_poweroff,
+- gpio_poweroff);
++ priority, gpio_poweroff_do_poweroff, gpio_poweroff);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "Cannot register poweroff handler\n");
+
+--
+2.34.1
diff --git a/recipes-kernel/linux/linux-toradex-upstream-rt_6.6.bb b/recipes-kernel/linux/linux-toradex-upstream-rt_6.6.bb
new file mode 100644
index 0000000..e555ec9
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream-rt_6.6.bb
@@ -0,0 +1,16 @@
+LINUX_VERSION ?= "6.6.43-rt38"
+require recipes-kernel/linux/linux-toradex-upstream_6.6.bb
+
+SUMMARY = "Toradex mainline real-time Linux kernel"
+# To build the RT kernel we use the RT kernel git repo rather than applying
+# the RT patch on top of a vanilla kernel.
+
+LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git"
+
+# set PV manually, that way PREFERRED_VERSION can be set to a constant value
+PV = "6.6"
+KBRANCH = "v6.6-rt"
+SRCREV_machine = "3adbcdc26bf4773f6871f705fe440b9c5c4cd7db"
+SRCREV_machine:use-head-next = "${AUTOREV}"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
diff --git a/recipes-kernel/linux/linux-toradex-upstream.inc b/recipes-kernel/linux/linux-toradex-upstream.inc
new file mode 100644
index 0000000..7c60410
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream.inc
@@ -0,0 +1,51 @@
+SUMMARY = "Toradex mainline Linux kernel"
+SECTION = "kernel"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex-upstream:"
+
+DEPENDS += "coreutils-native"
+
+# yaml and dtschema are required for 5.16+ device tree validation, libyaml is checked
+# via pkgconfig, so must always be present, but we can wrap the others to make them
+# conditional
+DEPENDS += "libyaml-native"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[dt-validation] = ",,python3-dtschema-native"
+# we need the wrappers if validation isn't in the packageconfig
+DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'dt-validation', '', 'python3-dtschema-wrapper-native', d)}"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = " \
+ ${LINUX_REPO};protocol=https;branch=${KBRANCH};name=machine \
+ ${KCONFIG_REPO};protocol=https;type=kmeta;name=meta-toradex-bsp;branch=main;destsuffix=${KMETA} \
+ ${TDX_PATCHES} \
+"
+
+KCONFIG_REPO = "git://git.toradex.com/linux-toradex-kconfig.git"
+KMETA = "kernel-meta-toradex-bsp"
+
+SRCREV_meta-toradex-bsp = "8f2af3d813636cb60c9c532255ab4d5409704b1f"
+SRCREV_meta-toradex-bsp:use-head-next = "${AUTOREV}"
+
+KERNEL_VERSION_SANITY_SKIP = "1"
+
+S = "${WORKDIR}/git"
+
+KCONFIG_MODE="--alldefconfig"
+
+# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS)
+KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}"
+
+inherit kernel-yocto kernel pkgconfig toradex-kernel-deploy-config toradex-kernel-localversion
+
+# Additional file deployed by recent mainline kernels
+FILES:${KERNEL_PACKAGE_NAME}-base += "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo"
+
+export DTC_FLAGS = "-@"
+
+# kconfiglib.KconfigError: init/Kconfig:70: error: couldn't parse 'default $(shell,$(srctree)/scripts/rust-version.sh $(RUSTC))': macro expanded to blank string
+do_kernel_configcheck[noexec] = "1"
diff --git a/recipes-kernel/linux/linux-toradex-upstream/0001-thermal-imx-Update-critical-temp-threshold.patch b/recipes-kernel/linux/linux-toradex-upstream/0001-thermal-imx-Update-critical-temp-threshold.patch
new file mode 100644
index 0000000..c09abb9
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream/0001-thermal-imx-Update-critical-temp-threshold.patch
@@ -0,0 +1,40 @@
+From 212abec626e1c82616a1cf6e492e467cf79aef23 Mon Sep 17 00:00:00 2001
+From: Francesco Dolcini <francesco.dolcini@toradex.com>
+Date: Wed, 20 Apr 2022 11:13:00 +0200
+Subject: [PATCH 1/4] thermal: imx: Update critical temp threshold
+
+Increase the critical temperature threshold to the datasheet defined
+value according to the temperature grade of the SoC, increasing the
+actual critical temperature value of 5 degrees.
+
+Without this change the emergency shutdown will trigger earlier then
+required affecting applications that are expected to be working on this
+close to the limit, but yet valid, temperature range.
+
+Upstream-Status: Denied [https://lore.kernel.org/all/20220420091300.179753-1-francesco.dolcini@toradex.com/]
+Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
+---
+ drivers/thermal/imx_thermal.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
+index 826358cbe810..4fcbf15b2768 100644
+--- a/drivers/thermal/imx_thermal.c
++++ b/drivers/thermal/imx_thermal.c
+@@ -458,11 +458,11 @@ static void imx_init_temp_grade(struct platform_device *pdev, u32 ocotp_mem0)
+ }
+
+ /*
+- * Set the critical trip point at 5 °C under max
++ * Set the critical trip point at max
+ * Set the passive trip point at 10 °C under max (changeable via sysfs)
+ */
+ trips[IMX_TRIP_PASSIVE].temperature = data->temp_max - (1000 * 10);
+- trips[IMX_TRIP_CRITICAL].temperature = data->temp_max - (1000 * 5);
++ trips[IMX_TRIP_CRITICAL].temperature = data->temp_max;
+ }
+
+ static int imx_init_from_tempmon_data(struct platform_device *pdev)
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch b/recipes-kernel/linux/linux-toradex-upstream/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch
new file mode 100644
index 0000000..dfdd723
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream/0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch
@@ -0,0 +1,68 @@
+From 2147c8ddfaa746cdb8857db070f907fa9abfcb60 Mon Sep 17 00:00:00 2001
+From: Hiago De Franco <hiago.franco@toradex.com>
+Date: Tue, 19 Dec 2023 11:52:07 -0300
+Subject: [PATCH] usb: gadget: f_ncm: Apply workaround for packet clogging
+
+The existing size of 32 is causing significant slowness and freezing when
+utilizing the NCM protocol with a VNC client. This issue likely arises
+because the VNC protocol relies on sending numerous small packets, which
+accumulate until the 16KB limit is reached, leading to transmission
+delays.
+
+By decreasing TX_MAX_NUM_DPE to 4, we ensure that the NCM driver transmits
+packets at a reduced interval, thereby resolving the VNC performance
+issues. To comprehend how these packets are sent, refer to the code
+snippet below from f_ncm.c:
+
+```
+ /* If the new skb is too big for the current NCM NTB then
+ * set the current stored skb to be sent now and clear it
+ * ready for new data.
+ * NOTE: Assume maximum align for speed of calculation.
+ */
+ if (ncm->skb_tx_data
+ && (ncm->ndp_dgram_count >= TX_MAX_NUM_DPE
+ || (ncm->skb_tx_data->len +
+ div + rem + skb->len +
+ ncm->skb_tx_ndp->len + ndp_align + (2 * dgram_idx_len))
+ > max_size)) {
+ skb2 = package_for_tx(ncm);
+ if (!skb2)
+ goto err;
+ }
+```
+
+This issue is presently under investigation on the Linux kernel mailing
+list, and you can find the entire discussion at [1].
+
+[1] https://lore.kernel.org/all/20231204183751.64202-1-hiagofranco@gmail.com/
+
+Upstream-Status: Inappropriate [other]
+
+There is no proper patch for now, so instead we're using this patch that
+makes VNC work again as a temporarily solution until the mainline code
+gets fixed.
+
+Related-to: TEI-1078
+Signed-off-by: Hiago De Franco <hiago.franco@toradex.com>
+Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
+---
+ drivers/usb/gadget/function/f_ncm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
+index e0c183234283..5e972d1c1a0c 100644
+--- a/drivers/usb/gadget/function/f_ncm.c
++++ b/drivers/usb/gadget/function/f_ncm.c
+@@ -113,7 +113,7 @@ static inline unsigned ncm_bitrate(struct usb_gadget *g)
+ * Smaller packets are not likely to be trying to maximize the
+ * throughput and will be mstly sending smaller infrequent frames.
+ */
+-#define TX_MAX_NUM_DPE 32
++#define TX_MAX_NUM_DPE 4
+
+ /* Delay for the transmit to wait before sending an unfilled NTB frame. */
+ #define TX_TIMEOUT_NSECS 300000
+--
+2.34.1
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch b/recipes-kernel/linux/linux-toradex-upstream/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch
new file mode 100644
index 0000000..10ecd8f
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream/0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch
@@ -0,0 +1,61 @@
+From fdd0972a24818dc336b2235ce93000ee7b88240e Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Thu, 1 Sep 2022 14:04:50 +0200
+Subject: [PATCH 2/4] Revert "drm/panel-simple: drop use of data-mapping
+ property"
+
+This reverts commit d021d751c14752a0266865700f6f212fab40a18c.
+
+Re-enable the data-mapping property which was already used in the
+5.4-2.3.0 downstream kernel.
+
+In addition to the revert set bpc from the data-mapping value
+as a WARN_ON is printed if missing.
+In addition to the revert have mapping pointing to the empty string to
+prevent a kernel panic if data-mapping can not be read from the dt and
+then an uninitialized pointer is used in strcmp.
+
+Upstream-Status: Denied [Alternative solution being discused]
+https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ drivers/gpu/drm/panel/panel-simple.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
+index 95959dcc6e0e..4518eb5d7acb 100644
+--- a/drivers/gpu/drm/panel/panel-simple.c
++++ b/drivers/gpu/drm/panel/panel-simple.c
+@@ -464,6 +464,7 @@ static int panel_dpi_probe(struct device *dev,
+ struct panel_desc *desc;
+ unsigned int bus_flags;
+ struct videomode vm;
++ const char *mapping = "";
+ int ret;
+
+ np = dev->of_node;
+@@ -488,6 +489,21 @@ static int panel_dpi_probe(struct device *dev,
+ of_property_read_u32(np, "width-mm", &desc->size.width);
+ of_property_read_u32(np, "height-mm", &desc->size.height);
+
++ of_property_read_string(np, "data-mapping", &mapping);
++ if (!strcmp(mapping, "rgb24")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
++ desc->bpc = 8;
++ } else if (!strcmp(mapping, "rgb565")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16;
++ desc->bpc = 6;
++ } else if (!strcmp(mapping, "bgr666")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18;
++ desc->bpc = 6;
++ } else if (!strcmp(mapping, "lvds666")) {
++ desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
++ desc->bpc = 6;
++ }
++
+ /* Extract bus_flags from display_timing */
+ bus_flags = 0;
+ vm.flags = timing->flags;
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream/0004-media-i2c-ov5640-Implement-get_mbus_config.patch b/recipes-kernel/linux/linux-toradex-upstream/0004-media-i2c-ov5640-Implement-get_mbus_config.patch
new file mode 100644
index 0000000..7205135
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream/0004-media-i2c-ov5640-Implement-get_mbus_config.patch
@@ -0,0 +1,54 @@
+From 3317d3298cd06213d457ad7090ec0fd56eefc5d2 Mon Sep 17 00:00:00 2001
+From: Aishwarya Kothari <aishwarya.kothari@toradex.com>
+Date: Wed, 25 Jan 2023 13:09:15 +0100
+Subject: [PATCH 4/4] media: i2c: ov5640: Implement get_mbus_config
+
+Implement the introduced get_mbus_config operation to report the
+config of the MIPI CSI-2, BT.656 and Parallel interface.
+
+Signed-off-by: Aishwarya Kothari <aishwarya.kothari@toradex.com>
+Upstream-Status: Submitted [https://lore.kernel.org/all/20230306063649.7387-1-marcel@ziswiler.com/]
+---
+ drivers/media/i2c/ov5640.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
+index 5fe85aa2d2ec..8cb966fb1b79 100644
+--- a/drivers/media/i2c/ov5640.c
++++ b/drivers/media/i2c/ov5640.c
+@@ -3755,6 +3755,24 @@ static int ov5640_init_cfg(struct v4l2_subdev *sd,
+ return 0;
+ }
+
++static int ov5640_get_mbus_config(struct v4l2_subdev *sd,
++ unsigned int pad,
++ struct v4l2_mbus_config *cfg)
++{
++ struct ov5640_dev *sensor = to_ov5640_dev(sd);
++
++ cfg->type = sensor->ep.bus_type;
++ if (ov5640_is_csi2(sensor)) {
++ cfg->bus.mipi_csi2.num_data_lanes =
++ sensor->ep.bus.mipi_csi2.num_data_lanes;
++ cfg->bus.mipi_csi2.flags = sensor->ep.bus.mipi_csi2.flags;
++ } else {
++ cfg->bus.parallel.flags = sensor->ep.bus.parallel.flags;
++ }
++
++ return 0;
++}
++
+ static const struct v4l2_subdev_core_ops ov5640_core_ops = {
+ .log_status = v4l2_ctrl_subdev_log_status,
+ .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
+@@ -3775,6 +3793,7 @@ static const struct v4l2_subdev_pad_ops ov5640_pad_ops = {
+ .get_selection = ov5640_get_selection,
+ .enum_frame_size = ov5640_enum_frame_size,
+ .enum_frame_interval = ov5640_enum_frame_interval,
++ .get_mbus_config = ov5640_get_mbus_config,
+ };
+
+ static const struct v4l2_subdev_ops ov5640_subdev_ops = {
+--
+2.35.3
+
diff --git a/recipes-kernel/linux/linux-toradex-upstream_6.6.bb b/recipes-kernel/linux/linux-toradex-upstream_6.6.bb
new file mode 100644
index 0000000..65de0e4
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream_6.6.bb
@@ -0,0 +1,37 @@
+require linux-toradex-upstream.inc
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex-upstream-6.6:"
+
+LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
+
+TDX_PATCHES = " \
+ file://0001-ARM-dts-imx6qdl-apalis-Add-usdhc-aliases.patch \
+ file://0001-dt-bindings-arm-fsl-Add-toradex-apalis_imx6q-eval-v1.patch \
+ file://0001-dt-bindings-arm-fsl-add-verdin-imx8mm-mallow-board.patch \
+ file://0001-power-reset-gpio-poweroff-use-a-struct-to-store-the-.patch \
+ file://0001-thermal-imx-Update-critical-temp-threshold.patch \
+ file://0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch \
+ file://0002-arm64-dts-freescale-verdin-imx8mm-add-support-to-mal.patch \
+ file://0002-ARM-dts-imx6qdl-colibri-Add-usdhc-aliases.patch \
+ file://0002-ARM-dts-imx-Add-support-for-Apalis-Evaluation-Board-.patch \
+ file://0002-power-reset-gpio-poweroff-use-sys-off-handler-API.patch \
+ file://0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \
+ file://0003-ARM-dts-imx7d-colibri-emmc-Add-usdhc-aliases.patch \
+ file://0003-dt-bindings-power-reset-gpio-poweroff-Add-priority-p.patch \
+ file://0004-media-i2c-ov5640-Implement-get_mbus_config.patch \
+ file://0004-power-reset-gpio-poweroff-make-sys-handler-priority-.patch \
+ file://0001-drm-bridge-lt8912b-Add-suspend-resume-support.patch \
+ file://0002-drm-bridge-lt8912b-Add-power-supplies.patch \
+ file://0001-arm64-dts-freescale-imx8mp-verdin-replace-sleep-m.patch \
+ file://0002-arm64-dts-freescale-imx8mp-verdin-dahlia-support-.patch \
+ file://0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch \
+ file://0004-arm64-dts-freescale-imx8mm-verdin-dahlia-support-.patch \
+ file://0001-arm64-dts-ti-k3-am62-verdin-replace-sleep-moci-ho.patch \
+ file://0002-arm64-dts-ti-k3-am62-verdin-dahlia-support-sleep-.patch \
+"
+PV = "6.6"
+LINUX_VERSION ?= "6.6.44"
+KBRANCH = "linux-6.6.y"
+KERNEL_VERSION_SANITY_SKIP = "1"
+SRCREV_machine = "7213910600667c51c978e577bf5454d3f7b313b7"
+SRCREV_machine:use-head-next = "${AUTOREV}"
diff --git a/recipes-kernel/linux/linux-toradex-upstream_mainline.bb b/recipes-kernel/linux/linux-toradex-upstream_mainline.bb
new file mode 100644
index 0000000..2970ab6
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-upstream_mainline.bb
@@ -0,0 +1,19 @@
+# This builds latest head of linux master
+# Do not use this recipe for production, it is not reproducible
+# and you don't know what git hash is built from just looking
+# at the metadata
+
+require linux-toradex-upstream.inc
+
+LINUX_REPO = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+TDX_PATCHES = " \
+ file://0001-thermal-imx-Update-critical-temp-threshold.patch \
+ file://0002-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch \
+ file://0004-media-i2c-ov5640-Implement-get_mbus_config.patch \
+ file://0001-usb-gadget-f_ncm-Apply-workaround-for-packet-cloggin.patch \
+"
+# set PV manually, that way PREFERRED_VERSION can be set to a constant value
+PV = "mainline"
+LINUX_VERSION = "6.9-rc"
+KBRANCH = "master"
+SRCREV_machine = "${AUTOREV}"
diff --git a/recipes-kernel/linux/linux-toradex_%.bbappend b/recipes-kernel/linux/linux-toradex_%.bbappend
deleted file mode 100644
index a4bc867..0000000
--- a/recipes-kernel/linux/linux-toradex_%.bbappend
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_OEMAKE += "DTC_FLAGS=-@ "