Skip to contentSkip to conversation

phy: qcom: qmp-pcie: Add vdda-refgen supply support for Glymur

PATCH Superseded Qiang Yu 3 participants 9 messages Jun 23 – Jul 6

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Qiang Yu

author
#0 lore raw

v2 cover phy: qcom: qmp-pcie: Add vdda-refgen supply support for Glymur

The PCIe QMP PHYs on Glymur require both refgen for stable reference voltage and qref for stable reference clock. The refgen requires two power
supplies: vdda-refgen0p9 and vdda-refgen1p2.

can be extended in the future.

This series creates a Glymur-specific supply list including the refgen supplies and updates both Gen5x4 and Gen4x2 configurations to use it.

Changes in v2:
- Add dts patch in this series.
- Reword commit msg of dtbinding patch.
- Link to v1: https://lore.kernel.org/all/[email protected]/

---
Qiang Yu (3):
dt-bindings: phy: sc8280xp-qmp-pcie: Add vdda-refgen supply for Glymur
phy: qcom: qmp-pcie: Add vdda-refgen supplies for Glymur
arm64: dts: qcom: glymur-crd: Add refgen supplies for PCIe PHY on Glymur

 .../bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml         | 16 ++++++++++++++++
 arch/arm64/boot/dts/qcom/glymur-crd.dtsi                 |  8 ++++++++
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c                 | 12 ++++++++----
 3 files changed, 32 insertions(+), 4 deletions(-)

---
base-commit: 3ce97bd3c4f18608335e709c24d6a40e7036cab8
change-id: 20260621-phy_refgen-db77317ec05a

Best regards,

Signature · 1 line
Qiang Yu <[email protected]>
author
#1 lore raw

PATCH v2 1/3 dt-bindings: phy: sc8280xp-qmp-pcie: Add vdda-refgen supply for Glymur

The PCIe QMP PHYs require a stable reference voltage provided by REFGEN, which in turn requires two separate LDOs to operate.

Add vdda-refgen0p9-supply and vdda-refgen1p2-supply properties. Mark them as required for the Glymur PCIe QMP PHYs for now; other platforms having the same requirement and can be added later.

---
 .../bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml +16 -0
index 108cf9dc86ea..375f5fb2111f 100644
@@ -91,6 +91,10 @@ properties:
 
   vdda-qref-supply: true
 
+  vdda-refgen0p9-supply: true
+
+  vdda-refgen1p2-supply: true
+
   qcom,4ln-config-sel:
     description: PCIe 4-lane configuration
     $ref: /schemas/types.yaml#/definitions/phandle-array
@@ -261,6 +265,18 @@ allOf:
         "#clock-cells":
           const: 0
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,glymur-qmp-gen4x2-pcie-phy
+              - qcom,glymur-qmp-gen5x4-pcie-phy
+    then:
+      required:
+        - vdda-refgen0p9-supply
+        - vdda-refgen1p2-supply
+
 examples:
   - |
     #include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v2 2/3 phy: qcom: qmp-pcie: Add vdda-refgen supplies for Glymur

In reply to Qiang Yu

The refgen providing reference voltage for PCIe QMP PHY on Glymur requires two power supplies independent from the PHY's core and qref rails. Add support for vdda-refgen0p9 and vdda-refgen1p2 supplies with a dedicated glymur_qmp_phy_vreg_l list.

Update both Gen5x4 and Gen4x2 configurations to use the new supply list.

---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +8 -4
index d3effad7a074..08bc89ce80e1 100644
@@ -3488,6 +3488,10 @@ static const char * const sm8550_qmp_phy_vreg_l[] = {
 	"vdda-phy", "vdda-pll", "vdda-qref",
 };
 
+static const char * const glymur_qmp_phy_vreg_l[] = {
+	"vdda-phy", "vdda-pll", "vdda-refgen0p9", "vdda-refgen1p2",
+};
+
 /* list of resets */
 static const char * const ipq8074_pciephy_reset_l[] = {
 	"phy", "common",
@@ -4756,8 +4760,8 @@ static const struct qmp_phy_cfg glymur_qmp_gen5x4_pciephy_cfg = {
 
 	.reset_list		= sdm845_pciephy_reset_l,
 	.num_resets		= ARRAY_SIZE(sdm845_pciephy_reset_l),
-	.vreg_list		= qmp_phy_vreg_l,
-	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.vreg_list		= glymur_qmp_phy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(glymur_qmp_phy_vreg_l),
 
 	.regs			= pciephy_v8_50_regs_layout,
 
@@ -4772,8 +4776,8 @@ static const struct qmp_phy_cfg glymur_qmp_gen4x2_pciephy_cfg = {
 
 	.reset_list		= sdm845_pciephy_reset_l,
 	.num_resets		= ARRAY_SIZE(sdm845_pciephy_reset_l),
-	.vreg_list		= qmp_phy_vreg_l,
-	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.vreg_list		= glymur_qmp_phy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(glymur_qmp_phy_vreg_l),
 
 	.regs			= pciephy_v8_regs_layout,
 
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH v2 3/3 arm64: dts: qcom: glymur-crd: Add refgen supplies for PCIe PHY on Glymur

In reply to Qiang Yu

The PCIe PHYs on Glymur require a reference voltage provided by REFGEN, which in turn is powered by two LDOs.

Since there is no devicetree node for REFGEN, add the vdda-refgen0p9 and vdda-refgen1p2 supplies for each PCIe PHY node.

---
 arch/arm64/boot/dts/qcom/glymur-crd.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/glymur-crd.dtsi +8 -0
index e784b538f42e..bdf7db3493bd 100644
@@ -454,6 +454,8 @@ &pcie3b {
 &pcie3b_phy {
 	vdda-phy-supply = <&vreg_l3c_e1_0p89>;
 	vdda-pll-supply = <&vreg_l2c_e1_1p14>;
+	vdda-refgen0p9-supply = <&vreg_l1c_e1_0p82>;
+	vdda-refgen1p2-supply = <&vreg_l4f_e1_1p08>;
 };
 
 &pcie3b_port0 {
@@ -471,6 +473,8 @@ &pcie4 {
 &pcie4_phy {
 	vdda-phy-supply = <&vreg_l1c_e1_0p82>;
 	vdda-pll-supply = <&vreg_l4f_e1_1p08>;
+	vdda-refgen0p9-supply = <&vreg_l1c_e1_0p82>;
+	vdda-refgen1p2-supply = <&vreg_l4f_e1_1p08>;
 
 	status = "okay";
 };
@@ -507,6 +511,8 @@ &pcie5 {
 &pcie5_phy {
 	vdda-phy-supply = <&vreg_l2f_e0_0p82>;
 	vdda-pll-supply = <&vreg_l4h_e0_1p2>;
+	vdda-refgen0p9-supply = <&vreg_l2f_e0_0p82>;
+	vdda-refgen1p2-supply = <&vreg_l4h_e0_1p2>;
 
 	status = "okay";
 };
@@ -528,6 +534,8 @@ &pcie6 {
 &pcie6_phy {
 	vdda-phy-supply = <&vreg_l1c_e1_0p82>;
 	vdda-pll-supply = <&vreg_l4f_e1_1p08>;
+	vdda-refgen0p9-supply = <&vreg_l1c_e1_0p82>;
+	vdda-refgen1p2-supply = <&vreg_l4f_e1_1p08>;
 
 	status = "okay";
 };
Signature · 1 line
2.34.1
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: phy: sc8280xp-qmp-pcie: Add vdda-refgen supply for Glymur

In reply to Qiang Yu
Quoted 11 lines · Qiang Yu

The PCIe QMP PHYs require a stable reference voltage provided by REFGEN, which in turn requires two separate LDOs to operate.

Add vdda-refgen0p9-supply and vdda-refgen1p2-supply properties. Mark them as required for the Glymur PCIe QMP PHYs for now; other platforms having the same requirement and can be added later.

---
 .../bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Best regards,
Krzysztof

#5 lore raw
In reply to Qiang Yu
Quoted 9 lines · Qiang Yu

The PCIe QMP PHYs on Glymur require both refgen for stable reference voltage and qref for stable reference clock. The refgen requires two power
supplies: vdda-refgen0p9 and vdda-refgen1p2.

can be extended in the future.

This series creates a Glymur-specific supply list including the refgen supplies and updates both Gen5x4 and Gen4x2 configurations to use it.

Quoted 8 lines

Changes in v2:
- Add dts patch in this series.
- Reword commit msg of dtbinding patch.
- Link to v1: https://lore.kernel.org/all/[email protected]/

---

Is this necessary (for Glymur) now that we correlated some of the TCSR clocks with the right nodes?

Perhaps this would be necessary for Mahua since its clocks don't require QREF (or we can lie about it and handle them there)?

Konrad

author
#6 lore raw
Quoted 17 lines · Konrad Dybcio
Quoted 16 lines · Qiang Yu

The PCIe QMP PHYs on Glymur require both refgen for stable reference voltage and qref for stable reference clock. The refgen requires two power
supplies: vdda-refgen0p9 and vdda-refgen1p2.

can be extended in the future.

This series creates a Glymur-specific supply list including the refgen supplies and updates both Gen5x4 and Gen4x2 configurations to use it.

Changes in v2:
- Add dts patch in this series.
- Reword commit msg of dtbinding patch.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Quoted 4 lines
Quoted 1 line

---

Is this necessary (for Glymur) now that we correlated some of the TCSR clocks with the right nodes?

This patch is necessary for glymur and mahua and other Qualcomm targets, which can be verified from the REFGEN page and power grid page on ipcat.

Take Glymur PCIe3 PHY as an example: it requires two REFGENs — REFGEN0 for the PHY itself and REFGEN4 for QREF. In the TCSR driver, only the LDOs for REFGEN4 are voted, not REFGEN0. This is intentional: each consumer is responsible for voting the LDOs of the REFGEN it uses. Since QREF uses REFGEN4, the TCSR driver votes the REFGEN4 LDOs; since the PHY uses REFGEN0, the PHY driver votes the REFGEN0 LDOs.

For some PHY instances in power grid, you can only see one REFGEN, that indicates the phy doesn't require QREF or the phy and the QREF it requires share same REFGEN.

Quoted 3 lines

Perhaps this would be necessary for Mahua since its clocks don't require QREF (or we can lie about it and handle them there)?

For Mahua PCIe5 PHY, it doesn't require QREF. So we don't need to vote REFGEN LDOs for QREF in tcsr driver. But the PHY requires REFGEN. So we still need to vote in PHY driver.

- Qiang Yu

#7 lore raw
Quoted 37 lines · Qiang Yu
Quoted 17 lines · Konrad Dybcio
Quoted 16 lines · Qiang Yu

The PCIe QMP PHYs on Glymur require both refgen for stable reference voltage and qref for stable reference clock. The refgen requires two power
supplies: vdda-refgen0p9 and vdda-refgen1p2.

can be extended in the future.

This series creates a Glymur-specific supply list including the refgen supplies and updates both Gen5x4 and Gen4x2 configurations to use it.

Changes in v2:
- Add dts patch in this series.
- Reword commit msg of dtbinding patch.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Quoted 4 lines
Quoted 1 line

---

Is this necessary (for Glymur) now that we correlated some of the TCSR clocks with the right nodes?

This patch is necessary for glymur and mahua and other Qualcomm targets, which can be verified from the REFGEN page and power grid page on ipcat.

Take Glymur PCIe3 PHY as an example: it requires two REFGENs — REFGEN0 for the PHY itself and REFGEN4 for QREF. In the TCSR driver, only the LDOs for REFGEN4 are voted, not REFGEN0. This is intentional: each consumer is responsible for voting the LDOs of the REFGEN it uses. Since QREF uses REFGEN4, the TCSR driver votes the REFGEN4 LDOs; since the PHY uses REFGEN0, the PHY driver votes the REFGEN0 LDOs.

For some PHY instances in power grid, you can only see one REFGEN, that indicates the phy doesn't require QREF or the phy and the QREF it requires share same REFGEN.

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

Perhaps this would be necessary for Mahua since its clocks don't require QREF (or we can lie about it and handle them there)?

For Mahua PCIe5 PHY, it doesn't require QREF. So we don't need to vote REFGEN LDOs for QREF in tcsr driver. But the PHY requires REFGEN. So we still need to vote in PHY driver.

OK, I think I got my mental model of all of this straight. But expect me to make more mistakes and sorry for that!

Konrad

author
#8 lore raw
Quoted 41 lines · Konrad Dybcio
Quoted 40 lines · Qiang Yu
Quoted 17 lines · Konrad Dybcio
Quoted 16 lines · Qiang Yu

The PCIe QMP PHYs on Glymur require both refgen for stable reference voltage and qref for stable reference clock. The refgen requires two power
supplies: vdda-refgen0p9 and vdda-refgen1p2.

can be extended in the future.

This series creates a Glymur-specific supply list including the refgen supplies and updates both Gen5x4 and Gen4x2 configurations to use it.

Changes in v2:
- Add dts patch in this series.
- Reword commit msg of dtbinding patch.
- Link to v1: https://lore.kernel.org/all/[email protected]/

Quoted 4 lines
Quoted 1 line

---

Is this necessary (for Glymur) now that we correlated some of the TCSR clocks with the right nodes?

This patch is necessary for glymur and mahua and other Qualcomm targets, which can be verified from the REFGEN page and power grid page on ipcat.

Take Glymur PCIe3 PHY as an example: it requires two REFGENs — REFGEN0 for the PHY itself and REFGEN4 for QREF. In the TCSR driver, only the LDOs for REFGEN4 are voted, not REFGEN0. This is intentional: each consumer is responsible for voting the LDOs of the REFGEN it uses. Since QREF uses REFGEN4, the TCSR driver votes the REFGEN4 LDOs; since the PHY uses REFGEN0, the PHY driver votes the REFGEN0 LDOs.

For some PHY instances in power grid, you can only see one REFGEN, that indicates the phy doesn't require QREF or the phy and the QREF it requires share same REFGEN.

Quoted 3 lines

Perhaps this would be necessary for Mahua since its clocks don't require QREF (or we can lie about it and handle them there)?

Quoted 6 lines
Quoted 3 lines

For Mahua PCIe5 PHY, it doesn't require QREF. So we don't need to vote REFGEN LDOs for QREF in tcsr driver. But the PHY requires REFGEN. So we still need to vote in PHY driver.

OK, I think I got my mental model of all of this straight. But expect me to make more mistakes and sorry for that!

No worries at all. Glad the REFGEN and QREF topology is clear now. Thanks for the review.

- Qiang Yu