Skip to contentSkip to conversation

phy: qcom-qmp: Fixes and updates for sm8150

PATCH In review Vinod Koul 3 participants 14 messages Dec 23, 2019 – Jan 3, 2020

Subsystems (2)
lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

v3 cover phy: qcom-qmp: Fixes and updates for sm8150

For SM8150 we need additional SW reset so clear the no_pcs_sw_reset, and add SW reset register. Along with that remove duplicate powerdown write.

Changes in v3:
- Drop patch 1 "phy: qcom-qmp: Increase PHY ready timeout" as that is applied by Kishon
- Drop patch "phy: qcom-qmp: Add optional SW reset" as that is no longer required
- Add "phy: qcom-qmp: Add SW reset register"

Changes in v2:
- Drop patch 1 and pick the one Bjorn had already sent, makes timeout 10ms
- Fix optional reset write as pointed by Can
- Fix register define as pointed by Can

Vinod Koul (4):
phy: qcom-qmp: Use register defines
phy: qcom-qmp: remove duplicate powerdown write
phy: qcom-qmp: remove no_pcs_sw_reset for sm8150
phy: qcom-qmp: Add SW reset register

 drivers/phy/qualcomm/phy-qcom-qmp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH v3 1/4 phy: qcom-qmp: Use register defines

We already define register offsets so use them in register layout.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +2 -2
index 66f91726b8b2..1196c85aa023 100644
@@ -166,8 +166,8 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = {
 };
 
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
-	[QPHY_START_CTRL]		= 0x00,
-	[QPHY_PCS_READY_STATUS]		= 0x180,
+	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
+	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
 };
 
 static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {
Signature · 1 line
2.23.0
Reviewed-by on v3 1/4
#2 lore raw

Re: [PATCH v3 1/4] phy: qcom-qmp: Use register defines

Quoted 12 lines · Vinod Koul

We already define register offsets so use them in register layout.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index 66f91726b8b2..1196c85aa023 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static const unsigned int sdm845_ufsphy_regs_layout[] = { · line 173

Quoted 10 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +2 -2
@@ -166,8 +166,8 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = {
 };
 
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
-	[QPHY_START_CTRL]		= 0x00,
-	[QPHY_PCS_READY_STATUS]		= 0x180,
+	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
+	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
 };
 
 static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v3 1/4
#3 lore raw

Re: [PATCH v3 1/4] phy: qcom-qmp: Use register defines

In reply to Vinod Koul
Quoted 3 lines · Vinod Koul

We already define register offsets so use them in register layout.

Quoted 21 lines
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +2 -2
index 66f91726b8b2..1196c85aa023 100644
@@ -166,8 +166,8 @@ static const unsigned int 
 sdm845_ufsphy_regs_layout[] = {
 };
 
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
-	[QPHY_START_CTRL]		= 0x00,
-	[QPHY_PCS_READY_STATUS]		= 0x180,
+	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
+	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
 };
 

static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {

author maintainer
#4 lore raw

PATCH v3 2/4 phy: qcom-qmp: remove duplicate powerdown write

In reply to Vinod Koul

We already write to QPHY_POWER_DOWN_CONTROL in qcom_qmp_phy_com_init() before invoking qcom_qmp_phy_configure() so remove the duplicate write.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
index 1196c85aa023..4f2e65c7cf45 100644
@@ -885,7 +885,6 @@ static const struct qmp_phy_init_tbl msm8998_usb3_pcs_tbl[] = {
 };
 
 static const struct qmp_phy_init_tbl sm8150_ufsphy_serdes_tbl[] = {
-	QMP_PHY_INIT_CFG(QPHY_POWER_DOWN_CONTROL, 0x01),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_SYSCLK_EN_SEL, 0xd9),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_SEL, 0x11),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_HS_SWITCH_SEL, 0x00),
Signature · 1 line
2.23.0
Reviewed-by on v3 2/4
#5 lore raw

Re: [PATCH v3 2/4] phy: qcom-qmp: remove duplicate powerdown write

Quoted 13 lines · Vinod Koul

We already write to QPHY_POWER_DOWN_CONTROL in qcom_qmp_phy_com_init() before invoking qcom_qmp_phy_configure() so remove the duplicate write.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index 1196c85aa023..4f2e65c7cf45 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static const struct qmp_phy_init_tbl msm8998_usb3_pcs_tbl[] = { · line 890

Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
@@ -885,7 +885,6 @@ static const struct qmp_phy_init_tbl msm8998_usb3_pcs_tbl[] = {
 };
 
 static const struct qmp_phy_init_tbl sm8150_ufsphy_serdes_tbl[] = {
-	QMP_PHY_INIT_CFG(QPHY_POWER_DOWN_CONTROL, 0x01),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_SYSCLK_EN_SEL, 0xd9),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_SEL, 0x11),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_HS_SWITCH_SEL, 0x00),
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v3 2/4
#6 lore raw

Re: [PATCH v3 2/4] phy: qcom-qmp: remove duplicate powerdown write

In reply to Vinod Koul
Quoted 4 lines · Vinod Koul

We already write to QPHY_POWER_DOWN_CONTROL in qcom_qmp_phy_com_init() before invoking qcom_qmp_phy_configure() so remove the duplicate write.

Quoted 18 lines
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
index 1196c85aa023..4f2e65c7cf45 100644
@@ -885,7 +885,6 @@ static const struct qmp_phy_init_tbl
 msm8998_usb3_pcs_tbl[] = {
 };
 
 static const struct qmp_phy_init_tbl sm8150_ufsphy_serdes_tbl[] = {
-	QMP_PHY_INIT_CFG(QPHY_POWER_DOWN_CONTROL, 0x01),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_SYSCLK_EN_SEL, 0xd9),
 	QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_SEL, 0x11),

QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_HS_SWITCH_SEL, 0x00),

author maintainer
#7 lore raw

PATCH v3 3/4 phy: qcom-qmp: remove no_pcs_sw_reset for sm8150

In reply to Vinod Koul

SM8150 QMPY phy for UFS and onwards the PHY_SW_RESET is present in PHY's PCS register so we should not mark no_pcs_sw_reset for sm8150 and onwards

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
index 4f2e65c7cf45..ce5e18f188c3 100644
@@ -1389,7 +1389,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = {
 	.pwrdn_ctrl		= SW_PWRDN,
 
 	.is_dual_lane_phy	= true,
-	.no_pcs_sw_reset	= true,
 };
 
 static void qcom_qmp_phy_configure(void __iomem *base,
Signature · 1 line
2.23.0
Reviewed-by on v3 3/4
#8 lore raw

Re: [PATCH v3 3/4] phy: qcom-qmp: remove no_pcs_sw_reset for sm8150

Quoted 14 lines · Vinod Koul

SM8150 QMPY phy for UFS and onwards the PHY_SW_RESET is present in PHY's PCS register so we should not mark no_pcs_sw_reset for sm8150 and onwards

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index 4f2e65c7cf45..ce5e18f188c3 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { · line 1393

Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
@@ -1389,7 +1389,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = {
 	.pwrdn_ctrl		= SW_PWRDN,
 
 	.is_dual_lane_phy	= true,
-	.no_pcs_sw_reset	= true,
 };
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v3 3/4
#9 lore raw

Re: [PATCH v3 3/4] phy: qcom-qmp: remove no_pcs_sw_reset for sm8150

In reply to Vinod Koul
Quoted 5 lines · Vinod Koul

SM8150 QMPY phy for UFS and onwards the PHY_SW_RESET is present in PHY's PCS register so we should not mark no_pcs_sw_reset for sm8150 and onwards

Quoted 18 lines
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -1
index 4f2e65c7cf45..ce5e18f188c3 100644
@@ -1389,7 +1389,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg 
 = {
 	.pwrdn_ctrl		= SW_PWRDN,
 
 	.is_dual_lane_phy	= true,
-	.no_pcs_sw_reset	= true,
 };
 

static void qcom_qmp_phy_configure(void __iomem *base,

author maintainer
#10 lore raw

PATCH v3 4/4 phy: qcom-qmp: Add SW reset register

In reply to Vinod Koul

For V4 QMP UFS Phy, we need to assert reset bits, configure the phy and then deassert it, so add the QPHY_SW_RESET register which does this.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp.c +1 -0
index ce5e18f188c3..7db2a94f7a99 100644
@@ -168,6 +168,7 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = {
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
 	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
 	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
+	[QPHY_SW_RESET]			= QPHY_V4_SW_RESET,
 };
 
 static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {
Signature · 1 line
2.23.0
Reviewed-by on v3 4/4
#11 lore raw

Re: [PATCH v3 4/4] phy: qcom-qmp: Add SW reset register

Quoted 13 lines · Vinod Koul

For V4 QMP UFS Phy, we need to assert reset bits, configure the phy and then deassert it, so add the QPHY_SW_RESET register which does this.

---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp.c +0 -0
index ce5e18f188c3..7db2a94f7a99 100644

drivers/phy/qualcomm/phy-qcom-qmp.c static const unsigned int sdm845_ufsphy_regs_layout[] = { · line 174

Quoted 7 lines
drivers/phy/qualcomm/phy-qcom-qmp.c +1 -0
@@ -168,6 +168,7 @@ static const unsigned int sdm845_ufsphy_regs_layout[] = {
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
 	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
 	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
+	[QPHY_SW_RESET]			= QPHY_V4_SW_RESET,
 };
 
 static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v3 4/4
#12 lore raw

Re: [PATCH v3 4/4] phy: qcom-qmp: Add SW reset register

In reply to Vinod Koul
Quoted 4 lines · Vinod Koul

For V4 QMP UFS Phy, we need to assert reset bits, configure the phy and then deassert it, so add the QPHY_SW_RESET register which does this.

Quoted 18 lines
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp.c +1 -0
index ce5e18f188c3..7db2a94f7a99 100644
@@ -168,6 +168,7 @@ static const unsigned int 
 sdm845_ufsphy_regs_layout[] = {
 static const unsigned int sm8150_ufsphy_regs_layout[] = {
 	[QPHY_START_CTRL]		= QPHY_V4_PHY_START,
 	[QPHY_PCS_READY_STATUS]		= QPHY_V4_PCS_READY_STATUS,
+	[QPHY_SW_RESET]			= QPHY_V4_SW_RESET,
 };
 

static const struct qmp_phy_init_tbl msm8996_pcie_serdes_tbl[] = {

author maintainer
#13 lore raw
In reply to Vinod Koul

Hi Kishon,

Quoted 2 lines · Vinod Koul

For SM8150 we need additional SW reset so clear the no_pcs_sw_reset, and add SW reset register. Along with that remove duplicate powerdown write.

Any update on this series?

Thanks

Quoted 24 lines

Changes in v3:
- Drop patch 1 "phy: qcom-qmp: Increase PHY ready timeout" as that is applied by Kishon
- Drop patch "phy: qcom-qmp: Add optional SW reset" as that is no longer required
- Add "phy: qcom-qmp: Add SW reset register"

Changes in v2:
- Drop patch 1 and pick the one Bjorn had already sent, makes timeout 10ms
- Fix optional reset write as pointed by Can
- Fix register define as pointed by Can

Vinod Koul (4):
phy: qcom-qmp: Use register defines
phy: qcom-qmp: remove duplicate powerdown write
phy: qcom-qmp: remove no_pcs_sw_reset for sm8150
phy: qcom-qmp: Add SW reset register

 drivers/phy/qualcomm/phy-qcom-qmp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.23.0
Signature · 1 line
~Vinod