devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add QUSB2 PHY support for SC7180
@ 2019-10-31  5:38 Sandeep Maheswaram
  2019-10-31  5:38 ` [PATCH 1/2] phy: qcom-qusb2: " Sandeep Maheswaram
  2019-10-31  5:38 ` [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support Sandeep Maheswaram
  0 siblings, 2 replies; 4+ messages in thread
From: Sandeep Maheswaram @ 2019-10-31  5:38 UTC (permalink / raw)
  To: Andy Gross, Kishon Vijay Abraham I, Rob Herring, Mark Rutland
  Cc: linux-arm-msm, devicetree, Manu Gautam, Sandeep Maheswaram

Add QUSB2 PHY support for SC7180 in phy driver and
device tree bindings

Sandeep Maheswaram (2):
  phy: qcom-qusb2: Add QUSB2 PHY support for SC7180
  dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support

 .../devicetree/bindings/phy/qcom-qusb2-phy.txt     |  9 ++--
 drivers/phy/qualcomm/phy-qcom-qusb2.c              | 53 +++++++++++++++++++++-
 2 files changed, 57 insertions(+), 5 deletions(-)

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 1/2] phy: qcom-qusb2: Add QUSB2 PHY support for SC7180
  2019-10-31  5:38 [PATCH 0/2] Add QUSB2 PHY support for SC7180 Sandeep Maheswaram
@ 2019-10-31  5:38 ` Sandeep Maheswaram
  2019-10-31  5:38 ` [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support Sandeep Maheswaram
  1 sibling, 0 replies; 4+ messages in thread
From: Sandeep Maheswaram @ 2019-10-31  5:38 UTC (permalink / raw)
  To: Andy Gross, Kishon Vijay Abraham I, Rob Herring, Mark Rutland
  Cc: linux-arm-msm, devicetree, Manu Gautam, Sandeep Maheswaram

Add QUSB2 PHY config data and compatible for SC7180.

Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org>
---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 53 ++++++++++++++++++++++++++++++++++-
 1 file changed, 52 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c
index bf94a52..929875c 100644
--- a/drivers/phy/qualcomm/phy-qcom-qusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
  */
 
 #include <linux/clk.h>
@@ -212,6 +212,41 @@ static const struct qusb2_phy_init_tbl sdm845_init_tbl[] = {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_CHG_CTRL2, 0x0),
 };
 
+static const unsigned int sc7180_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]		= 0x240,
+	[QUSB2PHY_PORT_TUNE2]		= 0x244,
+	[QUSB2PHY_PORT_TUNE3]		= 0x248,
+	[QUSB2PHY_PORT_TUNE4]		= 0x24c,
+	[QUSB2PHY_PORT_TUNE5]		= 0x250,
+	[QUSB2PHY_PORT_TEST1]		= 0x254,
+	[QUSB2PHY_PORT_TEST2]		= 0x258,
+	[QUSB2PHY_PORT_POWERDOWN]	= 0x210,
+	[QUSB2PHY_INTR_CTRL]		= 0x230,
+};
+
+static const struct qusb2_phy_init_tbl sc7180_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x03),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CLOCK_INVERTERS, 0x7c),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CMODE, 0x80),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_LOCK_DELAY, 0x0a),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_BIAS_CONTROL_1, 0x40),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_BIAS_CONTROL_2, 0x22),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PWR_CTRL2, 0x21),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_IMP_CTRL1, 0x08),
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_IMP_CTRL2, 0x58),
+
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE1, 0xc5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x29),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE3, 0xca),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE4, 0x04),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE5, 0x03),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_CHG_CTRL2, 0x30),
+};
+
 struct qusb2_phy_cfg {
 	const struct qusb2_phy_init_tbl *tbl;
 	/* number of entries in the table */
@@ -271,6 +306,19 @@ static const struct qusb2_phy_cfg sdm845_phy_cfg = {
 	.update_tune1_with_efuse = true,
 };
 
+static const struct qusb2_phy_cfg sc7180_phy_cfg = {
+	.tbl		= sc7180_init_tbl,
+	.tbl_num	= ARRAY_SIZE(sc7180_init_tbl),
+	.regs		= sc7180_regs_layout,
+
+	.disable_ctrl	= (PWR_CTRL1_VREF_SUPPLY_TRIM | PWR_CTRL1_CLAMP_N_EN |
+			   POWER_DOWN),
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en	  = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
 static const char * const qusb2_phy_vreg_names[] = {
 	"vdda-pll", "vdda-phy-dpdm",
 };
@@ -776,6 +824,9 @@ static const struct of_device_id qusb2_phy_of_match_table[] = {
 	}, {
 		.compatible	= "qcom,sdm845-qusb2-phy",
 		.data		= &sdm845_phy_cfg,
+	}, {
+		.compatible	= "qcom,sc7180-qusb2-phy",
+		.data		= &sc7180_phy_cfg,
 	},
 	{ },
 };
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support
  2019-10-31  5:38 [PATCH 0/2] Add QUSB2 PHY support for SC7180 Sandeep Maheswaram
  2019-10-31  5:38 ` [PATCH 1/2] phy: qcom-qusb2: " Sandeep Maheswaram
@ 2019-10-31  5:38 ` Sandeep Maheswaram
  2019-11-04 21:50   ` Stephen Boyd
  1 sibling, 1 reply; 4+ messages in thread
From: Sandeep Maheswaram @ 2019-10-31  5:38 UTC (permalink / raw)
  To: Andy Gross, Kishon Vijay Abraham I, Rob Herring, Mark Rutland
  Cc: linux-arm-msm, devicetree, Manu Gautam, Sandeep Maheswaram

Add QUSB2 phy entries for SC7180 in device tree bindings.

Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org>
---
 Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt b/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
index fe29f9e..d46fca7 100644
--- a/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
+++ b/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
@@ -8,6 +8,7 @@ Required properties:
 	       "qcom,msm8996-qusb2-phy" for 14nm PHY on msm8996,
 	       "qcom,msm8998-qusb2-phy" for 10nm PHY on msm8998,
 	       "qcom,sdm845-qusb2-phy" for 10nm PHY on sdm845.
+	       "qcom,sc7180-qusb2-phy" for 8nm PHY on sc7180.
 
  - reg: offset and length of the PHY register set.
  - #phy-cells: must be 0.
@@ -31,23 +32,23 @@ Optional properties:
  - qcom,imp-res-offset-value: It is a 6 bit value that specifies offset to be
 		added to PHY refgen RESCODE via IMP_CTRL1 register. It is a PHY
 		tuning parameter that may vary for different boards of same SOC.
-		This property is applicable to only QUSB2 v2 PHY (sdm845).
+		This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
  - qcom,hstx-trim-value: It is a 4 bit value that specifies tuning for HSTX
 		output current.
 		Possible range is - 15mA to 24mA (stepsize of 600 uA).
 		See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
-		This property is applicable to only QUSB2 v2 PHY (sdm845).
+		This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
 		Default value is 22.2mA for sdm845.
  - qcom,preemphasis-level: It is a 2 bit value that specifies pre-emphasis level.
 		Possible range is 0 to 15% (stepsize of 5%).
 		See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
-		This property is applicable to only QUSB2 v2 PHY (sdm845).
+		This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
 		Default value is 10% for sdm845.
 - qcom,preemphasis-width: It is a 1 bit value that specifies how long the HSTX
 		pre-emphasis (specified using qcom,preemphasis-level) must be in
 		effect. Duration could be half-bit of full-bit.
 		See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
-		This property is applicable to only QUSB2 v2 PHY (sdm845).
+		This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
 		Default value is full-bit width for sdm845.
 
 Example:
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


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

* Re: [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support
  2019-10-31  5:38 ` [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support Sandeep Maheswaram
@ 2019-11-04 21:50   ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2019-11-04 21:50 UTC (permalink / raw)
  To: Andy Gross, Kishon Vijay Abraham I, Mark Rutland, Rob Herring,
	Sandeep Maheswaram
  Cc: linux-arm-msm, devicetree, Manu Gautam, Sandeep Maheswaram

Quoting Sandeep Maheswaram (2019-10-30 22:38:07)
> Add QUSB2 phy entries for SC7180 in device tree bindings.
> 
> Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org>
> ---
>  Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Can you convert this binding to YAML? It may make it easier to
understand what compatibles have certain properties.

> 
> diff --git a/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt b/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
> index fe29f9e..d46fca7 100644
> --- a/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/qcom-qusb2-phy.txt
> @@ -8,6 +8,7 @@ Required properties:
>                "qcom,msm8996-qusb2-phy" for 14nm PHY on msm8996,
>                "qcom,msm8998-qusb2-phy" for 10nm PHY on msm8998,
>                "qcom,sdm845-qusb2-phy" for 10nm PHY on sdm845.
> +              "qcom,sc7180-qusb2-phy" for 8nm PHY on sc7180.

Please sort compatible string here.

>  
>   - reg: offset and length of the PHY register set.
>   - #phy-cells: must be 0.
> @@ -31,23 +32,23 @@ Optional properties:
>   - qcom,imp-res-offset-value: It is a 6 bit value that specifies offset to be
>                 added to PHY refgen RESCODE via IMP_CTRL1 register. It is a PHY
>                 tuning parameter that may vary for different boards of same SOC.
> -               This property is applicable to only QUSB2 v2 PHY (sdm845).
> +               This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).

Put a space after that comma please.

>   - qcom,hstx-trim-value: It is a 4 bit value that specifies tuning for HSTX
>                 output current.
>                 Possible range is - 15mA to 24mA (stepsize of 600 uA).
>                 See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
> -               This property is applicable to only QUSB2 v2 PHY (sdm845).
> +               This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
>                 Default value is 22.2mA for sdm845.
>   - qcom,preemphasis-level: It is a 2 bit value that specifies pre-emphasis level.
>                 Possible range is 0 to 15% (stepsize of 5%).
>                 See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
> -               This property is applicable to only QUSB2 v2 PHY (sdm845).
> +               This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
>                 Default value is 10% for sdm845.
>  - qcom,preemphasis-width: It is a 1 bit value that specifies how long the HSTX
>                 pre-emphasis (specified using qcom,preemphasis-level) must be in
>                 effect. Duration could be half-bit of full-bit.
>                 See dt-bindings/phy/phy-qcom-qusb2.h for applicable values.
> -               This property is applicable to only QUSB2 v2 PHY (sdm845).
> +               This property is applicable to only QUSB2 v2 PHY (sdm845,sc7180).
>                 Default value is full-bit width for sdm845.
>  

Same comment.


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

end of thread, other threads:[~2019-11-04 21:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31  5:38 [PATCH 0/2] Add QUSB2 PHY support for SC7180 Sandeep Maheswaram
2019-10-31  5:38 ` [PATCH 1/2] phy: qcom-qusb2: " Sandeep Maheswaram
2019-10-31  5:38 ` [PATCH 2/2] dt-bindings: phy-qcom-qusb2: Add SC7180 QUSB2 phy support Sandeep Maheswaram
2019-11-04 21:50   ` Stephen Boyd

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).