linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB
@ 2023-04-28 13:08 Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Update relavent DT bindings for USB, add new config to the phy driver,
add USB and PHY nodes to the .dtsi and enable them in the board .dts
for the sa8775p-ride platform.

v1 -> v2:
- correct dwc3 device tree bindings for irq's.
- collect R-b, A-b and T-b tags.

Shazad Hussain (6):
  dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
  dt-bindings: phy: qcom,usb-snps-femto-v2: Add bindings for SA8775P
  dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY
    binding
  phy: qcom-qmp: Add SA8775P USB3 UNI phy
  arm64: dts: qcom: sa8775p: add USB nodes
  arm64: dts: qcom: sa8775p-ride: enable USB nodes

 .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml   |   1 +
 .../bindings/phy/qcom,usb-snps-femto-v2.yaml  |   1 +
 .../devicetree/bindings/usb/qcom,dwc3.yaml    |  21 ++
 arch/arm64/boot/dts/qcom/sa8775p-ride.dts     |  92 +++++++
 arch/arm64/boot/dts/qcom/sa8775p.dtsi         | 239 +++++++++++++++++-
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       |  45 ++++
 6 files changed, 397 insertions(+), 2 deletions(-)

-- 
2.17.1


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

* [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-04-28 13:27   ` Krzysztof Kozlowski
  2023-05-01  6:42   ` Krzysztof Kozlowski
  2023-04-28 13:08 ` [PATCH v2 2/6] dt-bindings: phy: qcom,usb-snps-femto-v2: " Shazad Hussain
                   ` (6 subsequent siblings)
  7 siblings, 2 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Add the compatible string for SA8775P SoC from Qualcomm.

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
---
 .../devicetree/bindings/usb/qcom,dwc3.yaml    | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
index d84281926f10..4a36e2b6c8fb 100644
--- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
@@ -23,6 +23,7 @@ properties:
           - qcom,msm8998-dwc3
           - qcom,qcm2290-dwc3
           - qcom,qcs404-dwc3
+          - qcom,sa8775p-dwc3
           - qcom,sc7180-dwc3
           - qcom,sc7280-dwc3
           - qcom,sc8280xp-dwc3
@@ -180,6 +181,7 @@ allOf:
               - qcom,msm8953-dwc3
               - qcom,msm8996-dwc3
               - qcom,msm8998-dwc3
+              - qcom,sa8775p-dwc3
               - qcom,sc7180-dwc3
               - qcom,sc7280-dwc3
               - qcom,sdm670-dwc3
@@ -455,6 +457,25 @@ allOf:
             - const: dm_hs_phy_irq
             - const: ss_phy_irq
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,sa8775p-dwc3
+    then:
+      properties:
+        interrupts:
+          minItems: 3
+          maxItems: 4
+        interrupt-names:
+          minItems: 3
+          items:
+            - const: pwr_event
+            - const: dp_hs_phy_irq
+            - const: dm_hs_phy_irq
+            - const: ss_phy_irq
+
 additionalProperties: false
 
 examples:
-- 
2.17.1


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

* [PATCH v2 2/6] dt-bindings: phy: qcom,usb-snps-femto-v2: Add bindings for SA8775P
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 3/6] dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY binding Shazad Hussain
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Document the compatible string for USB phy found in Qualcomm SA8775P SoC

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml          | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml
index a26524b7e7b7..0f200e3f97a9 100644
--- a/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml
@@ -20,6 +20,7 @@ properties:
           - qcom,usb-snps-femto-v2-phy
       - items:
           - enum:
+              - qcom,sa8775p-usb-hs-phy
               - qcom,sc8280xp-usb-hs-phy
           - const: qcom,usb-snps-hs-5nm-phy
       - items:
-- 
2.17.1


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

* [PATCH v2 3/6] dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY binding
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 2/6] dt-bindings: phy: qcom,usb-snps-femto-v2: " Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy Shazad Hussain
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Add compatible string for Qualcomm QMP Super Speed (SS) UNI PHY found
in SA8775P.

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
index 16fce1038285..c61cea4835bb 100644
--- a/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml
@@ -16,6 +16,7 @@ description:
 properties:
   compatible:
     enum:
+      - qcom,sa8775p-qmp-usb3-uni-phy
       - qcom,sc8280xp-qmp-usb3-uni-phy
 
   reg:
-- 
2.17.1


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

* [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
                   ` (2 preceding siblings ...)
  2023-04-28 13:08 ` [PATCH v2 3/6] dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY binding Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-04-28 19:51   ` Dmitry Baryshkov
  2023-04-28 13:08 ` [PATCH v2 5/6] arm64: dts: qcom: sa8775p: add USB nodes Shazad Hussain
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

The SA8775P platform has 5nm USB3 UNI phy attached to the USB0 and USB1
controllers.

Add QMP PHY config, pcs entries and support for the new compatible for
SA8775P platform.

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 45 +++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index a49711c5a63d..5c039bbbe036 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -1408,6 +1408,26 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {
 	QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
 };
 
+static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG1, 0xc4),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG2, 0x89),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG3, 0x20),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_LOCK_DETECT_CONFIG6, 0x13),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_RX_SIGDET_LVL, 0xaa),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCS_TX_RX_CONFIG, 0x0c),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1, 0x6f),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_CDR_RESET_TIME, 0x0a),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG1, 0x88),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_EQ_CONFIG1, 0x4b),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_EQ_CONFIG5, 0x10),
+	QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21),
+};
+
 struct qmp_usb_offsets {
 	u16 serdes;
 	u16 pcs;
@@ -1629,6 +1649,28 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
 	.has_phy_dp_com_ctrl	= true,
 };
 
+static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = {
+	.lanes			= 1,
+
+	.offsets		= &qmp_usb_offsets_v5,
+
+	.serdes_tbl		= sc8280xp_usb3_uniphy_serdes_tbl,
+	.serdes_tbl_num		= ARRAY_SIZE(sc8280xp_usb3_uniphy_serdes_tbl),
+	.tx_tbl			= sc8280xp_usb3_uniphy_tx_tbl,
+	.tx_tbl_num		= ARRAY_SIZE(sc8280xp_usb3_uniphy_tx_tbl),
+	.rx_tbl			= sc8280xp_usb3_uniphy_rx_tbl,
+	.rx_tbl_num		= ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl),
+	.pcs_tbl		= sa8775p_usb3_uniphy_pcs_tbl,
+	.pcs_tbl_num		= ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl),
+	.clk_list		= qmp_v4_phy_clk_l,
+	.num_clks		= ARRAY_SIZE(qmp_v4_phy_clk_l),
+	.reset_list		= qcm2290_usb3phy_reset_l,
+	.num_resets		= ARRAY_SIZE(qcm2290_usb3phy_reset_l),
+	.vreg_list		= qmp_phy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.regs			= qmp_v5_usb3phy_regs_layout,
+};
+
 static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
 	.lanes			= 2,
 
@@ -2597,6 +2639,9 @@ static const struct of_device_id qmp_usb_of_match_table[] = {
 	}, {
 		.compatible = "qcom,qcm2290-qmp-usb3-phy",
 		.data = &qcm2290_usb3phy_cfg,
+	}, {
+		.compatible = "qcom,sa8775p-qmp-usb3-uni-phy",
+		.data = &sa8775p_usb3_uniphy_cfg,
 	}, {
 		.compatible = "qcom,sc7180-qmp-usb3-phy",
 		.data = &sc7180_usb3phy_cfg,
-- 
2.17.1


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

* [PATCH v2 5/6] arm64: dts: qcom: sa8775p: add USB nodes
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
                   ` (3 preceding siblings ...)
  2023-04-28 13:08 ` [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-04-28 13:08 ` [PATCH v2 6/6] arm64: dts: qcom: sa8775p-ride: enable " Shazad Hussain
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Add nodes for the USB and it's PHY on sa8775p platform.

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sa8775p.dtsi | 239 +++++++++++++++++++++++++-
 1 file changed, 237 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index 2343df7e0ea4..47b6936d638c 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -452,8 +452,8 @@
 				 <0>,
 				 <0>,
 				 <0>,
-				 <0>,
-				 <0>,
+				 <&usb_0_qmpphy>,
+				 <&usb_1_qmpphy>,
 				 <0>,
 				 <0>,
 				 <0>,
@@ -585,6 +585,241 @@
 			};
 		};
 
+		usb_0_hsphy: phy@88e4000 {
+			compatible = "qcom,sa8775p-usb-hs-phy",
+				     "qcom,usb-snps-hs-5nm-phy";
+			reg = <0 0x088e4000 0 0x120>;
+			clocks = <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "ref";
+			resets = <&gcc GCC_USB2_PHY_PRIM_BCR>;
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
+		usb_0_qmpphy: phy@88e8000 {
+			compatible = "qcom,sa8775p-qmp-usb3-uni-phy";
+			reg = <0 0x088e8000 0 0x2000>;
+
+			clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>,
+				 <&gcc GCC_USB_CLKREF_EN>,
+				 <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>,
+				 <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+			clock-names = "aux", "ref", "com_aux", "pipe";
+
+			resets = <&gcc GCC_USB3_PHY_PRIM_BCR>,
+				 <&gcc GCC_USB3PHY_PHY_PRIM_BCR>;
+			reset-names = "phy", "phy_phy";
+
+			power-domains = <&gcc USB30_PRIM_GDSC>;
+
+			#clock-cells = <0>;
+			clock-output-names = "usb3_prim_phy_pipe_clk_src";
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
+		usb_0: usb@a6f8800 {
+			compatible = "qcom,sa8775p-dwc3", "qcom,dwc3";
+			reg = <0 0x0a6f8800 0 0x400>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+
+			clocks = <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>,
+				 <&gcc GCC_USB30_PRIM_MASTER_CLK>,
+				 <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>,
+				 <&gcc GCC_USB30_PRIM_SLEEP_CLK>,
+				 <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>;
+			clock-names = "cfg_noc", "core", "iface", "sleep", "mock_utmi";
+
+			assigned-clocks = <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
+					  <&gcc GCC_USB30_PRIM_MASTER_CLK>;
+			assigned-clock-rates = <19200000>, <200000000>;
+
+			interrupts-extended = <&intc GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 14 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 15 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 12 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "pwr_event",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
+
+			power-domains = <&gcc USB30_PRIM_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
+
+			resets = <&gcc GCC_USB30_PRIM_BCR>;
+
+			interconnects = <&aggre1_noc MASTER_USB3_0 0 &mc_virt SLAVE_EBI1 0>,
+					<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_0 0>;
+			interconnect-names = "usb-ddr", "apps-usb";
+
+			wakeup-source;
+
+			status = "disabled";
+
+			usb_0_dwc3: usb@a600000 {
+				compatible = "snps,dwc3";
+				reg = <0 0x0a600000 0 0xe000>;
+				interrupts = <GIC_SPI 292 IRQ_TYPE_LEVEL_HIGH>;
+				iommus = <&apps_smmu 0x080 0x0>;
+				phys = <&usb_0_hsphy>, <&usb_0_qmpphy>;
+				phy-names = "usb2-phy", "usb3-phy";
+			};
+		};
+
+		usb_1_hsphy: phy@88e6000 {
+			compatible = "qcom,sa8775p-usb-hs-phy",
+				     "qcom,usb-snps-hs-5nm-phy";
+			reg = <0 0x088e6000 0 0x120>;
+			clocks = <&gcc GCC_USB_CLKREF_EN>;
+			clock-names = "ref";
+			resets = <&gcc GCC_USB2_PHY_SEC_BCR>;
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
+		usb_1_qmpphy: phy@88ea000 {
+			compatible = "qcom,sa8775p-qmp-usb3-uni-phy";
+			reg = <0 0x088ea000 0 0x2000>;
+
+			clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK>,
+				 <&gcc GCC_USB_CLKREF_EN>,
+				 <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>,
+				 <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
+			clock-names = "aux", "ref", "com_aux", "pipe";
+
+			resets = <&gcc GCC_USB3_PHY_SEC_BCR>,
+				 <&gcc GCC_USB3PHY_PHY_SEC_BCR>;
+			reset-names = "phy", "phy_phy";
+
+			power-domains = <&gcc USB30_SEC_GDSC>;
+
+			#clock-cells = <0>;
+			clock-output-names = "usb3_sec_phy_pipe_clk_src";
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
+		usb_1: usb@a8f8800 {
+			compatible = "qcom,sa8775p-dwc3", "qcom,dwc3";
+			reg = <0 0x0a8f8800 0 0x400>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+
+			clocks = <&gcc GCC_CFG_NOC_USB3_SEC_AXI_CLK>,
+				 <&gcc GCC_USB30_SEC_MASTER_CLK>,
+				 <&gcc GCC_AGGRE_USB3_SEC_AXI_CLK>,
+				 <&gcc GCC_USB30_SEC_SLEEP_CLK>,
+				 <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>;
+			clock-names = "cfg_noc", "core", "iface", "sleep", "mock_utmi";
+
+			assigned-clocks = <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
+					  <&gcc GCC_USB30_SEC_MASTER_CLK>;
+			assigned-clock-rates = <19200000>, <200000000>;
+
+			interrupts-extended = <&intc GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 8 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 7 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 13 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "pwr_event",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
+
+			power-domains = <&gcc USB30_SEC_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
+
+			resets = <&gcc GCC_USB30_SEC_BCR>;
+
+			interconnects = <&aggre1_noc MASTER_USB3_1 0 &mc_virt SLAVE_EBI1 0>,
+					<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_1 0>;
+			interconnect-names = "usb-ddr", "apps-usb";
+
+			wakeup-source;
+
+			status = "disabled";
+
+			usb_1_dwc3: usb@a800000 {
+				compatible = "snps,dwc3";
+				reg = <0 0x0a800000 0 0xe000>;
+				interrupts = <GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH>;
+				iommus = <&apps_smmu 0x0a0 0x0>;
+				phys = <&usb_1_hsphy>, <&usb_1_qmpphy>;
+				phy-names = "usb2-phy", "usb3-phy";
+			};
+		};
+
+		usb_2_hsphy: phy@88e7000 {
+			compatible = "qcom,sa8775p-usb-hs-phy",
+				     "qcom,usb-snps-hs-5nm-phy";
+			reg = <0 0x088e7000 0 0x120>;
+			clocks = <&gcc GCC_USB_CLKREF_EN>;
+			clock-names = "ref";
+			resets = <&gcc GCC_USB3_PHY_TERT_BCR>;
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
+		usb_2: usb@a4f8800 {
+			compatible = "qcom,sa8775p-dwc3", "qcom,dwc3";
+			reg = <0 0x0a4f8800 0 0x400>;
+			#address-cells = <2>;
+			#size-cells = <2>;
+			ranges;
+
+			clocks = <&gcc GCC_CFG_NOC_USB2_PRIM_AXI_CLK>,
+				 <&gcc GCC_USB20_MASTER_CLK>,
+				 <&gcc GCC_AGGRE_USB2_PRIM_AXI_CLK>,
+				 <&gcc GCC_USB20_SLEEP_CLK>,
+				 <&gcc GCC_USB20_MOCK_UTMI_CLK>;
+			clock-names = "cfg_noc", "core", "iface", "sleep", "mock_utmi";
+
+			assigned-clocks = <&gcc GCC_USB20_MOCK_UTMI_CLK>,
+					  <&gcc GCC_USB20_MASTER_CLK>;
+			assigned-clock-rates = <19200000>, <200000000>;
+
+			interrupts-extended = <&intc GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 10 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 9 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "pwr_event",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq";
+
+			power-domains = <&gcc USB20_PRIM_GDSC>;
+			required-opps = <&rpmhpd_opp_nom>;
+
+			resets = <&gcc GCC_USB20_PRIM_BCR>;
+
+			interconnects = <&aggre1_noc MASTER_USB2 0 &mc_virt SLAVE_EBI1 0>,
+					<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB2 0>;
+			interconnect-names = "usb-ddr", "apps-usb";
+
+			wakeup-source;
+
+			status = "disabled";
+
+			usb_2_dwc3: usb@a400000 {
+				compatible = "snps,dwc3";
+				reg = <0 0x0a400000 0 0xe000>;
+				interrupts = <GIC_SPI 442 IRQ_TYPE_LEVEL_HIGH>;
+				iommus = <&apps_smmu 0x020 0x0>;
+				phys = <&usb_2_hsphy>;
+				phy-names = "usb2-phy";
+			};
+		};
+
 		tcsr_mutex: hwlock@1f40000 {
 			compatible = "qcom,tcsr-mutex";
 			reg = <0x0 0x01f40000 0x0 0x20000>;
-- 
2.17.1


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

* [PATCH v2 6/6] arm64: dts: qcom: sa8775p-ride: enable USB nodes
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
                   ` (4 preceding siblings ...)
  2023-04-28 13:08 ` [PATCH v2 5/6] arm64: dts: qcom: sa8775p: add USB nodes Shazad Hussain
@ 2023-04-28 13:08 ` Shazad Hussain
  2023-05-08  9:30 ` [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Vinod Koul
  2023-05-15  3:33 ` (subset) " Bjorn Andersson
  7 siblings, 0 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:08 UTC (permalink / raw)
  To: agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Shazad Hussain,
	Vinod Koul, Kishon Vijay Abraham I, Greg Kroah-Hartman,
	Wesley Cheng, linux-arm-msm, linux-phy, devicetree, linux-kernel,
	linux-usb

Enable usb0, usb1 and usb2 nodes and their respective phy's.

Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Adrien Thierry <athierry@redhat.com>
---
 arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 92 +++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
index f238a02a5448..13ac60ddd170 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
+++ b/arch/arm64/boot/dts/qcom/sa8775p-ride.dts
@@ -291,6 +291,13 @@
 			  "BT_EN",
 			  "USB2_PWR_EN",
 			  "USB2_FAULT";
+
+	usb2_en_state: usb2-en-state {
+		pins = "gpio9";
+		function = "normal";
+		output-high;
+		power-source = <0>;
+	};
 };
 
 &pmm8654au_2_gpios {
@@ -306,6 +313,20 @@
 			  "USB1_PWR_ENABLE",
 			  "USB1_FAULT",
 			  "VMON_SPX8";
+
+	usb0_en_state: usb0-en-state {
+		pins = "gpio3";
+		function = "normal";
+		output-high;
+		power-source = <0>;
+	};
+
+	usb1_en_state: usb1-en-state {
+		pins = "gpio10";
+		function = "normal";
+		output-high;
+		power-source = <0>;
+	};
 };
 
 &pmm8654au_3_gpios {
@@ -426,6 +447,77 @@
 	status = "okay";
 };
 
+&usb_0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb0_en_state>;
+
+	status = "okay";
+};
+
+&usb_0_dwc3 {
+	dr_mode = "peripheral";
+};
+
+&usb_0_hsphy {
+	vdda-pll-supply = <&vreg_l7a>;
+	vdda18-supply = <&vreg_l6c>;
+	vdda33-supply = <&vreg_l9a>;
+
+	status = "okay";
+};
+
+&usb_0_qmpphy {
+	vdda-phy-supply = <&vreg_l1c>;
+	vdda-pll-supply = <&vreg_l7a>;
+
+	status = "okay";
+};
+
+&usb_1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb1_en_state>;
+
+	status = "okay";
+};
+
+&usb_1_dwc3 {
+	dr_mode = "host";
+};
+
+&usb_1_hsphy {
+	vdda-pll-supply = <&vreg_l7a>;
+	vdda18-supply = <&vreg_l6c>;
+	vdda33-supply = <&vreg_l9a>;
+
+	status = "okay";
+};
+
+&usb_1_qmpphy {
+	vdda-phy-supply = <&vreg_l1c>;
+	vdda-pll-supply = <&vreg_l7a>;
+
+	status = "okay";
+};
+
+&usb_2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb2_en_state>;
+
+	status = "okay";
+};
+
+&usb_2_dwc3 {
+	dr_mode = "host";
+};
+
+&usb_2_hsphy {
+	vdda-pll-supply = <&vreg_l7a>;
+	vdda18-supply = <&vreg_l6c>;
+	vdda33-supply = <&vreg_l9a>;
+
+	status = "okay";
+};
+
 &xo_board_clk {
 	clock-frequency = <38400000>;
 };
-- 
2.17.1


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

* Re: [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
  2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
@ 2023-04-28 13:27   ` Krzysztof Kozlowski
  2023-04-28 13:59     ` Shazad Hussain
  2023-05-01  6:42   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-28 13:27 UTC (permalink / raw)
  To: Shazad Hussain, agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Greg Kroah-Hartman, Wesley Cheng,
	linux-arm-msm, linux-phy, devicetree, linux-kernel, linux-usb

On 28/04/2023 15:08, Shazad Hussain wrote:
> Add the compatible string for SA8775P SoC from Qualcomm.
> 
> Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
> ---

(...)

> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - qcom,sa8775p-dwc3
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 3
> +          maxItems: 4
> +        interrupt-names:
> +          minItems: 3
> +          items:
> +            - const: pwr_event
> +            - const: dp_hs_phy_irq
> +            - const: dm_hs_phy_irq
> +            - const: ss_phy_irq

Why the last interrupt line is optional? Is it really optional?

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
  2023-04-28 13:27   ` Krzysztof Kozlowski
@ 2023-04-28 13:59     ` Shazad Hussain
  0 siblings, 0 replies; 13+ messages in thread
From: Shazad Hussain @ 2023-04-28 13:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski, agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Greg Kroah-Hartman, Wesley Cheng,
	linux-arm-msm, linux-phy, devicetree, linux-kernel, linux-usb

Hi Krzysztof,

On 4/28/2023 6:57 PM, Krzysztof Kozlowski wrote:
> On 28/04/2023 15:08, Shazad Hussain wrote:
>> Add the compatible string for SA8775P SoC from Qualcomm.
>>
>> Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
>> ---
> 
> (...)
> 
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - qcom,sa8775p-dwc3
>> +    then:
>> +      properties:
>> +        interrupts:
>> +          minItems: 3
>> +          maxItems: 4
>> +        interrupt-names:
>> +          minItems: 3
>> +          items:
>> +            - const: pwr_event
>> +            - const: dp_hs_phy_irq
>> +            - const: dm_hs_phy_irq
>> +            - const: ss_phy_irq
> 
> Why the last interrupt line is optional? Is it really optional?
> 

Third usb controller i.e usb_2 supports only high speed, so I believe
ss_phy_irq is not required for that instance.

> Best regards,
> Krzysztof
> 

-Shazad

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

* Re: [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy
  2023-04-28 13:08 ` [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy Shazad Hussain
@ 2023-04-28 19:51   ` Dmitry Baryshkov
  0 siblings, 0 replies; 13+ messages in thread
From: Dmitry Baryshkov @ 2023-04-28 19:51 UTC (permalink / raw)
  To: Shazad Hussain
  Cc: agross, andersson, robh+dt, krzysztof.kozlowski+dt, athierry,
	robh, konrad.dybcio, Vinod Koul, Kishon Vijay Abraham I,
	Greg Kroah-Hartman, Wesley Cheng, linux-arm-msm, linux-phy,
	devicetree, linux-kernel, linux-usb

On Fri, 28 Apr 2023 at 16:09, Shazad Hussain <quic_shazhuss@quicinc.com> wrote:
>
> The SA8775P platform has 5nm USB3 UNI phy attached to the USB0 and USB1
> controllers.
>
> Add QMP PHY config, pcs entries and support for the new compatible for
> SA8775P platform.
>
> Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 45 +++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
  2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
  2023-04-28 13:27   ` Krzysztof Kozlowski
@ 2023-05-01  6:42   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-01  6:42 UTC (permalink / raw)
  To: Shazad Hussain, agross, andersson, robh+dt, krzysztof.kozlowski+dt
  Cc: dmitry.baryshkov, athierry, robh, konrad.dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Greg Kroah-Hartman, Wesley Cheng,
	linux-arm-msm, linux-phy, devicetree, linux-kernel, linux-usb

On 28/04/2023 15:08, Shazad Hussain wrote:
> Add the compatible string for SA8775P SoC from Qualcomm.
> 
> Signed-off-by: Shazad Hussain <quic_shazhuss@quicinc.com>
> ---


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
                   ` (5 preceding siblings ...)
  2023-04-28 13:08 ` [PATCH v2 6/6] arm64: dts: qcom: sa8775p-ride: enable " Shazad Hussain
@ 2023-05-08  9:30 ` Vinod Koul
  2023-05-15  3:33 ` (subset) " Bjorn Andersson
  7 siblings, 0 replies; 13+ messages in thread
From: Vinod Koul @ 2023-05-08  9:30 UTC (permalink / raw)
  To: Shazad Hussain
  Cc: agross, andersson, robh+dt, krzysztof.kozlowski+dt,
	dmitry.baryshkov, athierry, robh, konrad.dybcio,
	Kishon Vijay Abraham I, Greg Kroah-Hartman, Wesley Cheng,
	linux-arm-msm, linux-phy, devicetree, linux-kernel, linux-usb

On 28-04-23, 18:38, Shazad Hussain wrote:
> Update relavent DT bindings for USB, add new config to the phy driver,
> add USB and PHY nodes to the .dtsi and enable them in the board .dts
> for the sa8775p-ride platform.

Applied 1-4, thanks

-- 
~Vinod

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

* Re: (subset) [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB
  2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
                   ` (6 preceding siblings ...)
  2023-05-08  9:30 ` [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Vinod Koul
@ 2023-05-15  3:33 ` Bjorn Andersson
  7 siblings, 0 replies; 13+ messages in thread
From: Bjorn Andersson @ 2023-05-15  3:33 UTC (permalink / raw)
  To: robh+dt, krzysztof.kozlowski+dt, agross, Shazad Hussain
  Cc: linux-usb, athierry, linux-kernel, konrad.dybcio, robh,
	devicetree, linux-phy, linux-arm-msm, Kishon Vijay Abraham I,
	Wesley Cheng, Greg Kroah-Hartman, Vinod Koul, dmitry.baryshkov

On Fri, 28 Apr 2023 18:38:18 +0530, Shazad Hussain wrote:
> Update relavent DT bindings for USB, add new config to the phy driver,
> add USB and PHY nodes to the .dtsi and enable them in the board .dts
> for the sa8775p-ride platform.
> 
> v1 -> v2:
> - correct dwc3 device tree bindings for irq's.
> - collect R-b, A-b and T-b tags.
> 
> [...]

Applied, thanks!

[5/6] arm64: dts: qcom: sa8775p: add USB nodes
      commit: de1001525c1aa21380349ffbef8154149ef637e8
[6/6] arm64: dts: qcom: sa8775p-ride: enable USB nodes
      commit: 4eefaf51f716be584bbc4f548d368255c682a3b9

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

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

end of thread, other threads:[~2023-05-15  3:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 13:08 [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Shazad Hussain
2023-04-28 13:08 ` [PATCH v2 1/6] dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P Shazad Hussain
2023-04-28 13:27   ` Krzysztof Kozlowski
2023-04-28 13:59     ` Shazad Hussain
2023-05-01  6:42   ` Krzysztof Kozlowski
2023-04-28 13:08 ` [PATCH v2 2/6] dt-bindings: phy: qcom,usb-snps-femto-v2: " Shazad Hussain
2023-04-28 13:08 ` [PATCH v2 3/6] dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY binding Shazad Hussain
2023-04-28 13:08 ` [PATCH v2 4/6] phy: qcom-qmp: Add SA8775P USB3 UNI phy Shazad Hussain
2023-04-28 19:51   ` Dmitry Baryshkov
2023-04-28 13:08 ` [PATCH v2 5/6] arm64: dts: qcom: sa8775p: add USB nodes Shazad Hussain
2023-04-28 13:08 ` [PATCH v2 6/6] arm64: dts: qcom: sa8775p-ride: enable " Shazad Hussain
2023-05-08  9:30 ` [PATCH v2 0/6] arm64: qcom: sa8775p: add support for USB Vinod Koul
2023-05-15  3:33 ` (subset) " 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).