Skip to contentSkip to conversation

phy: qcom-qusb2: Add QUSB2 PHY support for msm8998

PATCH Superseded Jeffrey Hugo 3 participants 7 messages Jan 14, 2019 – Jan 17, 2019

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/6 phy: qcom-qusb2: Add QUSB2 PHY support for msm8998

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 41 +++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +41 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
 };
 
+static const unsigned int msm8998_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]              = 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]              = 0x23c,
+	[QUSB2PHY_PORT_TUNE2]              = 0x240,
+	[QUSB2PHY_PORT_TUNE3]              = 0x244,
+	[QUSB2PHY_PORT_TUNE4]              = 0x248,
+	[QUSB2PHY_PORT_TEST1]              = 0x24c,
+	[QUSB2PHY_PORT_TEST2]              = 0x250,
+	[QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+	[QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+	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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
 static const unsigned int sdm845_regs_layout[] = {
 	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
 	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
 	.autoresume_en	 = BIT(3),
 };
 
+static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+	.tbl            = msm8998_init_tbl,
+	.tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+	.regs           = msm8998_regs_layout,
+
+	.disable_ctrl   = POWER_DOWN,
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en   = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
 static const struct qusb2_phy_cfg sdm845_phy_cfg = {
 	.tbl		= sdm845_init_tbl,
 	.tbl_num	= ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
 		.compatible	= "qcom,msm8996-qusb2-phy",
 		.data		= &msm8996_phy_cfg,
 	}, {
+		.compatible	= "qcom,msm8998-qusb2-phy",
+		.data		= &msm8998_phy_cfg,
+	}, {
 		.compatible	= "qcom,sdm845-qusb2-phy",
 		.data		= &sdm845_phy_cfg,
 	},
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
Reviewed-by on v2 3/6
#1 lore raw
Quoted 3 lines · Jeffrey Hugo

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

Quoted 76 lines
---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 41 +++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +41 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
 };
 
+static const unsigned int msm8998_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]              = 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]              = 0x23c,
+	[QUSB2PHY_PORT_TUNE2]              = 0x240,
+	[QUSB2PHY_PORT_TUNE3]              = 0x244,
+	[QUSB2PHY_PORT_TUNE4]              = 0x248,
+	[QUSB2PHY_PORT_TEST1]              = 0x24c,
+	[QUSB2PHY_PORT_TEST2]              = 0x250,
+	[QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+	[QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+	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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
 static const unsigned int sdm845_regs_layout[] = {
 	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
 	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
 	.autoresume_en	 = BIT(3),
 };
 
+static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+	.tbl            = msm8998_init_tbl,
+	.tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+	.regs           = msm8998_regs_layout,
+
+	.disable_ctrl   = POWER_DOWN,
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en   = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
 static const struct qusb2_phy_cfg sdm845_phy_cfg = {
 	.tbl		= sdm845_init_tbl,
 	.tbl_num	= ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
 		.compatible	= "qcom,msm8996-qusb2-phy",
 		.data		= &msm8996_phy_cfg,
 	}, {
+		.compatible	= "qcom,msm8998-qusb2-phy",
+		.data		= &msm8998_phy_cfg,
+	}, {
 		.compatible	= "qcom,sdm845-qusb2-phy",
 		.data		= &sdm845_phy_cfg,
 	},
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#2 lore raw
Quoted 6 lines · Bjorn Andersson
Quoted 3 lines · Jeffrey Hugo

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

I don't seem to have the dt-binding patch in my inbox. Can you send them as well?

Thanks
Kishon

Quoted 78 lines
Quoted 76 lines
---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 41 +++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +41 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
 };
 
+static const unsigned int msm8998_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]              = 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]              = 0x23c,
+	[QUSB2PHY_PORT_TUNE2]              = 0x240,
+	[QUSB2PHY_PORT_TUNE3]              = 0x244,
+	[QUSB2PHY_PORT_TUNE4]              = 0x248,
+	[QUSB2PHY_PORT_TEST1]              = 0x24c,
+	[QUSB2PHY_PORT_TEST2]              = 0x250,
+	[QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+	[QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+	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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
 static const unsigned int sdm845_regs_layout[] = {
 	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
 	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
 	.autoresume_en	 = BIT(3),
 };
 
+static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+	.tbl            = msm8998_init_tbl,
+	.tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+	.regs           = msm8998_regs_layout,
+
+	.disable_ctrl   = POWER_DOWN,
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en   = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
 static const struct qusb2_phy_cfg sdm845_phy_cfg = {
 	.tbl		= sdm845_init_tbl,
 	.tbl_num	= ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
 		.compatible	= "qcom,msm8996-qusb2-phy",
 		.data		= &msm8996_phy_cfg,
 	}, {
+		.compatible	= "qcom,msm8998-qusb2-phy",
+		.data		= &msm8998_phy_cfg,
+	}, {
 		.compatible	= "qcom,sdm845-qusb2-phy",
 		.data		= &sdm845_phy_cfg,
 	},
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#3 lore raw

Hi,

Quoted 10 lines · Kishon Vijay Abraham I
Quoted 6 lines · Bjorn Andersson
Quoted 3 lines · Jeffrey Hugo

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

I don't seem to have the dt-binding patch in my inbox. Can you send them as well?

Ignore my request. I found the patch.

Thanks
Kishon

Quoted 81 lines

Thanks
Kishon

Quoted 78 lines
Quoted 76 lines
---
 drivers/phy/qualcomm/phy-qcom-qusb2.c | 41 +++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +41 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
 	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
 };
 
+static const unsigned int msm8998_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]              = 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]              = 0x23c,
+	[QUSB2PHY_PORT_TUNE2]              = 0x240,
+	[QUSB2PHY_PORT_TUNE3]              = 0x244,
+	[QUSB2PHY_PORT_TUNE4]              = 0x248,
+	[QUSB2PHY_PORT_TEST1]              = 0x24c,
+	[QUSB2PHY_PORT_TEST2]              = 0x250,
+	[QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+	[QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+	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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
 static const unsigned int sdm845_regs_layout[] = {
 	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
 	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
 	.autoresume_en	 = BIT(3),
 };
 
+static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+	.tbl            = msm8998_init_tbl,
+	.tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+	.regs           = msm8998_regs_layout,
+
+	.disable_ctrl   = POWER_DOWN,
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en   = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
 static const struct qusb2_phy_cfg sdm845_phy_cfg = {
 	.tbl		= sdm845_init_tbl,
 	.tbl_num	= ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
 		.compatible	= "qcom,msm8996-qusb2-phy",
 		.data		= &msm8996_phy_cfg,
 	}, {
+		.compatible	= "qcom,msm8998-qusb2-phy",
+		.data		= &msm8998_phy_cfg,
+	}, {
 		.compatible	= "qcom,sdm845-qusb2-phy",
 		.data		= &sdm845_phy_cfg,
 	},
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#4 lore raw
Quoted 8 lines · Kishon Vijay Abraham I

Hi,

Quoted 5 lines · Kishon Vijay Abraham I
Quoted 2 lines · Bjorn Andersson

On Mon 14 Jan 08:36 PST 2019, Jeffrey Hugo wrote:

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

I don't seem to have the dt-binding patch in my inbox. Can you send them as well?

Ignore my request. I found the patch.

Sorry about that. I was made aware there is something glitched when sending this out, and the series didn't get threaded properly. I'll be investigating and correcting for the next time I need to send out a series.

Is this change acceptable? I saw you picked up patch 1 (phy bindings) and patch 4 (QMP phy changes), but not this one. I do want to see as much of this hit 5.1 as possible, so if there is anything I need to correct, please let me know. I'd be happy to update.

Quoted 85 lines

Thanks
Kishon

Quoted 81 lines

Thanks
Kishon

Quoted 78 lines
Quoted 76 lines
---
  drivers/phy/qualcomm/phy-qcom-qusb2.c | 41 +++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +41 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
  	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
  };
 
+static const unsigned int msm8998_regs_layout[] = {
+	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+	[QUSB2PHY_PLL_STATUS]              = 0x1a0,
+	[QUSB2PHY_PORT_TUNE1]              = 0x23c,
+	[QUSB2PHY_PORT_TUNE2]              = 0x240,
+	[QUSB2PHY_PORT_TUNE3]              = 0x244,
+	[QUSB2PHY_PORT_TUNE4]              = 0x248,
+	[QUSB2PHY_PORT_TEST1]              = 0x24c,
+	[QUSB2PHY_PORT_TEST2]              = 0x250,
+	[QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+	[QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+	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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+	QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+	QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
  static const unsigned int sdm845_regs_layout[] = {
  	[QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
  	[QUSB2PHY_PLL_STATUS]		= 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
  	.autoresume_en	 = BIT(3),
  };
 
+static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+	.tbl            = msm8998_init_tbl,
+	.tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+	.regs           = msm8998_regs_layout,
+
+	.disable_ctrl   = POWER_DOWN,
+	.mask_core_ready = CORE_READY_STATUS,
+	.has_pll_override = true,
+	.autoresume_en   = BIT(0),
+	.update_tune1_with_efuse = true,
+};
+
  static const struct qusb2_phy_cfg sdm845_phy_cfg = {
  	.tbl		= sdm845_init_tbl,
  	.tbl_num	= ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
  		.compatible	= "qcom,msm8996-qusb2-phy",
  		.data		= &msm8996_phy_cfg,
  	}, {
+		.compatible	= "qcom,msm8998-qusb2-phy",
+		.data		= &msm8998_phy_cfg,
+	}, {
  		.compatible	= "qcom,sdm845-qusb2-phy",
  		.data		= &sdm845_phy_cfg,
  	},
Signature · 3 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
Signature · 4 lines
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
#5 lore raw

Hi,

Quoted 18 lines · Jeffrey Hugo
Quoted 8 lines · Kishon Vijay Abraham I

Hi,

Quoted 5 lines · Kishon Vijay Abraham I
Quoted 2 lines · Bjorn Andersson

On Mon 14 Jan 08:36 PST 2019, Jeffrey Hugo wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

I don't seem to have the dt-binding patch in my inbox. Can you send them as well?

Ignore my request. I found the patch.

Quoted 8 lines

Sorry about that.  I was made aware there is something glitched when sending this out, and the series didn't get threaded properly.  I'll be investigating and correcting for the next time I need to send out a series.

Is this change acceptable?  I saw you picked up patch 1 (phy bindings) and patch 4 (QMP phy changes), but not this one.  I do want to see as much of this hit 5.1 as possible, so if there is anything I need to correct, please let me know.  I'd be happy to update.

I've updated the tree now. Can you check if everything looks alright w.r.t your patches?

Thanks
Kishon

Quoted 89 lines
Quoted 87 lines

Thanks
Kishon

Quoted 82 lines

Thanks
Kishon

Quoted 79 lines
Quoted 77 lines

---
  drivers/phy/qualcomm/phy-qcom-qusb2.c | 41
+++++++++++++++++++++++++++++++++++

  1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +39 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
       QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
   };
   +static const unsigned int msm8998_regs_layout[] = {
+    [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+    [QUSB2PHY_PLL_STATUS]              = 0x1a0,
+    [QUSB2PHY_PORT_TUNE1]              = 0x23c,
+    [QUSB2PHY_PORT_TUNE2]              = 0x240,
+    [QUSB2PHY_PORT_TUNE3]              = 0x244,
+    [QUSB2PHY_PORT_TUNE4]              = 0x248,
+    [QUSB2PHY_PORT_TEST1]              = 0x24c,
+    [QUSB2PHY_PORT_TEST2]              = 0x250,
+    [QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+    [QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+    QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+    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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+    QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+    QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
   static const unsigned int sdm845_regs_layout[] = {
       [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
       [QUSB2PHY_PLL_STATUS]        = 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
       .autoresume_en     = BIT(3),
   };
   +static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+    .tbl            = msm8998_init_tbl,
+    .tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+    .regs           = msm8998_regs_layout,
+
+    .disable_ctrl   = POWER_DOWN,
+    .mask_core_ready = CORE_READY_STATUS,
+    .has_pll_override = true,
+    .autoresume_en   = BIT(0),
+    .update_tune1_with_efuse = true,
+};
+
   static const struct qusb2_phy_cfg sdm845_phy_cfg = {
       .tbl        = sdm845_init_tbl,
       .tbl_num    = ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
           .compatible    = "qcom,msm8996-qusb2-phy",
           .data        = &msm8996_phy_cfg,
       }, {
+        .compatible    = "qcom,msm8998-qusb2-phy",
+        .data        = &msm8998_phy_cfg,
+    }, {
           .compatible    = "qcom,sdm845-qusb2-phy",
           .data        = &sdm845_phy_cfg,
       },

--
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

#6 lore raw
Quoted 25 lines · Kishon Vijay Abraham I

Hi,

Quoted 22 lines · Jeffrey Hugo
Quoted 8 lines · Kishon Vijay Abraham I

Hi,

Quoted 5 lines · Kishon Vijay Abraham I
Quoted 2 lines · Bjorn Andersson

On Mon 14 Jan 08:36 PST 2019, Jeffrey Hugo wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

MSM8998 contains one QUSB2 PHY which is very similar to the existing sdm845 support.

I don't seem to have the dt-binding patch in my inbox. Can you send them as well?

Ignore my request. I found the patch.

Sorry about that.  I was made aware there is something glitched when sending this out, and the series didn't get threaded properly.  I'll be investigating and correcting for the next time I need to send out a series.

Quoted 7 lines
Quoted 4 lines

Is this change acceptable?  I saw you picked up patch 1 (phy bindings) and patch 4 (QMP phy changes), but not this one.  I do want to see as much of this hit 5.1 as possible, so if there is anything I need to correct, please let me know.  I'd be happy to update.

I've updated the tree now. Can you check if everything looks alright w.r.t your patches?

Looks great. Thank you very much for taking all the phy changes.

Quoted 92 lines

Thanks
Kishon

Quoted 89 lines
Quoted 87 lines

Thanks
Kishon

Quoted 82 lines

Thanks
Kishon

Quoted 79 lines
Quoted 77 lines
---
   drivers/phy/qualcomm/phy-qcom-qusb2.c | 41
+++++++++++++++++++++++++++++++++++
   1 file changed, 41 insertions(+)
drivers/phy/qualcomm/phy-qcom-qusb2.c +39 -0
index 9177989f..e5e4f36 100644
@@ -152,6 +152,32 @@ enum qusb2phy_reg_layout {
       QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00),
   };
   +static const unsigned int msm8998_regs_layout[] = {
+    [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
+    [QUSB2PHY_PLL_STATUS]              = 0x1a0,
+    [QUSB2PHY_PORT_TUNE1]              = 0x23c,
+    [QUSB2PHY_PORT_TUNE2]              = 0x240,
+    [QUSB2PHY_PORT_TUNE3]              = 0x244,
+    [QUSB2PHY_PORT_TUNE4]              = 0x248,
+    [QUSB2PHY_PORT_TEST1]              = 0x24c,
+    [QUSB2PHY_PORT_TEST2]              = 0x250,
+    [QUSB2PHY_PORT_POWERDOWN]          = 0x210,
+    [QUSB2PHY_INTR_CTRL]               = 0x22c,
+};
+
+static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = {
+    QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x13),
+    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_L(QUSB2PHY_PORT_TUNE1, 0xa5),
+    QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x09),
+
+    QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19),
+};
+
+
   static const unsigned int sdm845_regs_layout[] = {
       [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8,
       [QUSB2PHY_PLL_STATUS]        = 0x1a0,
@@ -221,6 +247,18 @@ struct qusb2_phy_cfg {
       .autoresume_en     = BIT(3),
   };
   +static const struct qusb2_phy_cfg msm8998_phy_cfg = {
+    .tbl            = msm8998_init_tbl,
+    .tbl_num        = ARRAY_SIZE(msm8998_init_tbl),
+    .regs           = msm8998_regs_layout,
+
+    .disable_ctrl   = POWER_DOWN,
+    .mask_core_ready = CORE_READY_STATUS,
+    .has_pll_override = true,
+    .autoresume_en   = BIT(0),
+    .update_tune1_with_efuse = true,
+};
+
   static const struct qusb2_phy_cfg sdm845_phy_cfg = {
       .tbl        = sdm845_init_tbl,
       .tbl_num    = ARRAY_SIZE(sdm845_init_tbl),
@@ -734,6 +772,9 @@ static int qusb2_phy_exit(struct phy *phy)
           .compatible    = "qcom,msm8996-qusb2-phy",
           .data        = &msm8996_phy_cfg,
       }, {
+        .compatible    = "qcom,msm8998-qusb2-phy",
+        .data        = &msm8998_phy_cfg,
+    }, {
           .compatible    = "qcom,sdm845-qusb2-phy",
           .data        = &sdm845_phy_cfg,
       },
Signature · 4 lines
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies,
Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
Signature · 4 lines
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.