Skip to contentSkip to conversation

arm64: dts: freescale: verdin-imx8mm/imx8mp: add sleep-moci support

PATCH Applied Stefan Eichenberger 3 participants 10 messages Apr 5, 2024 – Apr 22, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: freescale: verdin-imx8mm/imx8mp: add sleep-moci support

From: Stefan Eichenberger <[email protected]>

This patch series adds support for sleep-moci to the Verdin iMX8MM and iMX8MP in combination with the Dahlia carrier board. sleep-moci is a GPIO that allows the system on module to turn off regulators that are not needed in suspend mode on the carrier board.

Stefan Eichenberger (4):
arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with
regulator
arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci
arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with
regulator
arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci

 .../dts/freescale/imx8mm-verdin-dahlia.dtsi   | 39 +++++++++++++++
 .../boot/dts/freescale/imx8mm-verdin-dev.dtsi |  5 ++
 .../dts/freescale/imx8mm-verdin-yavia.dtsi    |  5 ++
 .../boot/dts/freescale/imx8mm-verdin.dtsi     | 26 ++++++----
 .../dts/freescale/imx8mp-verdin-dahlia.dtsi   | 50 +++++++++++++++++++
 .../boot/dts/freescale/imx8mp-verdin-dev.dtsi |  5 ++
 .../dts/freescale/imx8mp-verdin-yavia.dtsi    |  5 ++
 .../boot/dts/freescale/imx8mp-verdin.dtsi     | 26 ++++++----
 8 files changed, 141 insertions(+), 20 deletions(-)
Signature · 1 line
2.40.1
#1 lore raw

PATCH 1/4 arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with regulator

From: Stefan Eichenberger <[email protected]>

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.

---
 .../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(-)
arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi +5 -0
index 7e9e4b13b5c5..e68e0e6f21e9 100644
@@ -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";
arch/arm64/boot/dts/freescale/imx8mp-verdin-dev.dtsi +5 -0
index a509b2b7fa85..1a2520d4d6cf 100644
@@ -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>;
arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi +5 -0
index db1722f0d80e..27160024d5b5 100644
@@ -100,6 +100,11 @@ &flexcan1 {
 	status = "okay";
 };
 
+&gpio4 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &hwmon_temp {
 	status = "okay";
 };
arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi +16 -10
index faa17cbbe2fd..e523762947aa 100644
@@ -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 */
Signature · 1 line
2.40.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH v1 1/4] arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with regulator

Quoted 12 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

Quoted 1 line
#3 lore raw

PATCH 2/4 arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci

In reply to Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

---
 .../dts/freescale/imx8mp-verdin-dahlia.dtsi   | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi +44 -0
index e68e0e6f21e9..abad1887040a 100644
@@ -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";
Signature · 1 line
2.40.1
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH v1 2/4] arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci

Quoted 11 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

#5 lore raw

PATCH 3/4 arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with regulator

In reply to Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

---
 .../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(-)
arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +5 -0
index 1cff0b829357..b64dac4f29c2 100644
@@ -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";
arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi +5 -0
index 3c4b8ca125e3..95b7c9a03a23 100644
@@ -78,6 +78,11 @@ &i2c3 {
 	status = "okay";
 };
 
+&gpio5 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ctrl_sleep_moci>;
+};
+
 &gpio_expander_21 {
 	status = "okay";
 };
arch/arm64/boot/dts/freescale/imx8mm-verdin-yavia.dtsi +5 -0
index 1e28c78e381f..763f069e8405 100644
@@ -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";
 };
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi +16 -10
index 6f0811587142..4768b05fd765 100644
@@ -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 */
Signature · 1 line
2.40.1
Reviewed-by on v1 3/4
#6 lore raw

Re: [PATCH v1 3/4] arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with regulator

Quoted 12 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

Quoted 1 line
#7 lore raw

PATCH 4/4 arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci

In reply to Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

---
 .../dts/freescale/imx8mm-verdin-dahlia.dtsi   | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi +33 -0
index b64dac4f29c2..393fc9e20423 100644
@@ -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 */
Signature · 1 line
2.40.1
Reviewed-by on v1 4/4
#8 lore raw

Re: [PATCH v1 4/4] arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci

Quoted 11 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

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.

Applied
#9 lore raw
In reply to Stefan Eichenberger
Quoted 7 lines · Stefan Eichenberger

From: Stefan Eichenberger <[email protected]>

This patch series adds support for sleep-moci to the Verdin iMX8MM and iMX8MP in combination with the Dahlia carrier board. sleep-moci is a GPIO that allows the system on module to turn off regulators that are not needed in suspend mode on the carrier board.

Quoted 7 lines

Stefan Eichenberger (4):
arm64: dts: freescale: imx8mp-verdin: replace sleep-moci hog with
regulator
arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci
arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with
regulator
arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci

Applied all, thanks!