Linux USB
 help / color / mirror / Atom feed
From: Praveenkumar I <quic_ipkumar@quicinc.com>
To: <robert.marko@sartura.hr>, <luka.perkov@sartura.hr>,
	<quic_ipkumar@quicinc.com>, <agross@kernel.org>,
	<andersson@kernel.org>, <konrad.dybcio@linaro.org>,
	<vkoul@kernel.org>, <kishon@kernel.org>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>,
	<gregkh@linuxfoundation.org>, <catalin.marinas@arm.com>,
	<will@kernel.org>, <p.zabel@pengutronix.de>, <arnd@arndb.de>,
	<geert+renesas@glider.be>, <nfraprado@collabora.com>,
	<rafal@milecki.pl>, <peng.fan@nxp.com>, <quic_wcheng@quicinc.com>,
	<linux-arm-msm@vger.kernel.org>, <linux-phy@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: <quic_varada@quicinc.com>
Subject: [PATCH 8/9] phy: qcom: uniphy: Add ipq5332 USB UNIPHY support
Date: Tue, 29 Aug 2023 19:28:17 +0530	[thread overview]
Message-ID: <20230829135818.2219438-9-quic_ipkumar@quicinc.com> (raw)
In-Reply-To: <20230829135818.2219438-1-quic_ipkumar@quicinc.com>

This patch adds ipq5332 USB SS UNIPHY support.

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
---
This patch depends on the below series which adds support for USB2 in
IPQ5332
https://lore.kernel.org/all/cover.1692699472.git.quic_varada@quicinc.com/

 drivers/phy/qualcomm/phy-qcom-uniphy.c | 37 ++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-uniphy.c b/drivers/phy/qualcomm/phy-qcom-uniphy.c
index eb71588f5417..91487e68bb6e 100644
--- a/drivers/phy/qualcomm/phy-qcom-uniphy.c
+++ b/drivers/phy/qualcomm/phy-qcom-uniphy.c
@@ -26,6 +26,10 @@
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
 
+#define PCIE_USB_COMBO_PHY_CFG_MISC1		0x214
+#define PCIE_USB_COMBO_PHY_CFG_RX_AFE_2		0x7C4
+#define PCIE_USB_COMBO_PHY_CFG_RX_DLF_DEMUX_2	0x7E8
+
 struct uniphy_init_tbl {
 	unsigned int offset;
 	unsigned int val;
@@ -37,6 +41,12 @@ struct uniphy_init_tbl {
 		.val = v,		\
 	}
 
+static const struct uniphy_init_tbl ipq5332_usb_ssphy_init_tbl[] = {
+	UNIPHY_INIT_CFG(PCIE_USB_COMBO_PHY_CFG_RX_AFE_2, 0x1076),
+	UNIPHY_INIT_CFG(PCIE_USB_COMBO_PHY_CFG_RX_DLF_DEMUX_2, 0x3142),
+	UNIPHY_INIT_CFG(PCIE_USB_COMBO_PHY_CFG_MISC1, 0x3),
+};
+
 struct uniphy_cfg {
 	const struct uniphy_init_tbl *init_seq;
 	int num_init_seq;
@@ -83,6 +93,32 @@ static const struct uniphy_cfg ipq4019_usb_hsphy_cfg = {
 	.reset_udelay	= 10000,
 };
 
+static const char * const ipq5332_usb_ssphy_clk_l[] = {
+	"phy_ahb", "phy_cfg_ahb", "pipe",
+};
+
+static const char * const ipq5332_usb_ssphy_reset_l[] = {
+	"por_rst",
+};
+
+static const char * const ipq5332_usb_ssphy_vreg_l[] = {
+	"vdda-phy",
+};
+
+static const struct uniphy_cfg ipq5332_usb_ssphy_cfg = {
+	.init_seq	= ipq5332_usb_ssphy_init_tbl,
+	.num_init_seq	= ARRAY_SIZE(ipq5332_usb_ssphy_init_tbl),
+	.clk_list	= ipq5332_usb_ssphy_clk_l,
+	.num_clks	= ARRAY_SIZE(ipq5332_usb_ssphy_clk_l),
+	.reset_list	= ipq5332_usb_ssphy_reset_l,
+	.num_resets	= ARRAY_SIZE(ipq5332_usb_ssphy_reset_l),
+	.vreg_list	= ipq5332_usb_ssphy_vreg_l,
+	.num_vregs	= ARRAY_SIZE(ipq5332_usb_ssphy_vreg_l),
+	.pipe_clk_rate	= 250000000,
+	.reset_udelay	= 1,
+	.autoload_udelay = 35,
+};
+
 static int phy_mux_sel(struct phy *phy)
 {
 	struct qcom_uniphy *uniphy = phy_get_drvdata(phy);
@@ -396,6 +432,7 @@ static int qcom_uniphy_probe(struct platform_device *pdev)
 static const struct of_device_id qcom_uniphy_of_match[] = {
 	{ .compatible = "qcom,usb-hs-ipq4019-phy", .data = &ipq4019_usb_hsphy_cfg},
 	{ .compatible = "qcom,usb-ss-ipq4019-phy", .data = &ipq4019_usb_ssphy_cfg},
+	{ .compatible = "qcom,ipq5332-usb-ssphy", .data = &ipq5332_usb_ssphy_cfg},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, qcom_uniphy_of_match);
-- 
2.34.1


  parent reply	other threads:[~2023-08-29 14:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 13:58 [PATCH 0/9] Enable USB3 for IPQ5332 Praveenkumar I
2023-08-29 13:58 ` [PATCH 1/9] dt-bindings: phy: qcom,uniphy: Rename ipq4019 usb PHY to UNIPHY Praveenkumar I
2023-08-29 14:19   ` Dmitry Baryshkov
2023-08-31 11:53     ` Praveenkumar I
2023-08-31 12:17       ` Dmitry Baryshkov
2023-08-31 12:29         ` Praveenkumar I
2023-08-31 12:34           ` Dmitry Baryshkov
2023-08-31 12:50             ` Praveenkumar I
2023-08-29 16:53   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 2/9] phy: qcom: uniphy: Rename ipq4019 USB phy driver to UNIPHY driver Praveenkumar I
2023-08-29 16:55   ` Krzysztof Kozlowski
2023-08-31 13:08     ` Praveenkumar I
2023-08-29 13:58 ` [PATCH 3/9] phy: qcom: uniphy: Update UNIPHY driver to be a common driver Praveenkumar I
2023-08-29 14:37   ` Dmitry Baryshkov
2023-08-31 12:05     ` Praveenkumar I
2023-08-29 16:57   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 4/9] dt-bindings: phy: qcom,uniphy: Add ipq5332 USB3 SS UNIPHY Praveenkumar I
2023-08-29 14:16   ` Dmitry Baryshkov
2023-08-29 14:35   ` Rob Herring
2023-08-29 17:08     ` Krzysztof Kozlowski
2023-08-29 18:46       ` Dmitry Baryshkov
2023-08-29 16:16   ` Rob Herring
2023-08-29 16:59   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 5/9] dt-bindings: usb: dwc3: Update IPQ5332 compatible Praveenkumar I
2023-08-29 17:01   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 6/9] arm64: dts: qcom: ipq5332: Add USB3 related nodes Praveenkumar I
2023-08-29 14:46   ` Dmitry Baryshkov
2023-08-29 17:02   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 7/9] arm64: dts: qcom: ipq5332: Enable USB SS UNIPHY Praveenkumar I
2023-08-29 17:03   ` Krzysztof Kozlowski
2023-08-29 13:58 ` Praveenkumar I [this message]
2023-08-29 14:45   ` [PATCH 8/9] phy: qcom: uniphy: Add ipq5332 USB UNIPHY support Dmitry Baryshkov
     [not found]     ` <2ff8ef8e-c7d8-4a02-a764-ef2a3f83e87c@quicinc.com>
2023-08-31 12:21       ` Dmitry Baryshkov
2023-08-29 13:58 ` [PATCH 9/9] arm64: defconfig: Enable UNIPHY driver Praveenkumar I
2023-08-29 17:06   ` Krzysztof Kozlowski
2023-08-29 17:07 ` [PATCH 0/9] Enable USB3 for IPQ5332 Krzysztof Kozlowski
2023-08-31 12:14   ` Praveenkumar I
2023-08-31 12:15   ` Praveenkumar I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230829135818.2219438-9-quic_ipkumar@quicinc.com \
    --to=quic_ipkumar@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luka.perkov@sartura.hr \
    --cc=nfraprado@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=quic_varada@quicinc.com \
    --cc=quic_wcheng@quicinc.com \
    --cc=rafal@milecki.pl \
    --cc=robert.marko@sartura.hr \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox