arm64: dts: freescale: verdin-imx8mm/imx8mp: add sleep-moci support
Subsystems (2)
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
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
@@ -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
@@ -93,6 +93,11 @@ &flexspi { status = "okay"; }; +&gpio4 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ctrl_sleep_moci>; +}; + &gpio_expander_21 { status = "okay"; vcc-supply = <®_1p8v>;
arch/arm64/boot/dts/freescale/imx8mp-verdin-yavia.dtsi +5 -0
@@ -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
@@ -116,6 +116,22 @@ reg_module_eth1phy: regulator-module-eth1phy { vin-supply = <®_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
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
Signed-off-by Stefan Eichenberger <[email protected]>
PATCH 2/4 arm64: dts: freescale: imx8mp-verdin-dahlia: support sleep-moci
In reply to Stefan EichenbergerFrom: 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
@@ -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 = <®_pcie>; status = "okay"; };
@@ -143,6 +163,11 @@ ®_usdhc2_vmmc { vin-supply = <®_3p3v>; }; +/* We support turning off sleep moci on Dahlia */ +®_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 = <®_usb_hub>; + }; + + usb_hub_2_0: usb-hub@2 { + compatible = "usb424,2744"; + reg = <2>; + peer-hub = <&usb_hub_3_0>; + vdd-supply = <®_usb_hub>; + }; +}; + /* Verdin SD_1 */ &usdhc2 { status = "okay";
Signature · 1 line
2.40.1
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_mociregulator and adding two new regulators for the USB hub and PCIe that can be turned off when the system is suspended.Signed-off-by Stefan Eichenberger <[email protected]>
PATCH 3/4 arm64: dts: freescale: imx8mm-verdin: replace sleep-moci hog with regulator
In reply to Stefan EichenbergerFrom: 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
@@ -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
@@ -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
@@ -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
@@ -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
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
Signed-off-by Stefan Eichenberger <[email protected]>
PATCH 4/4 arm64: dts: freescale: imx8mm-verdin-dahlia: support sleep-moci
In reply to Stefan EichenbergerFrom: 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
@@ -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 = <®_pcie>; status = "okay"; };
@@ -120,6 +140,11 @@ &pwm3 { status = "okay"; }; +/* We support turning off sleep moci on Dahlia */ +®_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 = <®_usb_hub>; + }; }; /* Verdin SD_1 */
Signature · 1 line
2.40.1
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_mociregulator and adding two new regulators for the USB hub and PCIe that can be turned off when the system is suspended.Signed-off-by Stefan Eichenberger <[email protected]>
Shawn Guo
AppliedQuoted 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!