* [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
@ 2024-12-18 15:27 Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT Frieder Schrempf
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Frieder Schrempf @ 2024-12-18 15:27 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, Frieder Schrempf, imx, Krzysztof Kozlowski,
Liam Girdwood, linux-kernel, Mark Brown, Rob Herring, Robin Gong,
Sascha Hauer, Shawn Guo
Cc: Bo Liu, Conor Dooley, Fabio Estevam, Frank Li, Joy Zou,
Krzysztof Kozlowski, Pengutronix Kernel Team
From: Frieder Schrempf <frieder.schrempf@kontron.de>
This is a follow-up of [1].
The main objective of this is to fix the PCA9450 driver to
use the correct control register for the LDO5 regulator.
Currently the control register to use for LDO5 is hardcoded to
LDO5CTRL_H. This is wrong for two reasons:
1. LDO5CTRL_H doesn't contain the bits for enabling/disabling
the regulator. Only LDO5CTRL_L does.
2. The actual output voltage of the regulator is determined by
the LDO5CTRL_H only if the SD_VSEL input is HIGH. If it is
low, then LDO5CTRL_L is used. The driver does not take this
into account.
This can cause several problems:
1. LDO5 can not be turned on/off and we rely on the bootloader
to leave it turned on. On the other hand we can't save
power if LDO5 is unused.
2. There is a potential for corner-cases where switching
SD_VSEL via USDHC_VSELECT and writing to the (wrong)
control register can cause wrong output voltage and therfore
SD card failures (not observed yet).
3. Reading the current voltage of the LDO5 regulator (e. g. via
sysfs can yield the wrong value as the voltage is read from
the wrong control register.
At the same time there is now hardware that hardwires SD_VSEL
to a fixed LOW level and therefore relies on switching the
voltage only via a single control register. We add support for
this through an additional property "nxp,sd-vsel-fixed-low" in
the LDO5 node.
Summary of binding changes (patch 1):
1. Adjust the bindings to remove the old and abandoned use of
sd-vsel-gpios property.
2. Adjust the bindings to use sd-vsel-gpios in the LDO5 node to
retrieve an input that can be used to sample the SD_VSEL
status.
3. Adjust bindings to allow "nxp,sd-vsel-fixed-low" to be used
for boards that have SD_VSEL hardwired to low level.
Summary of driver changes (patch 2-6):
1. Remove the old sd-vsel-gpios handling.
2. Use the new sd-vsel-gpios property to determine the correct
control register for LDO5.
3. Fix the enable register for LDO5.
4. Support hardware with fixed low level of SD_VSEL.
Summary of devicetree changes (patch 7-9):
Implement the changes in the devicetrees for Kontron hardware
(i.MX8MM, i.MX8MP and i.MX93).
Changelog:
v2 -> v3:
* Merge binding patches into one and extend commit message
* Rebase to next-20241218
v1 -> v2:
* Split binding patch
* Add solution for hardwired SD_VSEL
* Leave regulator core untouched as requested by Mark
* Add devicetree changes for i.MX8MP and i.MX93
[1] https://lore.kernel.org/lkml/20230213155833.1644366-1-frieder@fris.de/
Frieder Schrempf (9):
dt-bindings: regulator: pca9450: Add properties for handling LDO5
arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5"
regulator: pca9450: Fix control register for LDO5
regulator: pca9450: Fix enable register for LDO5
regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5
arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal
arm64: dts: imx93-kontron: Fix SD card IO voltage control
arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal
.../regulator/nxp,pca9450-regulator.yaml | 29 ++++-
.../boot/dts/freescale/imx8mm-kontron-bl.dts | 10 +-
.../dts/freescale/imx8mm-kontron-osm-s.dtsi | 7 +-
.../dts/freescale/imx8mp-kontron-osm-s.dtsi | 7 +-
.../boot/dts/freescale/imx8mp-skov-reva.dtsi | 5 +-
.../dts/freescale/imx93-kontron-osm-s.dtsi | 5 +-
drivers/regulator/pca9450-regulator.c | 103 +++++++++++++++---
7 files changed, 133 insertions(+), 33 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
@ 2024-12-18 15:27 ` Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 7/9] arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2024-12-18 15:27 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, imx, Krzysztof Kozlowski, linux-kernel, Rob Herring,
Sascha Hauer, Shawn Guo
Cc: Frieder Schrempf, Fabio Estevam, Pengutronix Kernel Team
From: Frieder Schrempf <frieder.schrempf@kontron.de>
The USDHC controller is able to control the IO voltage of the SD card.
There is no reason to use a GPIO to control it.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v3:
* Rebase to next-20241218
Changes for v2:
* new patch
---
arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
index 59813ef8e2bb3..33031e946329d 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-skov-reva.dtsi
@@ -232,7 +232,6 @@ pmic@25 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pmic>;
interrupts-extended = <&gpio1 3 IRQ_TYPE_EDGE_RISING>;
- sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
regulators {
reg_vdd_soc: BUCK1 {
@@ -555,7 +554,6 @@ MX8MP_IOMUXC_I2C4_SDA__I2C4_SDA 0x400001c3
pinctrl_pmic: pmicirqgrp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03 0x41
- MX8MP_IOMUXC_GPIO1_IO04__GPIO1_IO04 0x41
>;
};
@@ -623,6 +621,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d0
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d0
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d0
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d0
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0
>;
};
@@ -634,6 +633,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d4
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d4
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d4
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d4
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0
>;
};
@@ -645,6 +645,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d6
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d6
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d6
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d6
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0xc0
>;
};
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 7/9] arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT Frieder Schrempf
@ 2024-12-18 15:27 ` Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 8/9] arm64: dts: imx93-kontron: Fix SD card IO voltage control Frieder Schrempf
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2024-12-18 15:27 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, imx, Krzysztof Kozlowski, linux-kernel, Rob Herring,
Sascha Hauer, Shawn Guo
Cc: Frieder Schrempf, Fabio Estevam, Pengutronix Kernel Team
From: Frieder Schrempf <frieder.schrempf@kontron.de>
This fixes the LDO5 regulator handling of the pca9450 driver by
taking the status of the SD_VSEL into account to determine which
configuration register is used for the voltage setting.
Even without this change there is no functional issue, as the code
for switching the voltage in sdhci.c currently switches both, the
VSELECT/SD_VSEL signal and the regulator voltage at the same time
and doesn't run into an invalid corner case.
We should still make sure, that we always use the correct register
when controlling the regulator. At least in U-Boot this fixes an
actual bug where the wrong IO voltage is used and it makes sure
that the correct voltage can be read from sysfs.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v3:
* Rebase to next-20241218
Changes for v2:
* rebase to current master
---
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts | 10 +++++++---
.../arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 7 ++++---
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts
index a8ef4fba16a9e..d16490d876874 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts
@@ -254,6 +254,10 @@ &pwm2 {
status = "okay";
};
+®_nvcc_sd {
+ sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+};
+
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
@@ -454,7 +458,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0
MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000d0
>;
};
@@ -467,7 +471,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4
MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000d0
>;
};
@@ -480,7 +484,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6
MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000d0
>;
};
};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
index 663ae52b48526..d455429652305 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi
@@ -342,6 +342,7 @@ reg_nvcc_sd: LDO5 {
regulator-name = "NVCC_SD (LDO5)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
+ sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
};
};
};
@@ -794,7 +795,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 /* SDIO_A_D1 */
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 /* SDIO_A_D2 */
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 /* SDIO_A_D3 */
MX8MM_IOMUXC_SD2_WP_USDHC2_WP 0x400000d6 /* SDIO_A_WP */
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x90
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000090
>;
};
@@ -807,7 +808,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 /* SDIO_A_D1 */
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 /* SDIO_A_D2 */
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 /* SDIO_A_D3 */
MX8MM_IOMUXC_SD2_WP_USDHC2_WP 0x400000d6 /* SDIO_A_WP */
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x90
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000090
>;
};
@@ -820,7 +821,7 @@ MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 /* SDIO_A_D1 */
MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 /* SDIO_A_D2 */
MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 /* SDIO_A_D3 */
MX8MM_IOMUXC_SD2_WP_USDHC2_WP 0x400000d6 /* SDIO_A_WP */
- MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x90
+ MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x40000090
>;
};
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 8/9] arm64: dts: imx93-kontron: Fix SD card IO voltage control
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 7/9] arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
@ 2024-12-18 15:27 ` Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 9/9] arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2024-12-18 15:27 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, imx, Krzysztof Kozlowski, linux-kernel, Rob Herring,
Sascha Hauer, Shawn Guo
Cc: Frieder Schrempf, Fabio Estevam, Pengutronix Kernel Team
From: Frieder Schrempf <frieder.schrempf@kontron.de>
The OSM-S i.MX93 SoM doesn't have the VSELECT signal of the USDHC
controller connected to the PMICs SD_VSEL input. Instead SD_VSEL
is hardwired to low level. Let the driver know this in order to
use the proper register for reading and writing the voltage level.
This fixes SD card access with the latest hardware revision of
the Kontron OSM-S i.MX93 SoM.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v3:
* Rebase to next-20241218
Changes for v2:
* new patch
---
arch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi
index 47c1363a2f99a..119a162070596 100644
--- a/arch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi
@@ -189,6 +189,7 @@ reg_nvcc_sd: LDO5 {
regulator-name = "NVCC_SD (LDO5)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
+ nxp,sd-vsel-fixed-low;
};
};
};
@@ -282,6 +283,7 @@ &usdhc2 { /* OSM-S SDIO_A */
pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
vmmc-supply = <®_usdhc2_vcc>;
+ vqmmc-supply = <®_nvcc_sd>;
cd-gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
@@ -553,7 +555,6 @@ MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x40001382 /* SDIO_A_D0 */
MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x40001382 /* SDIO_A_D1 */
MX93_PAD_SD2_DATA2__USDHC2_DATA2 0x40001382 /* SDIO_A_D2 */
MX93_PAD_SD2_DATA3__USDHC2_DATA3 0x40001382 /* SDIO_A_D3 */
- MX93_PAD_SD2_VSELECT__USDHC2_VSELECT 0x1d0
>;
};
@@ -565,7 +566,6 @@ MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x4000138e /* SDIO_A_D0 */
MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x4000138e /* SDIO_A_D1 */
MX93_PAD_SD2_DATA2__USDHC2_DATA2 0x4000138e /* SDIO_A_D2 */
MX93_PAD_SD2_DATA3__USDHC2_DATA3 0x4000138e /* SDIO_A_D3 */
- MX93_PAD_SD2_VSELECT__USDHC2_VSELECT 0x1d0
>;
};
@@ -577,7 +577,6 @@ MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x400013fe /* SDIO_A_D0 */
MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x400013fe /* SDIO_A_D1 */
MX93_PAD_SD2_DATA2__USDHC2_DATA2 0x400013fe /* SDIO_A_D2 */
MX93_PAD_SD2_DATA3__USDHC2_DATA3 0x400013fe /* SDIO_A_D3 */
- MX93_PAD_SD2_VSELECT__USDHC2_VSELECT 0x1d0
>;
};
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 9/9] arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
` (2 preceding siblings ...)
2024-12-18 15:27 ` [PATCH v3 8/9] arm64: dts: imx93-kontron: Fix SD card IO voltage control Frieder Schrempf
@ 2024-12-18 15:27 ` Frieder Schrempf
2025-01-28 7:44 ` [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2024-12-18 15:27 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, imx, Krzysztof Kozlowski, linux-kernel, Rob Herring,
Sascha Hauer, Shawn Guo
Cc: Frieder Schrempf, Fabio Estevam, Pengutronix Kernel Team
From: Frieder Schrempf <frieder.schrempf@kontron.de>
This fixes the LDO5 regulator handling of the pca9450 driver by
taking the status of the SD_VSEL into account to determine which
configuration register is used for the voltage setting.
Even without this change there is no functional issue, as the code
for switching the voltage in sdhci.c currently switches both, the
VSELECT/SD_VSEL signal and the regulator voltage at the same time
and doesn't run into an invalid corner case.
We should still make sure, that we always use the correct register
when controlling the regulator. At least in U-Boot this fixes an
actual bug where the wrong IO voltage is used and it makes sure
that the correct voltage can be read from sysfs.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v3:
* Rebase to next-20241218
Changes for v2:
* new patch
---
arch/arm64/boot/dts/freescale/imx8mp-kontron-osm-s.dtsi | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-kontron-osm-s.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-kontron-osm-s.dtsi
index e0e9f6f7616d9..b97bfeb1c30f8 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-kontron-osm-s.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-kontron-osm-s.dtsi
@@ -311,6 +311,7 @@ reg_nvcc_sd: LDO5 {
regulator-name = "NVCC_SD (LDO5)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
+ sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
};
};
};
@@ -808,7 +809,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d0 /* SDIO_A_D0 */
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d0 /* SDIO_A_D1 */
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d0 /* SDIO_A_D2 */
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d0 /* SDIO_A_D3 */
- MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x1d0
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x400001d0
>;
};
@@ -820,7 +821,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d4 /* SDIO_A_D0 */
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d4 /* SDIO_A_D1 */
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d4 /* SDIO_A_D2 */
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d4 /* SDIO_A_D3 */
- MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x1d0
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x400001d0
>;
};
@@ -832,7 +833,7 @@ MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0 0x1d6 /* SDIO_A_D0 */
MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1 0x1d6 /* SDIO_A_D1 */
MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2 0x1d6 /* SDIO_A_D2 */
MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3 0x1d6 /* SDIO_A_D3 */
- MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x1d0
+ MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT 0x400001d0
>;
};
--
2.47.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
` (3 preceding siblings ...)
2024-12-18 15:27 ` [PATCH v3 9/9] arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
@ 2025-01-28 7:44 ` Frieder Schrempf
2025-01-28 11:06 ` Mark Brown
2025-02-03 19:57 ` (subset) " Mark Brown
2025-02-18 3:11 ` Shawn Guo
6 siblings, 1 reply; 10+ messages in thread
From: Frieder Schrempf @ 2025-01-28 7:44 UTC (permalink / raw)
To: Frieder Schrempf, linux-arm-kernel, Marek Vasut, Conor Dooley,
Conor Dooley, devicetree, imx, Krzysztof Kozlowski, Liam Girdwood,
linux-kernel, Mark Brown, Rob Herring, Robin Gong, Sascha Hauer,
Shawn Guo
Cc: Bo Liu, Conor Dooley, Fabio Estevam, Frank Li, Joy Zou,
Krzysztof Kozlowski, Pengutronix Kernel Team
Hi,
On 18.12.24 4:27 PM, Frieder Schrempf wrote:
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> This is a follow-up of [1].
>
> The main objective of this is to fix the PCA9450 driver to
> use the correct control register for the LDO5 regulator.
>
> Currently the control register to use for LDO5 is hardcoded to
> LDO5CTRL_H. This is wrong for two reasons:
>
> 1. LDO5CTRL_H doesn't contain the bits for enabling/disabling
> the regulator. Only LDO5CTRL_L does.
>
> 2. The actual output voltage of the regulator is determined by
> the LDO5CTRL_H only if the SD_VSEL input is HIGH. If it is
> low, then LDO5CTRL_L is used. The driver does not take this
> into account.
>
> This can cause several problems:
>
> 1. LDO5 can not be turned on/off and we rely on the bootloader
> to leave it turned on. On the other hand we can't save
> power if LDO5 is unused.
>
> 2. There is a potential for corner-cases where switching
> SD_VSEL via USDHC_VSELECT and writing to the (wrong)
> control register can cause wrong output voltage and therfore
> SD card failures (not observed yet).
>
> 3. Reading the current voltage of the LDO5 regulator (e. g. via
> sysfs can yield the wrong value as the voltage is read from
> the wrong control register.
>
> At the same time there is now hardware that hardwires SD_VSEL
> to a fixed LOW level and therefore relies on switching the
> voltage only via a single control register. We add support for
> this through an additional property "nxp,sd-vsel-fixed-low" in
> the LDO5 node.
>
> Summary of binding changes (patch 1):
>
> 1. Adjust the bindings to remove the old and abandoned use of
> sd-vsel-gpios property.
>
> 2. Adjust the bindings to use sd-vsel-gpios in the LDO5 node to
> retrieve an input that can be used to sample the SD_VSEL
> status.
>
> 3. Adjust bindings to allow "nxp,sd-vsel-fixed-low" to be used
> for boards that have SD_VSEL hardwired to low level.
>
> Summary of driver changes (patch 2-6):
>
> 1. Remove the old sd-vsel-gpios handling.
>
> 2. Use the new sd-vsel-gpios property to determine the correct
> control register for LDO5.
>
> 3. Fix the enable register for LDO5.
>
> 4. Support hardware with fixed low level of SD_VSEL.
>
> Summary of devicetree changes (patch 7-9):
>
> Implement the changes in the devicetrees for Kontron hardware
> (i.MX8MM, i.MX8MP and i.MX93).
>
> Changelog:
>
> v2 -> v3:
>
> * Merge binding patches into one and extend commit message
> * Rebase to next-20241218
>
> v1 -> v2:
>
> * Split binding patch
> * Add solution for hardwired SD_VSEL
> * Leave regulator core untouched as requested by Mark
> * Add devicetree changes for i.MX8MP and i.MX93
>
> [1] https://lore.kernel.org/lkml/20230213155833.1644366-1-frieder@fris.de/
>
> Frieder Schrempf (9):
> dt-bindings: regulator: pca9450: Add properties for handling LDO5
> arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
> Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5"
> regulator: pca9450: Fix control register for LDO5
> regulator: pca9450: Fix enable register for LDO5
> regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5
> arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal
> arm64: dts: imx93-kontron: Fix SD card IO voltage control
> arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal
>
> .../regulator/nxp,pca9450-regulator.yaml | 29 ++++-
> .../boot/dts/freescale/imx8mm-kontron-bl.dts | 10 +-
> .../dts/freescale/imx8mm-kontron-osm-s.dtsi | 7 +-
> .../dts/freescale/imx8mp-kontron-osm-s.dtsi | 7 +-
> .../boot/dts/freescale/imx8mp-skov-reva.dtsi | 5 +-
> .../dts/freescale/imx93-kontron-osm-s.dtsi | 5 +-
> drivers/regulator/pca9450-regulator.c | 103 +++++++++++++++---
> 7 files changed, 133 insertions(+), 33 deletions(-)
>
I just want to ask kindly if there is any feedback for the driver and
devicetree changes in this set?
Thanks
Frieder
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
2025-01-28 7:44 ` [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
@ 2025-01-28 11:06 ` Mark Brown
0 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2025-01-28 11:06 UTC (permalink / raw)
To: Frieder Schrempf
Cc: Frieder Schrempf, linux-arm-kernel, Marek Vasut, Conor Dooley,
Conor Dooley, devicetree, imx, Krzysztof Kozlowski, Liam Girdwood,
linux-kernel, Rob Herring, Robin Gong, Sascha Hauer, Shawn Guo,
Bo Liu, Conor Dooley, Fabio Estevam, Frank Li, Joy Zou,
Krzysztof Kozlowski, Pengutronix Kernel Team
[-- Attachment #1: Type: text/plain, Size: 942 bytes --]
On Tue, Jan 28, 2025 at 08:44:28AM +0100, Frieder Schrempf wrote:
> I just want to ask kindly if there is any feedback for the driver and
> devicetree changes in this set?
Please don't send content free pings and please allow a reasonable time
for review. People get busy, go on holiday, attend conferences and so
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review. If there have been
review comments then people may be waiting for those to be addressed.
Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: (subset) [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
` (4 preceding siblings ...)
2025-01-28 7:44 ` [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
@ 2025-02-03 19:57 ` Mark Brown
2025-02-18 8:02 ` Frieder Schrempf
2025-02-18 3:11 ` Shawn Guo
6 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2025-02-03 19:57 UTC (permalink / raw)
To: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, Frieder Schrempf, imx, Krzysztof Kozlowski,
Liam Girdwood, linux-kernel, Rob Herring, Robin Gong,
Sascha Hauer, Shawn Guo, Frieder Schrempf
Cc: Bo Liu, Conor Dooley, Fabio Estevam, Frank Li, Joy Zou,
Krzysztof Kozlowski, Pengutronix Kernel Team
On Wed, 18 Dec 2024 16:27:23 +0100, Frieder Schrempf wrote:
> This is a follow-up of [1].
>
> The main objective of this is to fix the PCA9450 driver to
> use the correct control register for the LDO5 regulator.
>
> Currently the control register to use for LDO5 is hardcoded to
> LDO5CTRL_H. This is wrong for two reasons:
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/9] dt-bindings: regulator: pca9450: Add properties for handling LDO5
commit: f9cbf56b0a1966d977df87d15a5bdbff2c342062
[2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
commit: b5ec74c2aec76fbdff9bc16951455602e11902bf
[3/9] Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5"
commit: c73be62caabbec6629689c705aea65e5ce364d5d
[4/9] regulator: pca9450: Fix control register for LDO5
commit: 3ce6f4f943ddd9edc03e450a2a0d89cb025b165b
[5/9] regulator: pca9450: Fix enable register for LDO5
commit: f5aab0438ef17f01c5ecd25e61ae6a03f82a4586
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
` (5 preceding siblings ...)
2025-02-03 19:57 ` (subset) " Mark Brown
@ 2025-02-18 3:11 ` Shawn Guo
6 siblings, 0 replies; 10+ messages in thread
From: Shawn Guo @ 2025-02-18 3:11 UTC (permalink / raw)
To: Frieder Schrempf
Cc: linux-arm-kernel, Marek Vasut, Conor Dooley, Conor Dooley,
devicetree, Frieder Schrempf, imx, Krzysztof Kozlowski,
Liam Girdwood, linux-kernel, Mark Brown, Rob Herring, Robin Gong,
Sascha Hauer, Shawn Guo, Bo Liu, Conor Dooley, Fabio Estevam,
Frank Li, Joy Zou, Krzysztof Kozlowski, Pengutronix Kernel Team
On Wed, Dec 18, 2024 at 04:27:23PM +0100, Frieder Schrempf wrote:
> Frieder Schrempf (9):
> arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
...
> arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal
> arm64: dts: imx93-kontron: Fix SD card IO voltage control
> arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal
Applied all 4 DTS patches, thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: (subset) [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450
2025-02-03 19:57 ` (subset) " Mark Brown
@ 2025-02-18 8:02 ` Frieder Schrempf
0 siblings, 0 replies; 10+ messages in thread
From: Frieder Schrempf @ 2025-02-18 8:02 UTC (permalink / raw)
To: Mark Brown, linux-arm-kernel, Marek Vasut, Conor Dooley,
Conor Dooley, devicetree, imx, Krzysztof Kozlowski, Liam Girdwood,
linux-kernel, Rob Herring, Robin Gong, Sascha Hauer, Shawn Guo,
Frieder Schrempf
Cc: Bo Liu, Conor Dooley, Fabio Estevam, Frank Li, Joy Zou,
Krzysztof Kozlowski, Pengutronix Kernel Team
Hi Mark,
On 03.02.25 8:57 PM, Mark Brown wrote:
> On Wed, 18 Dec 2024 16:27:23 +0100, Frieder Schrempf wrote:
>> This is a follow-up of [1].
>>
>> The main objective of this is to fix the PCA9450 driver to
>> use the correct control register for the LDO5 regulator.
>>
>> Currently the control register to use for LDO5 is hardcoded to
>> LDO5CTRL_H. This is wrong for two reasons:
>>
>> [...]
>
> Applied to
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
>
> Thanks!
>
> [1/9] dt-bindings: regulator: pca9450: Add properties for handling LDO5
> commit: f9cbf56b0a1966d977df87d15a5bdbff2c342062
> [2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT
> commit: b5ec74c2aec76fbdff9bc16951455602e11902bf
> [3/9] Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5"
> commit: c73be62caabbec6629689c705aea65e5ce364d5d
> [4/9] regulator: pca9450: Fix control register for LDO5
> commit: 3ce6f4f943ddd9edc03e450a2a0d89cb025b165b
> [5/9] regulator: pca9450: Fix enable register for LDO5
> commit: f5aab0438ef17f01c5ecd25e61ae6a03f82a4586
>
Thanks for picking up these patches. Meanwhile Shawn has applied patch 2
and 7-9 on his side. What about patch 6? Is there a specific reason why
this was left out?
Thanks
Frieder
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-02-18 8:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18 15:27 [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 2/9] arm64: dts: imx8mp-skov-reva: Use hardware signal for SD card VSELECT Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 7/9] arm64: dts: imx8mm-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 8/9] arm64: dts: imx93-kontron: Fix SD card IO voltage control Frieder Schrempf
2024-12-18 15:27 ` [PATCH v3 9/9] arm64: dts: imx8mp-kontron: Add support for reading SD_VSEL signal Frieder Schrempf
2025-01-28 7:44 ` [PATCH v3 0/9] Use correct LDO5 control registers for PCA9450 Frieder Schrempf
2025-01-28 11:06 ` Mark Brown
2025-02-03 19:57 ` (subset) " Mark Brown
2025-02-18 8:02 ` Frieder Schrempf
2025-02-18 3:11 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).