Skip to contentSkip to conversation

Add USB HS support for SM4250/6115

PATCH In review Iskren Chernev 2 participants 5 messages Jun 27, 2021 – Jul 14, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Add USB HS support for SM4250/6115

The USB controller found on SM4250/6115 is dwc3 (phy v1), very similar to existing supported phys (like msm8996), with slighly different tune seq.

PS1: I know the series is already in usb-next, I can make a new series that will remove the 4250 compat from the existing code (but it would be 3 commits as well), let me know how to proceed.

PS2: I kept the Bjorn Reviewed-by, because I'm only removing the compat string, which he agreed to, in a similar setting https://lkml.org/lkml/2021/6/25/351

v1: https://lkml.org/lkml/2021/6/22/1183

Changes from v1:
- remove 4250 compat, both platforms will share one dtsi

Iskren Chernev (3):
dt-bindings: usb: qcom,dwc3: Add bindings for sm6115
dt-bindings: phy: qcom,qusb2: document sm6115 compatible
phy: qcom-qusb2: Add configuration for SM6115

 .../bindings/phy/qcom,qusb2-phy.yaml          |  1 +
 .../devicetree/bindings/usb/qcom,dwc3.yaml    |  1 +
 drivers/phy/qualcomm/phy-qcom-qusb2.c         | 31 +++++++++++++++++++
 3 files changed, 33 insertions(+)

base-commit: e71e3a48a7e89fa71fb70bf4602367528864d2ff

Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 1/3 dt-bindings: usb: qcom,dwc3: Add bindings for sm6115

Add the compatible string for SM4250/6115 SoC from Qualcomm.

---
 Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/usb/qcom,dwc3.yaml +1 -0
index 413299b5fe2b..938b1137fac0 100644
@@ -19,6 +19,7 @@ properties:
           - qcom,sc7280-dwc3
           - qcom,sdm845-dwc3
           - qcom,sdx55-dwc3
+          - qcom,sm6115-dwc3
           - qcom,sm8150-dwc3
           - qcom,sm8250-dwc3
           - qcom,sm8350-dwc3
Signature · 7 lines
2.32.0


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
#2 lore raw

PATCH v2 2/3 dt-bindings: phy: qcom,qusb2: document sm6115 compatible

In reply to Iskren Chernev

This compatible string is for the HS USB PHY on sm4250/6115 platforms.

---
 Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml +1 -0
index 9f9cf07b7d45..3110d3a0331b 100644
@@ -23,6 +23,7 @@ properties:
               - qcom,msm8998-qusb2-phy
               - qcom,sdm660-qusb2-phy
               - qcom,ipq6018-qusb2-phy
+              - qcom,sm6115-qusb2-phy
       - items:
           - enum:
               - qcom,sc7180-qusb2-phy
Signature · 1 line
2.32.0
#4 lore raw

PATCH v2 3/3 phy: qcom-qusb2: Add configuration for SM6115

In reply to Iskren Chernev

The SM4250/6115 uses the same register layout as MSM8996, but the tune sequence is a bit different.

---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +31 -0
index 8f1bf7e2186b..51e5478ea7f0 100644
@@ -219,6 +219,22 @@ static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
 };
 
+static const struct qusb2_phy_init_tbl sm6115_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE1, 0xf8),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x53),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE3, 0x81),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE4, 0x17),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_TUNE, 0x30),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL1, 0x79),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL2, 0x21),
+
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TEST2, 0x14),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_AUTOPGM_CTL1, 0x9f),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
+};
+
 static const unsigned int qusb2_v2_regs_layout[] = {
 	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
 	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -342,6 +358,18 @@ static const struct qusb2_phy_cfg sdm660_phy_cfg = {
 	.autoresume_en	 = BIT(3),
 };
 
+static const struct qusb2_phy_cfg sm6115_phy_cfg = {
+	.tbl		= sm6115_init_tbl,
+	.tbl_num	= ARRAY_SIZE(sm6115_init_tbl),
+	.regs		= msm8996_regs_layout,
+
+	.has_pll_test	= true,
+	.se_clk_scheme_default = true,
+	.disable_ctrl	= (CLAMP_N_EN | FREEZIO_N | POWER_DOWN),
+	.mask_core_ready = PLL_LOCKED,
+	.autoresume_en	 = BIT(3),
+};
+
 static const char * const qusb2_phy_vreg_names[] = {
 	"vdda-pll", "vdda-phy-dpdm",
 };
@@ -888,6 +916,9 @@ static const struct of_device_id qusb2_phy_of_match_table[] = {
 	}, {
 		.compatible	= "qcom,sdm660-qusb2-phy",
 		.data		= &sdm660_phy_cfg,
+	}, {
+		.compatible	= "qcom,sm6115-qusb2-phy",
+		.data		= &sm6115_phy_cfg,
 	}, {
 		/*
 		 * Deprecated. Only here to support legacy device
Signature · 1 line
2.32.0