From: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
To: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Wesley Cheng <quic_wcheng@quicinc.com>,
Manu Gautam <mgautam@codeaurora.org>,
Stephen Boyd <sboyd@kernel.org>,
Philipp Zabel <pza@pengutronix.de>
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Subject: [PATCH v2 5/5] phy: qcom: snps-femto-v2: Add IPQ9650 support
Date: Tue, 01 Sep 2026 11:34:23 +0530 [thread overview]
Message-ID: <20260901-phy-v2-5-cc93d2f3b1bf@oss.qualcomm.com> (raw)
In-Reply-To: <20260901-phy-v2-0-cc93d2f3b1bf@oss.qualcomm.com>
Add the 6 nm SNPS femto USB2 PHY configuration needed by IPQ9650. The PHYs
on this SoC require a dedicated init sequence and override parameters
before they can be enabled.
Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 62 +++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
index b6bbf2b570c7..8957f208bc51 100644
--- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
+++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
@@ -29,12 +29,15 @@
#define USB2_PHY_USB_PHY_UTMI_CTRL5 (0x50)
#define POR BIT(1)
+#define ATERESET BIT(0)
#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54)
#define SIDDQ BIT(2)
#define RETENABLEN BIT(3)
#define FSEL_MASK GENMASK(6, 4)
#define FSEL_DEFAULT (0x3 << 4)
+#define FSEL_24MHZ (0x2 << 4)
+#define VATESTENB_MASK GENMASK(1, 0)
#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 (0x58)
#define VBUSVLDEXTSEL0 BIT(4)
@@ -57,6 +60,13 @@
#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X3 (0x78)
#define PARAM_OVRD_MASK 0xFF
+#define USB2_PHY_USB_PHY_HS_PHY_TEST0 0x80
+#define TESTDATAIN_MASK GENMASK(7, 0)
+
+#define USB2_PHY_USB_PHY_HS_PHY_TEST1 0x84
+#define TESTDATAOUTSEL BIT(4)
+#define TESTCLK BIT(6)
+
#define USB2_PHY_USB_PHY_CFG0 (0x94)
#define UTMI_PHY_DATAPATH_CTRL_OVERRIDE_EN BIT(0)
#define UTMI_PHY_CMN_CTRL_OVERRIDE_EN BIT(1)
@@ -78,6 +88,9 @@
#define LS_FS_OUTPUT_IMPEDANCE_MASK GENMASK(3, 0)
+#define USB2_PHY_USB_PHY_FSEL_SEL 0xb8
+#define FSEL_SEL BIT(0)
+
static const char * const qcom_snps_hsphy_vreg_names[] = {
"vdda-pll", "vdda33", "vdda18",
};
@@ -330,6 +343,17 @@ static const struct override_param ls_fs_output_impedance_sc7280[] = {
{ 1310, 0 },
};
+static const struct override_param_map ipq9650_snps_6nm_phy[] = {
+ {
+ "qcom,pre-emphasis-amplitude-bp",
+ preemphasis_amplitude_sc7280,
+ ARRAY_SIZE(preemphasis_amplitude_sc7280),
+ USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X1,
+ PREEMPHASIS_AMPLITUDE_MASK,
+ },
+ {},
+};
+
static const struct override_param_map sc7280_snps_7nm_phy[] = {
{
"qcom,hs-disconnect-bp",
@@ -418,6 +442,32 @@ static const struct phy_reg_config hs_5nm_phy_post_tuning[] = {
{ USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0 },
};
+static const struct phy_reg_config hs_6nm_phy_pre_tuning[] = {
+ { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, UTMI_PHY_CMN_CTRL_OVERRIDE_EN },
+ { USB2_PHY_USB_PHY_UTMI_CTRL5, POR, POR },
+ { USB2_PHY_USB_PHY_FSEL_SEL, FSEL_SEL, FSEL_SEL },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, FSEL_MASK, FSEL_24MHZ },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, PLLBTUNE, PLLBTUNE },
+ { USB2_PHY_USB_PHY_REFCLK_CTRL, REFCLK_SEL_MASK, REFCLK_SEL_DEFAULT },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, VBUSVLDEXTSEL0, VBUSVLDEXTSEL0 },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL1, VBUSVLDEXT0, VBUSVLDEXT0 },
+};
+
+static const struct phy_reg_config hs_6nm_phy_post_tuning[] = {
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2, VREGBYPASS, VREGBYPASS },
+ { USB2_PHY_USB_PHY_UTMI_CTRL5, ATERESET, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_TEST1, TESTDATAOUTSEL, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_TEST1, TESTCLK, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, VATESTENB_MASK, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_TEST0, TESTDATAIN_MASK, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL | USB2_SUSPEND_N,
+ USB2_SUSPEND_N_SEL | USB2_SUSPEND_N },
+ { USB2_PHY_USB_PHY_UTMI_CTRL0, SLEEPM, SLEEPM },
+ { USB2_PHY_USB_PHY_UTMI_CTRL5, POR, 0 },
+ { USB2_PHY_USB_PHY_HS_PHY_CTRL2, USB2_SUSPEND_N_SEL, 0 },
+ { USB2_PHY_USB_PHY_CFG0, UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0 },
+};
+
static int qcom_snps_hsphy_init(struct phy *phy)
{
struct qcom_snps_hsphy *hsphy = phy_get_drvdata(phy);
@@ -507,6 +557,14 @@ static const struct phy_config_data hs_5nm_phy = {
.num_post_tuning = ARRAY_SIZE(hs_5nm_phy_post_tuning),
};
+static const struct phy_config_data hs_6nm_phy = {
+ .pre_tuning = hs_6nm_phy_pre_tuning,
+ .num_pre_tuning = ARRAY_SIZE(hs_6nm_phy_pre_tuning),
+ .override = ipq9650_snps_6nm_phy,
+ .post_tuning = hs_6nm_phy_post_tuning,
+ .num_post_tuning = ARRAY_SIZE(hs_6nm_phy_post_tuning),
+};
+
static const struct phy_config_data hs_7nm_phy = {
.pre_tuning = hs_5nm_phy_pre_tuning,
.num_pre_tuning = ARRAY_SIZE(hs_5nm_phy_pre_tuning),
@@ -524,6 +582,10 @@ static const struct of_device_id qcom_snps_hsphy_of_match_table[] = {
.compatible = "qcom,usb-snps-hs-5nm-phy",
.data = &hs_5nm_phy,
},
+ {
+ .compatible = "qcom,ipq9650-usb-hs-phy",
+ .data = &hs_6nm_phy,
+ },
{
.compatible = "qcom,usb-snps-hs-7nm-phy",
.data = &hs_7nm_phy,
--
2.34.1
prev parent reply other threads:[~2026-09-01 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 6:04 [PATCH v2 0/5] Add support for USB phys in IPQ9650 Varadarajan Narayanan
2026-09-01 6:04 ` [PATCH v2 1/5] dt-bindings: phy: qcom,qmp-usb: Add IPQ9650 USB3 PHY Varadarajan Narayanan
2026-09-01 6:04 ` [PATCH v2 2/5] dt-bindings: phy: qcom,usb-snps-femto-v2: Add IPQ9650 compatible Varadarajan Narayanan
2026-09-03 10:21 ` Krzysztof Kozlowski
2026-09-01 6:04 ` [PATCH v2 3/5] phy: qcom: qmp-usb: Add IPQ9650 USB3 PHY configuration Varadarajan Narayanan
2026-09-03 10:25 ` Abel Vesa
2026-09-01 6:04 ` [PATCH v2 4/5] phy: qcom: snps-femto-v2: Move PHY init registers to config tables Varadarajan Narayanan
2026-09-01 6:04 ` Varadarajan Narayanan [this message]
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=20260901-phy-v2-5-cc93d2f3b1bf@oss.qualcomm.com \
--to=varadarajan.narayanan@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=mani@kernel.org \
--cc=mgautam@codeaurora.org \
--cc=neil.armstrong@linaro.org \
--cc=pza@pengutronix.de \
--cc=quic_wcheng@quicinc.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=vkoul@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
all inboxes | Powered by JetHome®