summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch')
-rw-r--r--recipes-kernel/linux/linux-toradex-upstream-6.6/0003-arm64-dts-freescale-imx8mm-verdin-replace-sleep-m.patch120
1 files changed, 120 insertions, 0 deletions
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
+