linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card
@ 2022-12-22 20:36 Marijn Suijten
  2022-12-22 20:36 ` [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators Marijn Suijten
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

Configure regulators on Sony's SM6125-backed seine platform, and provide
these regulators to existing (SDHCI 1 / HS USB2 PHY) nodes so that they
can cast their votes despite being left enabled by the bootloader.

In addition this allows us to enable the SD Card slot on SDHCI 2, which
would not function without turning on the necessary regulators (i.e.
these were /not/ left enabled by the BL, for good reason).

Depends on:
- SM6125 APPS SMMU: https://lore.kernel.org/linux-arm-msm/20221222193254.126925-1-marijn.suijten@somainline.org/T/#u
- SM6125 GPI DMA: https://lore.kernel.org/linux-arm-msm/20221222194600.139854-1-marijn.suijten@somainline.org/T/#u
- SM6125 QUPs, SPI and I2C: https://lore.kernel.org/linux-arm-msm/20221216233408.1283581-1-marijn.suijten@somainline.org/T/#u

(To prevent DTS conflicts with the &qupv3_id_0 node override right above
&rpm_requests.)

Marijn Suijten (5):
  arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators
  arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY
  arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
  arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2
  arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases

 .../qcom/sm6125-sony-xperia-seine-pdx201.dts  | 162 ++++++++++++++++++
 1 file changed, 162 insertions(+)

--
2.39.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
@ 2022-12-22 20:36 ` Marijn Suijten
  2022-12-23 11:57   ` Konrad Dybcio
  2022-12-22 20:36 ` [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY Marijn Suijten
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

Configure PM6125 regulators based on availability and voltages defined
downstream, to allow powering up (and/or keeping powered) other hardware
blocks going forward.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../qcom/sm6125-sony-xperia-seine-pdx201.dts  | 139 ++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
index 4e7c12863d28..4f825c55692b 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
@@ -276,6 +276,145 @@ &qupv3_id_0 {
 	status = "okay";
 };
 
+&rpm_requests {
+	regulators-0 {
+		compatible = "qcom,rpm-pm6125-regulators";
+
+		vdd_l2_l3_l4-supply = <&pm6125_l7>;
+		vdd_l5_l15_l19_l20_l21_l22-supply = <&pm6125_l10>;
+
+		/*
+		 * S3/S4 is VDD_CX
+		 * S5 is VDD_MX/WCSS_MX
+		 */
+
+		pm6125_s6: s6 {
+			regulator-min-microvolt = <936000>;
+			regulator-max-microvolt = <1422000>;
+		};
+
+		pm6125_l1: l1 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1256000>;
+		};
+
+		pm6125_l2: l2 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1056000>;
+		};
+
+		pm6125_l3: l3 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1064000>;
+		};
+
+		pm6125_l4: l4 {
+			regulator-min-microvolt = <872000>;
+			regulator-max-microvolt = <976000>;
+		};
+
+		pm6125_l5: l5 {
+			regulator-min-microvolt = <1648000>;
+			regulator-max-microvolt = <3104000>;
+		};
+
+		pm6125_l6: l6 {
+			regulator-min-microvolt = <576000>;
+			regulator-max-microvolt = <656000>;
+		};
+
+		pm6125_l7: l7 {
+			regulator-min-microvolt = <872000>;
+			regulator-max-microvolt = <976000>;
+		};
+
+		pm6125_l8: l8 {
+			regulator-min-microvolt = <400000>;
+			regulator-max-microvolt = <728000>;
+		};
+
+		pm6125_l9: l9 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1896000>;
+		};
+
+		pm6125_l10: l10 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1896000>;
+		};
+
+		pm6125_l11: l11 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1952000>;
+		};
+
+		pm6125_l12: l12 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1996000>;
+		};
+
+		pm6125_l13: l13 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1832000>;
+		};
+
+		pm6125_l14: l14 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1904000>;
+		};
+
+		pm6125_l15: l15 {
+			regulator-min-microvolt = <3104000>;
+			regulator-max-microvolt = <3232000>;
+		};
+
+		pm6125_l16: l16 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1904000>;
+		};
+
+		pm6125_l17: l17 {
+			regulator-min-microvolt = <1248000>;
+			regulator-max-microvolt = <1304000>;
+		};
+
+		pm6125_l18: l18 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1264000>;
+		};
+
+		pm6125_l19: l19 {
+			regulator-min-microvolt = <1648000>;
+			regulator-max-microvolt = <2952000>;
+		};
+
+		pm6125_l20: l20 {
+			regulator-min-microvolt = <1648000>;
+			regulator-max-microvolt = <2952000>;
+		};
+
+		pm6125_l21: l21 {
+			regulator-min-microvolt = <2600000>;
+			regulator-max-microvolt = <2856000>;
+		};
+
+		pm6125_l22: l22 {
+			regulator-min-microvolt = <2944000>;
+			regulator-max-microvolt = <3304000>;
+		};
+
+		pm6125_l23: l23 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3400000>;
+		};
+
+		pm6125_l24: l24 {
+			regulator-min-microvolt = <2944000>;
+			regulator-max-microvolt = <3304000>;
+		};
+	};
+};
+
 &sdc2_off_state {
 	sd-cd-pins {
 		pins = "gpio98";
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
  2022-12-22 20:36 ` [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators Marijn Suijten
@ 2022-12-22 20:36 ` Marijn Suijten
  2022-12-23 11:58   ` Konrad Dybcio
  2022-12-22 20:36 ` [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1 Marijn Suijten
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

Document the use of l7, l10 and l15 in the High Speed Qualcomm USB2 PHY,
in order to keep the regulators voted on when USB is active.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
index 4f825c55692b..15b43cff210b 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
@@ -147,6 +147,9 @@ &gpi_dma0 {
 };
 
 &hsusb_phy1 {
+	vdd-supply = <&pm6125_l7>;
+	vdda-pll-supply = <&pm6125_l10>;
+	vdda-phy-dpdm-supply = <&pm6125_l15>;
 	status = "okay";
 };
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
  2022-12-22 20:36 ` [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators Marijn Suijten
  2022-12-22 20:36 ` [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY Marijn Suijten
@ 2022-12-22 20:36 ` Marijn Suijten
  2022-12-23 12:00   ` Konrad Dybcio
  2022-12-22 20:36 ` [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2 Marijn Suijten
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

While SDHCI 1 appears to work out of the box, we cannot rely on the
bootloader-enabled regulators nor expect them to remain enabled (e.g.
when finally dropping pd_ignore_unused).  Provide it the necessary l24
and l11 regulators now that PM6125 regulators have been made available
on this board.

As usual regulator voltages are decreased to the maximum voted by the
downstream driver for safety.  No other hardware feeds off of these
regulators anyway (except UFS, which isn't used on the seine board in
favour of a DV6DMB eMMC card connected to SDHCI 1).

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
index 15b43cff210b..eaddbe522695 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
@@ -348,7 +348,8 @@ pm6125_l10: l10 {
 
 		pm6125_l11: l11 {
 			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <1952000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-allow-set-load;
 		};
 
 		pm6125_l12: l12 {
@@ -413,7 +414,8 @@ pm6125_l23: l23 {
 
 		pm6125_l24: l24 {
 			regulator-min-microvolt = <2944000>;
-			regulator-max-microvolt = <3304000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-allow-set-load;
 		};
 	};
 };
@@ -437,6 +439,8 @@ sd-cd-pins {
 };
 
 &sdhc_1 {
+	vmmc-supply = <&pm6125_l24>;
+	vqmmc-supply = <&pm6125_l11>;
 	status = "okay";
 };
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
                   ` (2 preceding siblings ...)
  2022-12-22 20:36 ` [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1 Marijn Suijten
@ 2022-12-22 20:36 ` Marijn Suijten
  2022-12-23 12:00   ` Konrad Dybcio
  2022-12-22 20:36 ` [PATCH 5/5] arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases Marijn Suijten
  2022-12-29 17:23 ` [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Bjorn Andersson
  5 siblings, 1 reply; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

Sony's seine board features an SD Card slot on SDHCI 2, that is to be
powered by l5 and l22.  The card detect pin is already biased via
updates on the generic sdc2_*_state pinctrl nodes.

As usual regulator voltages are decreased to the maximum voted by the
downstream driver for safety.  SDHCI 2 is the only hardware block
feeding off of these.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 .../dts/qcom/sm6125-sony-xperia-seine-pdx201.dts  | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
index eaddbe522695..4c9b8ad77dd9 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
@@ -318,7 +318,8 @@ pm6125_l4: l4 {
 
 		pm6125_l5: l5 {
 			regulator-min-microvolt = <1648000>;
-			regulator-max-microvolt = <3104000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-allow-set-load;
 		};
 
 		pm6125_l6: l6 {
@@ -404,7 +405,8 @@ pm6125_l21: l21 {
 
 		pm6125_l22: l22 {
 			regulator-min-microvolt = <2944000>;
-			regulator-max-microvolt = <3304000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-allow-set-load;
 		};
 
 		pm6125_l23: l23 {
@@ -444,6 +446,15 @@ &sdhc_1 {
 	status = "okay";
 };
 
+&sdhc_2 {
+	cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
+	vmmc-supply = <&pm6125_l22>;
+	vqmmc-supply = <&pm6125_l5>;
+	no-sdio;
+	no-mmc;
+	status = "okay";
+};
+
 &tlmm {
 	gpio-reserved-ranges = <22 2>, <28 6>;
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
                   ` (3 preceding siblings ...)
  2022-12-22 20:36 ` [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2 Marijn Suijten
@ 2022-12-22 20:36 ` Marijn Suijten
  2022-12-29 17:23 ` [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Bjorn Andersson
  5 siblings, 0 replies; 13+ messages in thread
From: Marijn Suijten @ 2022-12-22 20:36 UTC (permalink / raw)
  To: phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

Ensure the eMMC and SD Card always have a predictable slot index by
predetermining them via aliases.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
index 4c9b8ad77dd9..bfc465fe8ac8 100644
--- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
+++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
@@ -20,6 +20,11 @@ / {
 	compatible = "sony,pdx201", "qcom,sm6125";
 	chassis-type = "handset";
 
+	aliases {
+		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
+		mmc1 = &sdhc_2; /* SDC2 SD card slot */
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators
  2022-12-22 20:36 ` [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators Marijn Suijten
@ 2022-12-23 11:57   ` Konrad Dybcio
  0 siblings, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2022-12-23 11:57 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, Andy Gross, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel



On 22.12.2022 21:36, Marijn Suijten wrote:
> Configure PM6125 regulators based on availability and voltages defined
> downstream, to allow powering up (and/or keeping powered) other hardware
> blocks going forward.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  .../qcom/sm6125-sony-xperia-seine-pdx201.dts  | 139 ++++++++++++++++++
>  1 file changed, 139 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> index 4e7c12863d28..4f825c55692b 100644
> --- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> @@ -276,6 +276,145 @@ &qupv3_id_0 {
>  	status = "okay";
>  };
>  
> +&rpm_requests {
> +	regulators-0 {
> +		compatible = "qcom,rpm-pm6125-regulators";
> +
> +		vdd_l2_l3_l4-supply = <&pm6125_l7>;
> +		vdd_l5_l15_l19_l20_l21_l22-supply = <&pm6125_l10>;
> +
> +		/*
> +		 * S3/S4 is VDD_CX
> +		 * S5 is VDD_MX/WCSS_MX
> +		 */
> +
> +		pm6125_s6: s6 {
> +			regulator-min-microvolt = <936000>;
> +			regulator-max-microvolt = <1422000>;
> +		};
> +
> +		pm6125_l1: l1 {
> +			regulator-min-microvolt = <1200000>;
> +			regulator-max-microvolt = <1256000>;
> +		};
> +
> +		pm6125_l2: l2 {
> +			regulator-min-microvolt = <1000000>;
> +			regulator-max-microvolt = <1056000>;
> +		};
> +
> +		pm6125_l3: l3 {
> +			regulator-min-microvolt = <1000000>;
> +			regulator-max-microvolt = <1064000>;
> +		};
> +
> +		pm6125_l4: l4 {
> +			regulator-min-microvolt = <872000>;
> +			regulator-max-microvolt = <976000>;
> +		};
> +
> +		pm6125_l5: l5 {
> +			regulator-min-microvolt = <1648000>;
> +			regulator-max-microvolt = <3104000>;
> +		};
> +
> +		pm6125_l6: l6 {
> +			regulator-min-microvolt = <576000>;
> +			regulator-max-microvolt = <656000>;
> +		};
> +
> +		pm6125_l7: l7 {
> +			regulator-min-microvolt = <872000>;
> +			regulator-max-microvolt = <976000>;
> +		};
> +
> +		pm6125_l8: l8 {
> +			regulator-min-microvolt = <400000>;
> +			regulator-max-microvolt = <728000>;
> +		};
> +
> +		pm6125_l9: l9 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1896000>;
> +		};
> +
> +		pm6125_l10: l10 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1896000>;
> +		};
> +
> +		pm6125_l11: l11 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1952000>;
> +		};
> +
> +		pm6125_l12: l12 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1996000>;
> +		};
> +
> +		pm6125_l13: l13 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1832000>;
> +		};
> +
> +		pm6125_l14: l14 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1904000>;
> +		};
> +
> +		pm6125_l15: l15 {
> +			regulator-min-microvolt = <3104000>;
> +			regulator-max-microvolt = <3232000>;
> +		};
> +
> +		pm6125_l16: l16 {
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1904000>;
> +		};
> +
> +		pm6125_l17: l17 {
> +			regulator-min-microvolt = <1248000>;
> +			regulator-max-microvolt = <1304000>;
> +		};
> +
> +		pm6125_l18: l18 {
> +			regulator-min-microvolt = <1200000>;
> +			regulator-max-microvolt = <1264000>;
> +		};
> +
> +		pm6125_l19: l19 {
> +			regulator-min-microvolt = <1648000>;
> +			regulator-max-microvolt = <2952000>;
> +		};
> +
> +		pm6125_l20: l20 {
> +			regulator-min-microvolt = <1648000>;
> +			regulator-max-microvolt = <2952000>;
> +		};
> +
> +		pm6125_l21: l21 {
> +			regulator-min-microvolt = <2600000>;
> +			regulator-max-microvolt = <2856000>;
> +		};
> +
> +		pm6125_l22: l22 {
> +			regulator-min-microvolt = <2944000>;
> +			regulator-max-microvolt = <3304000>;
> +		};
> +
> +		pm6125_l23: l23 {
> +			regulator-min-microvolt = <3000000>;
> +			regulator-max-microvolt = <3400000>;
> +		};
> +
> +		pm6125_l24: l24 {
> +			regulator-min-microvolt = <2944000>;
> +			regulator-max-microvolt = <3304000>;
> +		};
> +	};
> +};
> +
>  &sdc2_off_state {
>  	sd-cd-pins {
>  		pins = "gpio98";

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY
  2022-12-22 20:36 ` [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY Marijn Suijten
@ 2022-12-23 11:58   ` Konrad Dybcio
  0 siblings, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2022-12-23 11:58 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, Andy Gross, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel



On 22.12.2022 21:36, Marijn Suijten wrote:
> Document the use of l7, l10 and l15 in the High Speed Qualcomm USB2 PHY,
> in order to keep the regulators voted on when USB is active.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> index 4f825c55692b..15b43cff210b 100644
> --- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> @@ -147,6 +147,9 @@ &gpi_dma0 {
>  };
>  
>  &hsusb_phy1 {
> +	vdd-supply = <&pm6125_l7>;
> +	vdda-pll-supply = <&pm6125_l10>;
> +	vdda-phy-dpdm-supply = <&pm6125_l15>;
>  	status = "okay";
>  };
>  

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
  2022-12-22 20:36 ` [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1 Marijn Suijten
@ 2022-12-23 12:00   ` Konrad Dybcio
  2022-12-23 13:08     ` Marijn Suijten
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Dybcio @ 2022-12-23 12:00 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, Andy Gross, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel



On 22.12.2022 21:36, Marijn Suijten wrote:
> While SDHCI 1 appears to work out of the box, we cannot rely on the
> bootloader-enabled regulators nor expect them to remain enabled (e.g.
> when finally dropping pd_ignore_unused).
Unrelated, unused-yet-enabled (as far as Linux is concerned, anyway,
it doesn't know the state of smd rpm regulators unless you add
regulator-boot-on) regulators get swept by "regulator cleanup".

  Provide it the necessary l24
> and l11 regulators now that PM6125 regulators have been made available
> on this board.
> 
> As usual regulator voltages are decreased to the maximum voted by the
> downstream driver for safety.  No other hardware feeds off of these
> regulators anyway (except UFS, which isn't used on the seine board in
> favour of a DV6DMB eMMC card connected to SDHCI 1).
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  .../boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts     | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> index 15b43cff210b..eaddbe522695 100644
> --- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> @@ -348,7 +348,8 @@ pm6125_l10: l10 {
>  
>  		pm6125_l11: l11 {
>  			regulator-min-microvolt = <1800000>;
> -			regulator-max-microvolt = <1952000>;
> +			regulator-max-microvolt = <1800000>;
> +			regulator-allow-set-load;
>  		};
>  
>  		pm6125_l12: l12 {
> @@ -413,7 +414,8 @@ pm6125_l23: l23 {
>  
>  		pm6125_l24: l24 {
>  			regulator-min-microvolt = <2944000>;
> -			regulator-max-microvolt = <3304000>;
> +			regulator-max-microvolt = <2950000>;
> +			regulator-allow-set-load;
>  		};
>  	};
>  };
> @@ -437,6 +439,8 @@ sd-cd-pins {
>  };
>  
>  &sdhc_1 {
> +	vmmc-supply = <&pm6125_l24>;
> +	vqmmc-supply = <&pm6125_l11>;
>  	status = "okay";
>  };
>  

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2
  2022-12-22 20:36 ` [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2 Marijn Suijten
@ 2022-12-23 12:00   ` Konrad Dybcio
  0 siblings, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2022-12-23 12:00 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Bjorn Andersson
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Martin Botka, Jami Kettunen, Andy Gross, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree, linux-kernel



On 22.12.2022 21:36, Marijn Suijten wrote:
> Sony's seine board features an SD Card slot on SDHCI 2, that is to be
> powered by l5 and l22.  The card detect pin is already biased via
> updates on the generic sdc2_*_state pinctrl nodes.
> 
> As usual regulator voltages are decreased to the maximum voted by the
> downstream driver for safety.  SDHCI 2 is the only hardware block
> feeding off of these.
> 
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  .../dts/qcom/sm6125-sony-xperia-seine-pdx201.dts  | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> index eaddbe522695..4c9b8ad77dd9 100644
> --- a/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
> @@ -318,7 +318,8 @@ pm6125_l4: l4 {
>  
>  		pm6125_l5: l5 {
>  			regulator-min-microvolt = <1648000>;
> -			regulator-max-microvolt = <3104000>;
> +			regulator-max-microvolt = <2950000>;
> +			regulator-allow-set-load;
>  		};
>  
>  		pm6125_l6: l6 {
> @@ -404,7 +405,8 @@ pm6125_l21: l21 {
>  
>  		pm6125_l22: l22 {
>  			regulator-min-microvolt = <2944000>;
> -			regulator-max-microvolt = <3304000>;
> +			regulator-max-microvolt = <2950000>;
> +			regulator-allow-set-load;
>  		};
>  
>  		pm6125_l23: l23 {
> @@ -444,6 +446,15 @@ &sdhc_1 {
>  	status = "okay";
>  };
>  
> +&sdhc_2 {
> +	cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
> +	vmmc-supply = <&pm6125_l22>;
> +	vqmmc-supply = <&pm6125_l5>;
> +	no-sdio;
> +	no-mmc;
> +	status = "okay";
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <22 2>, <28 6>;
>  

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
  2022-12-23 12:00   ` Konrad Dybcio
@ 2022-12-23 13:08     ` Marijn Suijten
  2022-12-23 13:20       ` Konrad Dybcio
  0 siblings, 1 reply; 13+ messages in thread
From: Marijn Suijten @ 2022-12-23 13:08 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: phone-devel, Bjorn Andersson, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel

On 2022-12-23 13:00:18, Konrad Dybcio wrote:
> 
> 
> On 22.12.2022 21:36, Marijn Suijten wrote:
> > While SDHCI 1 appears to work out of the box, we cannot rely on the
> > bootloader-enabled regulators nor expect them to remain enabled (e.g.
> > when finally dropping pd_ignore_unused).
>
> Unrelated, unused-yet-enabled (as far as Linux is concerned, anyway,
> it doesn't know the state of smd rpm regulators unless you add
> regulator-boot-on) regulators get swept by "regulator cleanup".

That's exactly the point made here: at least this way Linux knows that
these regulators should remain enabled.  Even if it doesn't know about
many others and would fall flat on its face regardless when disabling
others as part of regulator cleanup.

Unless you meant something different?

- Marijn

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
  2022-12-23 13:08     ` Marijn Suijten
@ 2022-12-23 13:20       ` Konrad Dybcio
  0 siblings, 0 replies; 13+ messages in thread
From: Konrad Dybcio @ 2022-12-23 13:20 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: phone-devel, Bjorn Andersson, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Martin Botka, Jami Kettunen,
	Andy Gross, Rob Herring, Krzysztof Kozlowski, linux-arm-msm,
	devicetree, linux-kernel



On 23.12.2022 14:08, Marijn Suijten wrote:
> On 2022-12-23 13:00:18, Konrad Dybcio wrote:
>>
>>
>> On 22.12.2022 21:36, Marijn Suijten wrote:
>>> While SDHCI 1 appears to work out of the box, we cannot rely on the
>>> bootloader-enabled regulators nor expect them to remain enabled (e.g.
>>> when finally dropping pd_ignore_unused).
>>
>> Unrelated, unused-yet-enabled (as far as Linux is concerned, anyway,
>> it doesn't know the state of smd rpm regulators unless you add
>> regulator-boot-on) regulators get swept by "regulator cleanup".
> 
> That's exactly the point made here: at least this way Linux knows that
> these regulators should remain enabled.  Even if it doesn't know about
> many others and would fall flat on its face regardless when disabling
> others as part of regulator cleanup.
> 
> Unless you meant something different?
I meant that regulators are not handled by pd_ignore_unused, but rather
by a similar mechanism.

Konrad
> 
> - Marijn

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card
  2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
                   ` (4 preceding siblings ...)
  2022-12-22 20:36 ` [PATCH 5/5] arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases Marijn Suijten
@ 2022-12-29 17:23 ` Bjorn Andersson
  5 siblings, 0 replies; 13+ messages in thread
From: Bjorn Andersson @ 2022-12-29 17:23 UTC (permalink / raw)
  To: phone-devel, Marijn Suijten
  Cc: agross, linux-arm-msm, martin.botka, jami.kettunen, robh+dt,
	krzysztof.kozlowski+dt, angelogioacchino.delregno, linux-kernel,
	~postmarketos/upstreaming, konrad.dybcio, devicetree

On Thu, 22 Dec 2022 21:36:31 +0100, Marijn Suijten wrote:
> Configure regulators on Sony's SM6125-backed seine platform, and provide
> these regulators to existing (SDHCI 1 / HS USB2 PHY) nodes so that they
> can cast their votes despite being left enabled by the bootloader.
> 
> In addition this allows us to enable the SD Card slot on SDHCI 2, which
> would not function without turning on the necessary regulators (i.e.
> these were /not/ left enabled by the BL, for good reason).
> 
> [...]

Applied, thanks!

[1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators
      commit: 7421a8d2f1394ee9f8b5fd87121f055e56ab4e60
[2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY
      commit: 232bb8073b5b3ec043459b34535542ea5ca81694
[3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1
      commit: 68aadbe7805901b52b18595dcbe36442ebf26d93
[4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2
      commit: d696b1618bc1a416a4ab72a1176cfdf187ca09bf
[5/5] arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases
      commit: fa7ff6e9f14a05f304587ba566a4f445a2a74aa6

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-29 17:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22 20:36 [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Marijn Suijten
2022-12-22 20:36 ` [PATCH 1/5] arm64: dts: qcom: sm6125-seine: Configure PM6125 regulators Marijn Suijten
2022-12-23 11:57   ` Konrad Dybcio
2022-12-22 20:36 ` [PATCH 2/5] arm64: dts: qcom: sm6125-seine: Provide regulators to HS USB2 PHY Marijn Suijten
2022-12-23 11:58   ` Konrad Dybcio
2022-12-22 20:36 ` [PATCH 3/5] arm64: dts: qcom: sm6125-seine: Provide regulators to SDHCI 1 Marijn Suijten
2022-12-23 12:00   ` Konrad Dybcio
2022-12-23 13:08     ` Marijn Suijten
2022-12-23 13:20       ` Konrad Dybcio
2022-12-22 20:36 ` [PATCH 4/5] arm64: dts: qcom: sm6125-seine: Configure SD Card slot on SDHCI 2 Marijn Suijten
2022-12-23 12:00   ` Konrad Dybcio
2022-12-22 20:36 ` [PATCH 5/5] arm64: dts: qcom: sm6125-seine: Lock eMMC and SD Card IDs via aliases Marijn Suijten
2022-12-29 17:23 ` [PATCH 0/5] arm64: dts: qcom: sm6125-seine: Configure regulators and enable SD Card Bjorn Andersson

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).