linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 0/4] Enable IPQ5018 USB2 support
@ 2023-09-04  6:36 Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible Nitheesh Sekar
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Nitheesh Sekar @ 2023-09-04  6:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb
  Cc: Nitheesh Sekar

This patch series adds the relevant phy and controller
DT configurations for enabling USB2 host mode support
on IPQ5018.

Tested with a USB Mass storage device.

Depends on:
Link: https://lore.kernel.org/linux-arm-msm/20230831030503.17100-1-quic_nsekar@quicinc.com/

[V4]:
	Add C99 initializers.
	Write 0 register values.

[V3]:
	Incorporated review comments with respect to
	naming USB related device tree nodes,
	dropped the 0 dealy inits and added the static const
	type for m31_ipq5018_regs.
	Sorted nodes in	board specific device tree file.

[V2]:
	Incorporated review comments regarding splitting the
	series as per subsytem, device tree naming conventions
	and ordereing of the nodes.

Nitheesh Sekar (4):
  dt-bindings: phy: qcom,m31: Add IPQ5018 compatible
  phy: qcom-m31: Add compatible, phy init sequence for IPQ5018
  arm64: dts: qcom: ipq5018: Add USB related nodes
  arm64: dts: qcom: ipq5018: Enable USB

 .../bindings/phy/qcom,ipq5332-usb-hsphy.yaml  |  4 +-
 .../arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts | 12 +++++
 arch/arm64/boot/dts/qcom/ipq5018.dtsi         | 54 +++++++++++++++++++
 drivers/phy/qualcomm/phy-qcom-m31.c           | 51 ++++++++++++++++++
 4 files changed, 120 insertions(+), 1 deletion(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH V4 1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
@ 2023-09-04  6:36 ` Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 2/4] phy: qcom-m31: Add compatible, phy init sequence for IPQ5018 Nitheesh Sekar
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nitheesh Sekar @ 2023-09-04  6:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb
  Cc: Nitheesh Sekar

IPQ5332 qcom,m31 phy driver can support IPQ5018.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Nitheesh Sekar <quic_nsekar@quicinc.com>
---
 .../devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml b/Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml
index 2671a048c926..e77576d06c0e 100644
--- a/Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,ipq5332-usb-hsphy.yaml
@@ -17,7 +17,9 @@ description:
 properties:
   compatible:
     items:
-      - const: qcom,ipq5332-usb-hsphy
+      - enum:
+          - qcom,ipq5018-usb-hsphy
+          - qcom,ipq5332-usb-hsphy
 
   "#phy-cells":
     const: 0
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH V4 2/4] phy: qcom-m31: Add compatible, phy init sequence for IPQ5018
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible Nitheesh Sekar
@ 2023-09-04  6:36 ` Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 3/4] arm64: dts: qcom: ipq5018: Add USB related nodes Nitheesh Sekar
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nitheesh Sekar @ 2023-09-04  6:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb
  Cc: Nitheesh Sekar

Add phy init sequence and compatible string for IPQ5018
chipset.

Signed-off-by: Nitheesh Sekar <quic_nsekar@quicinc.com>
---
V4:
	Add C99 initializers.
	Write 0 register values.
V3:
	Dropped 0 delay inits.
	Added static const type for m31_ipq5018_regs.
V2:
	Updated the commit message.
---
 drivers/phy/qualcomm/phy-qcom-m31.c | 51 +++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-m31.c b/drivers/phy/qualcomm/phy-qcom-m31.c
index ed08072ca032..03b1c56e0f55 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31.c
@@ -82,6 +82,50 @@ struct m31_priv_data {
 	unsigned int			nregs;
 };
 
+static const struct m31_phy_regs m31_ipq5018_regs[] = {
+	{
+		.off = USB_PHY_CFG0,
+		.val = UTMI_PHY_OVERRIDE_EN
+	},
+	{
+		.off = USB_PHY_UTMI_CTRL5,
+		.val = POR_EN,
+		.delay = 15
+	},
+	{
+		.off = USB_PHY_FSEL_SEL,
+		.val = FREQ_SEL
+	},
+	{
+		.off = USB_PHY_HS_PHY_CTRL_COMMON0,
+		.val = COMMONONN | FSEL | RETENABLEN
+	},
+	{
+		.off = USB_PHY_REFCLK_CTRL,
+		.val = CLKCORE
+	},
+	{
+		.off = USB_PHY_UTMI_CTRL5,
+		.val = POR_EN
+	},
+	{
+		.off = USB_PHY_HS_PHY_CTRL2,
+		.val = USB2_SUSPEND_N_SEL | USB2_SUSPEND_N | USB2_UTMI_CLK_EN
+	},
+	{
+		.off = USB_PHY_UTMI_CTRL5,
+		.val = 0x0
+	},
+	{
+		.off = USB_PHY_HS_PHY_CTRL2,
+		.val = USB2_SUSPEND_N | USB2_UTMI_CLK_EN
+	},
+	{
+		.off = USB_PHY_CFG0,
+		.val = 0x0
+	},
+};
+
 struct m31_phy_regs m31_ipq5332_regs[] = {
 	{
 		USB_PHY_CFG0,
@@ -268,6 +312,12 @@ static int m31usb_phy_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(phy_provider);
 }
 
+static const struct m31_priv_data m31_ipq5018_data = {
+	.ulpi_mode = false,
+	.regs = m31_ipq5018_regs,
+	.nregs = ARRAY_SIZE(m31_ipq5018_regs),
+};
+
 static const struct m31_priv_data m31_ipq5332_data = {
 	.ulpi_mode = false,
 	.regs = m31_ipq5332_regs,
@@ -275,6 +325,7 @@ static const struct m31_priv_data m31_ipq5332_data = {
 };
 
 static const struct of_device_id m31usb_phy_id_table[] = {
+	{ .compatible = "qcom,ipq5018-usb-hsphy", .data = &m31_ipq5018_data },
 	{ .compatible = "qcom,ipq5332-usb-hsphy", .data = &m31_ipq5332_data },
 	{ },
 };
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH V4 3/4] arm64: dts: qcom: ipq5018: Add USB related nodes
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 2/4] phy: qcom-m31: Add compatible, phy init sequence for IPQ5018 Nitheesh Sekar
@ 2023-09-04  6:36 ` Nitheesh Sekar
  2023-09-04  6:36 ` [PATCH V4 4/4] arm64: dts: qcom: ipq5018: Enable USB Nitheesh Sekar
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Nitheesh Sekar @ 2023-09-04  6:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb
  Cc: Nitheesh Sekar, Amandeep Singh

Add USB phy and controller nodes.

Co-developed-by: Amandeep Singh <quic_amansing@quicinc.com>
Signed-off-by: Amandeep Singh <quic_amansing@quicinc.com>
Signed-off-by: Nitheesh Sekar <quic_nsekar@quicinc.com>
---
V3:
	Renamed usb2_0_dwc to usb_dwc.
V2:
	Fix ordering of the USB related nodes and use
	generic node names.
---
 arch/arm64/boot/dts/qcom/ipq5018.dtsi | 54 +++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5018.dtsi b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
index 9f13d2dcdfd5..dbd3be82afe3 100644
--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
@@ -93,6 +93,19 @@
 		#size-cells = <1>;
 		ranges = <0 0 0 0xffffffff>;
 
+		usbphy0: phy@5b000 {
+			compatible = "qcom,ipq5018-usb-hsphy";
+			reg = <0x0005b000 0x120>;
+
+			clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>;
+
+			resets = <&gcc GCC_QUSB2_0_PHY_BCR>;
+
+			#phy-cells = <0>;
+
+			status = "disabled";
+		};
+
 		tlmm: pinctrl@1000000 {
 			compatible = "qcom,ipq5018-tlmm";
 			reg = <0x01000000 0x300000>;
@@ -155,6 +168,47 @@
 			status = "disabled";
 		};
 
+		usb: usb@8af8800 {
+			compatible = "qcom,ipq5018-dwc3", "qcom,dwc3";
+			reg = <0x08af8800 0x400>;
+
+			interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "hs_phy_irq";
+
+			clocks = <&gcc GCC_USB0_MASTER_CLK>,
+				 <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
+				 <&gcc GCC_USB0_SLEEP_CLK>,
+				 <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+			clock-names = "core",
+				      "iface",
+				      "sleep",
+				      "mock_utmi";
+
+			resets = <&gcc GCC_USB0_BCR>;
+
+			qcom,select-utmi-as-pipe-clk;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			status = "disabled";
+
+			usb_dwc: usb@8a00000 {
+				compatible = "snps,dwc3";
+				reg = <0x08a00000 0xe000>;
+				clocks = <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+				clock-names = "ref";
+				interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+				phy-names = "usb2-phy";
+				phys = <&usbphy0>;
+				tx-fifo-resize;
+				snps,is-utmi-l1-suspend;
+				snps,hird-threshold = /bits/ 8 <0x0>;
+				snps,dis_u2_susphy_quirk;
+				snps,dis_u3_susphy_quirk;
+			};
+		};
+
 		intc: interrupt-controller@b000000 {
 			compatible = "qcom,msm-qgic2";
 			reg = <0x0b000000 0x1000>,  /* GICD */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* [PATCH V4 4/4] arm64: dts: qcom: ipq5018: Enable USB
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
                   ` (2 preceding siblings ...)
  2023-09-04  6:36 ` [PATCH V4 3/4] arm64: dts: qcom: ipq5018: Add USB related nodes Nitheesh Sekar
@ 2023-09-04  6:36 ` Nitheesh Sekar
  2023-09-21 14:29 ` (subset) [PATCH V4 0/4] Enable IPQ5018 USB2 support Vinod Koul
  2023-10-16 18:25 ` Bjorn Andersson
  5 siblings, 0 replies; 7+ messages in thread
From: Nitheesh Sekar @ 2023-09-04  6:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb
  Cc: Nitheesh Sekar, Amandeep Singh

Enable USB2 in host mode.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Co-developed-by: Amandeep Singh <quic_amansing@quicinc.com>
Signed-off-by: Amandeep Singh <quic_amansing@quicinc.com>
Signed-off-by: Nitheesh Sekar <quic_nsekar@quicinc.com>
---
V3:
	Renamed usb2_0_dwc  to usb_dwc and sorted
	the USB related nodes.
V2:
	Sort and reorder USB related nodes.
---
 arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts b/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts
index e636a1cb9b77..8460b538eb6a 100644
--- a/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts
+++ b/arch/arm64/boot/dts/qcom/ipq5018-rdp432-c2.dts
@@ -67,6 +67,18 @@
 	};
 };
 
+&usb {
+	status = "okay";
+};
+
+&usb_dwc {
+	dr_mode = "host";
+};
+
+&usbphy0 {
+	status = "okay";
+};
+
 &xo_board_clk {
 	clock-frequency = <24000000>;
 };
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: (subset) [PATCH V4 0/4] Enable IPQ5018 USB2 support
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
                   ` (3 preceding siblings ...)
  2023-09-04  6:36 ` [PATCH V4 4/4] arm64: dts: qcom: ipq5018: Enable USB Nitheesh Sekar
@ 2023-09-21 14:29 ` Vinod Koul
  2023-10-16 18:25 ` Bjorn Andersson
  5 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2023-09-21 14:29 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb, Nitheesh Sekar


On Mon, 04 Sep 2023 12:06:31 +0530, Nitheesh Sekar wrote:
> This patch series adds the relevant phy and controller
> DT configurations for enabling USB2 host mode support
> on IPQ5018.
> 
> Tested with a USB Mass storage device.
> 
> Depends on:
> Link: https://lore.kernel.org/linux-arm-msm/20230831030503.17100-1-quic_nsekar@quicinc.com/
> 
> [...]

Applied, thanks!

[1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible
      commit: 76bf09e08667f21bc3d1a8857f542c1ee54d9667
[2/4] phy: qcom-m31: Add compatible, phy init sequence for IPQ5018
      commit: 241da15bd783fd2ae3b2f16817d802102590aa0d

Best regards,
-- 
~Vinod



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

* Re: (subset) [PATCH V4 0/4] Enable IPQ5018 USB2 support
  2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
                   ` (4 preceding siblings ...)
  2023-09-21 14:29 ` (subset) [PATCH V4 0/4] Enable IPQ5018 USB2 support Vinod Koul
@ 2023-10-16 18:25 ` Bjorn Andersson
  5 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2023-10-16 18:25 UTC (permalink / raw)
  To: agross, konrad.dybcio, vkoul, kishon, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, gregkh, quic_srichara,
	quic_varada, quic_wcheng, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, linux-usb, Nitheesh Sekar


On Mon, 04 Sep 2023 12:06:31 +0530, Nitheesh Sekar wrote:
> This patch series adds the relevant phy and controller
> DT configurations for enabling USB2 host mode support
> on IPQ5018.
> 
> Tested with a USB Mass storage device.
> 
> Depends on:
> Link: https://lore.kernel.org/linux-arm-msm/20230831030503.17100-1-quic_nsekar@quicinc.com/
> 
> [...]

Applied, thanks!

[3/4] arm64: dts: qcom: ipq5018: Add USB related nodes
      commit: e7166f2774aafefd29ff26ffbbb7f6d40ac8ea1c
[4/4] arm64: dts: qcom: ipq5018: Enable USB
      commit: 80a438775aa398751229bcaed15459f3acdb645f

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

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

end of thread, other threads:[~2023-10-16 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04  6:36 [PATCH V4 0/4] Enable IPQ5018 USB2 support Nitheesh Sekar
2023-09-04  6:36 ` [PATCH V4 1/4] dt-bindings: phy: qcom,m31: Add IPQ5018 compatible Nitheesh Sekar
2023-09-04  6:36 ` [PATCH V4 2/4] phy: qcom-m31: Add compatible, phy init sequence for IPQ5018 Nitheesh Sekar
2023-09-04  6:36 ` [PATCH V4 3/4] arm64: dts: qcom: ipq5018: Add USB related nodes Nitheesh Sekar
2023-09-04  6:36 ` [PATCH V4 4/4] arm64: dts: qcom: ipq5018: Enable USB Nitheesh Sekar
2023-09-21 14:29 ` (subset) [PATCH V4 0/4] Enable IPQ5018 USB2 support Vinod Koul
2023-10-16 18:25 ` 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).