phy: qcom-qmp: further prep fixes and cleanups (set 3)
Subsystems (2)
cover phy: qcom-qmp: further prep fixes and cleanups (set 3)
Here's the next batch of QMP fixes and cleanups in preparation for adding support for SC8280XP and its four-lane PCIe PHYs.
Note that these apply on top of the following three series that have been reviewed and should be ready to be merged when the PHY tree opens:
https://lore.kernel.org/lkml/[email protected]/ https://lore.kernel.org/linux-phy/[email protected]/ https://lore.kernel.org/lkml/[email protected]/
Note that I did not add stable tags to the initialisation fixes as these drivers obviously work to some degree also without waiting for the PHY to become ready during power on. After they have been tested on the corresponding platforms, any interested party can ask the stable team to backport them.
Johan
Johan Hovold (20):
phy: qcom-qmp-pcie: fix sc8180x initialisation
phy: qcom-qmp-pcie: fix ipq8074-gen3 initialisation
phy: qcom-qmp-pcie: fix ipq6018 initialisation
phy: qcom-qmp-pcie: clean up status polling
phy: qcom-qmp-pcie: increase status polling period
phy: qcom-qmp-pcie-msm8996: clean up ready and status polling
phy: qcom-qmp-pcie-msm8996: increase status polling period
phy: qcom-qmp-combo: clean up status polling
phy: qcom-qmp-combo: increase status polling period
phy: qcom-qmp-ufs: drop unused phy-status config
phy: qcom-qmp-ufs: clean up ready polling
phy: qcom-qmp-ufs: increase ready polling period
phy: qcom-qmp-usb: clean up status polling
phy: qcom-qmp-usb: increase status polling period
phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction
phy: qcom-qmp-pcie: drop start-ctrl abstraction
phy: qcom-qmp-pcie: add config sanity checks
phy: qcom-qmp-pcie-msm8996: drop start and pwrdn-ctrl abstraction
phy: qcom-qmp-ufs: drop start and pwrdn-ctrl abstraction
phy: qcom-qmp-usb: drop start and pwrdn-ctrl abstraction
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 43 ++-------- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 36 +++----- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 30 +++---- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 51 ++--------- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 86 ++----------------- 5 files changed, 46 insertions(+), 200 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/20 phy: qcom-qmp-pcie: fix sc8180x initialisation
The phy_status mask was never set for SC8180X which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -0
@@ -1733,6 +1733,7 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = {
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 2/20 phy: qcom-qmp-pcie: fix ipq8074-gen3 initialisation
The phy_status mask was never set for IPQ8074 (gen3) which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -0
@@ -1519,6 +1519,7 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .phy_status = PHYSTATUS, .pipe_clock_rate = 250000000, };
Signature · 1 line
2.35.1
Re: [PATCH 02/20] phy: qcom-qmp-pcie: fix ipq8074-gen3 initialisation
Quoted 9 lines · Johan Hovold
The
phy_statusmask was never set for IPQ8074 (gen3) which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.Fixes 334fad185415 ("phy: qcom-qmp-pcie: add IPQ8074 PCIe Gen3 QMP PHY support")Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 3/20 phy: qcom-qmp-pcie: fix ipq6018 initialisation
In reply to Johan HovoldThe phy_status mask was never set for IPQ6018 which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -0
@@ -1549,6 +1549,7 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = {
Signature · 1 line
2.35.1
Re: [PATCH 03/20] phy: qcom-qmp-pcie: fix ipq6018 initialisation
Quoted 9 lines · Johan Hovold
The
phy_statusmask was never set for IPQ6018 which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.Fixes 520264db3bf9 ("phy: qcom-qmp: add QMP V2 PCIe PHY support for ipq60xx")Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 4/20 phy: qcom-qmp-pcie: clean up status polling
In reply to Johan HovoldClean up the status polling by dropping the ready bit mask which is no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +2 -4
@@ -1966,7 +1966,7 @@ static int qmp_pcie_power_on(struct phy *phy)const struct qmp_phy_cfg_tables *mode_tables;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int mask, val;int ret; qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
@@ -2004,9 +2004,7 @@ static int qmp_pcie_power_on(struct phy *phy) status = pcs + cfg->regs[QPHY_PCS_STATUS ]; mask = cfg->phy_status; - ready =0 ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, !(val & mask),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 04/20] phy: qcom-qmp-pcie: clean up status polling
Quoted 7 lines · Johan Hovold
Clean up the status polling by dropping the ready bit mask which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 5/20 phy: qcom-qmp-pcie: increase status polling period
In reply to Johan HovoldIt typically takes between one and two milliseconds for the PHY to become ready after starting it. Increase the tight 3--10 us polling period to the more reasonable 51--200 us.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1 -1
@@ -2004,7 +2004,7 @@ static int qmp_pcie_power_on(struct phy *phy) status = pcs + cfg->regs[QPHY_PCS_STATUS ]; mask = cfg->phy_status; - ret =readl_poll_timeout (status, val, !(val & mask),10 , + ret =readl_poll_timeout (status, val, !(val & mask),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 1 line
2.35.1
PATCH 6/20 phy: qcom-qmp-pcie-msm8996: clean up ready and status polling
In reply to Johan HovoldClean up the PHY ready and status polling by dropping the configuration masks which are no longer needed since the QMP driver split.
--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +4 -15
@@ -35,7 +35,6 @@#define PLL_READY_GATE_EN BIT(3)/* QPHY_PCS_STATUS bit */ #define PHYSTATUS BIT(6) -#define PHYSTATUS_4_20 BIT(7)/* QPHY_COM_PCS_READY_STATUS bit */ #define PCS_READY BIT(0)
@@ -200,9 +199,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -unsigned int mask_com_pcs_ready; -/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ -unsigned int phy_status; };/**
@@ -318,8 +314,6 @@ static const struct qmp_phy_cfg msm8996_pciephy_cfg = { .start_ctrl = PCS_START | PLL_READY_GATE_EN, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, - .mask_com_pcs_ready = PCS_READY, - .phy_status = PHYSTATUS, }; static void qmp_pcie_msm8996_configure_lane(void __iomem *base,
@@ -356,7 +350,7 @@ static int qmp_pcie_msm8996_serdes_init(struct qmp_phy *qphy)const struct qmp_phy_init_tbl *serdes_tbl = cfg->serdes_tbl;int serdes_tbl_num = cfg->serdes_tbl_num;void __iomem *status; -unsigned int mask, val; +unsigned int val;int ret;qmp_pcie_msm8996_configure (serdes, serdes_tbl, serdes_tbl_num);
@@ -366,9 +360,7 @@ static int qmp_pcie_msm8996_serdes_init(struct qmp_phy *qphy) SERDES_START | PCS_START); status = serdes + cfg->regs[QPHY_COM_PCS_READY_STATUS ]; - mask = cfg->mask_com_pcs_ready; - - ret =readl_poll_timeout (status, val, (val & mask),10 , + ret =readl_poll_timeout (status, val, (val &PCS_READY ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) { dev_err(qmp->dev,
@@ -484,7 +476,7 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)void __iomem *rx = qphy->rx;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int val;int ret;qmp_pcie_msm8996_serdes_init (qphy);
@@ -522,10 +514,7 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - mask = cfg->phy_status; - ready =0 ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 06/20] phy: qcom-qmp-pcie-msm8996: clean up ready and status polling
Quoted 8 lines · Johan Hovold
Clean up the PHY ready and status polling by dropping the configuration masks which are no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 7/20 phy: qcom-qmp-pcie-msm8996: increase status polling period
In reply to Johan HovoldIt typically takes between one and two milliseconds for the PHY to become ready after starting it. Increase the tight 3--10 us polling period to the more reasonable 51--200 us.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +2 -2
@@ -360,7 +360,7 @@ static int qmp_pcie_msm8996_serdes_init(struct qmp_phy *qphy) SERDES_START | PCS_START); status = serdes + cfg->regs[QPHY_COM_PCS_READY_STATUS ]; - ret =readl_poll_timeout (status, val, (val &PCS_READY ),10 , + ret =readl_poll_timeout (status, val, (val &PCS_READY ),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) { dev_err(qmp->dev,
@@ -514,7 +514,7 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 8/20 phy: qcom-qmp-combo: clean up status polling
In reply to Johan HovoldClean up the PHY status polling by dropping the configuration mask which is no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2 -12
@@ -853,8 +853,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ -unsigned int phy_status;/* true, if PHY needs delay after POWER_DOWN */ bool has_pwrdn_delay;
@@ -1023,7 +1021,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1092,7 +1089,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1127,7 +1123,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1197,7 +1192,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {
@@ -1267,7 +1261,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -2017,7 +2010,7 @@ static int qmp_combo_power_on(struct phy *phy)void __iomem *rx = qphy->rx;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int val;int ret;qmp_combo_serdes_init (qphy);
@@ -2059,10 +2052,7 @@ static int qmp_combo_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - mask = cfg->phy_status; - ready =0 ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 08/20] phy: qcom-qmp-combo: clean up status polling
Quoted 4 lines · Johan Hovold
Clean up the PHY status polling by dropping the configuration mask which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>
This comes in expectation that 4.20 / 5.20 PHYs will be limited to PCIe. I'd add this to the commit message. With that fixed:
Quoted 78 lines
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)drivers/phy/qualcomm/phy-qcom-qmp-combo.c +2
-12@@ -853,8 +853,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ -unsigned int phy_status;/* true, if PHY needs delay after POWER_DOWN */ bool has_pwrdn_delay;@@ -1023,7 +1021,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };@@ -1092,7 +1089,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };@@ -1127,7 +1123,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };@@ -1197,7 +1192,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {@@ -1267,7 +1261,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };@@ -2017,7 +2010,7 @@ static int qmp_combo_power_on(struct phy *phy)void __iomem *rx = qphy->rx;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int val;int ret;qmp_combo_serdes_init (qphy);@@ -2059,10 +2052,7 @@ static int qmp_combo_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - mask = cfg->phy_status; - ready =0 ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 08/20] phy: qcom-qmp-combo: clean up status polling
Quoted 8 lines · Dmitry Baryshkov
Quoted 4 lines · Johan Hovold
Clean up the PHY status polling by dropping the configuration mask which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>This comes in expectation that 4.20 / 5.20 PHYs will be limited to PCIe. I'd add this to the commit message.
I don't think that's needed. The commit message is correct as it stands, and the fact that we may need to change code in case we add support for new devices that may need it is quite natural.
Also note that the vendor drivers (5.4) only have such a provision for PCIe PHYs and not for the combo and USB PHY drivers.
Quoted 3 lines
With that fixed:
Reviewed-by Dmitry Baryshkov <[email protected]>
Johan
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 9/20 phy: qcom-qmp-combo: increase status polling period
In reply to Johan HovoldIt typically takes between one and two milliseconds for the PHY to become ready after starting it. Increase the tight 3--10 us polling period to the more reasonable 51--200 us.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +1 -1
@@ -2052,7 +2052,7 @@ static int qmp_combo_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 1 line
2.35.1
PATCH 10/20 phy: qcom-qmp-ufs: drop unused phy-status config
In reply to Johan HovoldDrop the unused phy-status configuration mask which has never been used for UFS PHYs.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +0 -9
@@ -31,8 +31,6 @@/* QPHY_START_CONTROL bits */ #define SERDES_START BIT(0)#define PCS_START BIT(1) -/* QPHY_PCS_STATUS bit */ -#define PHYSTATUS BIT(6)/* QPHY_PCS_READY_STATUS bit */ #define PCS_READY BIT(0)
@@ -548,8 +546,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ -unsigned int phy_status;/* true, if PCS block has no separate SW_RESET register */ bool no_pcs_sw_reset;
@@ -668,7 +664,6 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .no_pcs_sw_reset = true, };
@@ -692,7 +687,6 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .no_pcs_sw_reset = true, };
@@ -739,7 +733,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = {
@@ -761,7 +754,6 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = {
@@ -783,7 +775,6 @@ static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { .start_ctrl = SERDES_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, }; static void qmp_ufs_configure_lane(void __iomem *base,
Signature · 1 line
2.35.1
Re: [PATCH 10/20] phy: qcom-qmp-ufs: drop unused phy-status config
Quoted 7 lines · Johan Hovold
Drop the unused phy-status configuration mask which has never been used for UFS PHYs.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 --------- 1 file changed, 9 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 11/20 phy: qcom-qmp-ufs: clean up ready polling
In reply to Johan HovoldClean up the PHY ready polling by dropping the mask variables which are no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +2 -5
@@ -908,7 +908,7 @@ static int qmp_ufs_power_on(struct phy *phy)void __iomem *rx = qphy->rx;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int val;int ret;qmp_ufs_serdes_init (qphy);
@@ -937,10 +937,7 @@ static int qmp_ufs_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_READY_STATUS ]; - mask =PCS_READY ; - ready =PCS_READY ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, (val &PCS_READY ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 11/20] phy: qcom-qmp-ufs: clean up ready polling
Quoted 7 lines · Johan Hovold
Clean up the PHY ready polling by dropping the mask variables which are no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 12/20 phy: qcom-qmp-ufs: increase ready polling period
In reply to Johan HovoldIt typically takes between one and two milliseconds for the PHY to become ready after starting it. Increase the tight 3--10 us polling period to the more reasonable 51--200 us.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +1 -1
@@ -937,7 +937,7 @@ static int qmp_ufs_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_READY_STATUS ]; - ret =readl_poll_timeout (status, val, (val &PCS_READY ),10 , + ret =readl_poll_timeout (status, val, (val &PCS_READY ),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 1 line
2.35.1
PATCH 13/20 phy: qcom-qmp-usb: clean up status polling
In reply to Johan HovoldClean up the PHY status polling by dropping the configuration mask which is no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +2 -23
@@ -1445,8 +1445,6 @@ struct qmp_phy_cfg {unsigned int start_ctrl;unsigned int pwrdn_ctrl; -/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ -unsigned int phy_status;/* true, if PHY needs delay after POWER_DOWN */ bool has_pwrdn_delay;
@@ -1604,7 +1602,6 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = {
@@ -1628,7 +1625,6 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
@@ -1652,7 +1648,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true,
@@ -1679,7 +1674,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true,
@@ -1706,7 +1700,6 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = {
@@ -1730,7 +1723,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1756,7 +1748,6 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
@@ -1783,7 +1774,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true,
@@ -1813,7 +1803,6 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1842,7 +1831,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true,
@@ -1872,7 +1860,6 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1901,7 +1888,6 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1930,7 +1916,6 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -1959,7 +1944,6 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true,
@@ -1989,7 +1973,6 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, .has_pwrdn_delay = true, };
@@ -2015,7 +1998,6 @@ static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN, - .phy_status = PHYSTATUS, }; static void qmp_usb_configure_lane(void __iomem *base,
@@ -2147,7 +2129,7 @@ static int qmp_usb_power_on(struct phy *phy)void __iomem *rx = qphy->rx;void __iomem *pcs = qphy->pcs;void __iomem *status; -unsigned int mask, val, ready; +unsigned int val;int ret;qmp_usb_serdes_init (qphy);
@@ -2181,10 +2163,7 @@ static int qmp_usb_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - mask = cfg->phy_status; - ready =0 ; - - ret =readl_poll_timeout (status, val, (val & mask) == ready,10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 13/20] phy: qcom-qmp-usb: clean up status polling
Quoted 7 lines · Johan Hovold
Clean up the PHY status polling by dropping the configuration mask which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-)
Same comment as for 08/20. With that fixed:
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 14/20 phy: qcom-qmp-usb: increase status polling period
In reply to Johan HovoldIt typically takes between one and two milliseconds for the PHY to become ready after starting it. Increase the tight 3--10 us polling period to the more reasonable 51--200 us.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +1 -1
@@ -2163,7 +2163,7 @@ static int qmp_usb_power_on(struct phy *phy)qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; - ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),10 , + ret =readl_poll_timeout (status, val, !(val &PHYSTATUS ),200 ,PHY_INIT_COMPLETE_TIMEOUT );if (ret) {dev_err (qmp->dev,"phy initialization timed-out\n" );
Signature · 1 line
2.35.1
PATCH 15/20 phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction
In reply to Johan HovoldAll USB PHYs need to start and stop the SerDes and PCS so drop the start-ctrl abstraction which is no longer needed since the QMP driver split.
Similarly, drop the pwrdn-ctrl abstraction which also is not needed since the split.
--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 29 +++++------------------ 1 file changed, 6 insertions(+), 23 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-combo.c +6 -23
@@ -851,9 +851,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl; -unsigned int pwrdn_ctrl; -/* true, if PHY needs delay after POWER_DOWN */ bool has_pwrdn_delay;
@@ -1019,9 +1016,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1087,9 +1081,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1121,9 +1112,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1189,9 +1177,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {
@@ -1259,9 +1244,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1944,8 +1926,7 @@ static int qmp_combo_com_init(struct qmp_phy *qphy)qphy_clrbits (dp_com,QPHY_V3_DP_COM_SWI_CTRL ,0x03 );qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET ); -qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ],SW_PWRDN );mutex_unlock (&qmp->phy_mutex);
@@ -2049,7 +2030,8 @@ static int qmp_combo_power_on(struct phy *phy)/* Pull PHY out of reset state */ qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START ); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 200,
@@ -2082,11 +2064,12 @@ static int qmp_combo_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits (qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +SW_PWRDN ); }return 0 ;
Signature · 1 line
2.35.1
Re: [PATCH 15/20] phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction
Quoted 4 lines · Johan Hovold
All USB PHYs need to start and stop the SerDes and PCS so drop the start-ctrl abstraction which is no longer needed since the QMP driver split.
Quoted 8 lines
Similarly, drop the pwrdn-ctrl abstraction which also is not needed since the split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 29 +++++------------------ 1 file changed, 6 insertions(+), 23 deletions(-)
Signature · 2 lines
With best wishes Dmitry
PATCH 16/20 phy: qcom-qmp-pcie: drop start-ctrl abstraction
In reply to Johan HovoldAll PCIe PHYs need to start and stop the SerDes and PCS so drop the start-ctrl abstraction which is no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3 -15
@@ -1355,7 +1355,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl;unsigned int pwrdn_ctrl;/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status;
@@ -1491,7 +1490,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { .num_vregs = 0, .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1517,7 +1515,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,
@@ -1547,7 +1544,6 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1575,7 +1571,6 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qmp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1601,7 +1596,6 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qhp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1639,7 +1633,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1677,7 +1670,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1703,7 +1695,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,
@@ -1733,7 +1724,6 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1761,7 +1751,6 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS_4_20, };
@@ -1789,7 +1778,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };
@@ -1832,7 +1820,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS_4_20, };
@@ -1997,7 +1984,7 @@ static int qmp_pcie_power_on(struct phy *phy)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START |PCS_START );if (!cfg->skip_start_delay)usleep_range (1000 ,1200 );
@@ -2030,7 +2017,8 @@ static int qmp_pcie_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 16/20] phy: qcom-qmp-pcie: drop start-ctrl abstraction
Quoted 8 lines · Johan Hovold
All PCIe PHYs need to start and stop the SerDes and PCS so drop the start-ctrl abstraction which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
I think it should be possible to also drop the pwrdn_ctrl by replacing it with something like no_refclk_drv_dsbl. However I'd like to understand why this is not required for SDX55. Is this the peculiarity of that platform? Or is it a specifics of the EP mode? Many, Vinod, do you know the answer by chance?
Nevertheless, for this patch:
Quoted 128 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3
-15@@ -1355,7 +1355,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl;unsigned int pwrdn_ctrl;/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status;@@ -1491,7 +1490,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { .num_vregs = 0, .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1517,7 +1515,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,@@ -1547,7 +1544,6 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1575,7 +1571,6 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qmp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1601,7 +1596,6 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qhp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1639,7 +1633,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1677,7 +1670,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1703,7 +1695,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,@@ -1733,7 +1724,6 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1761,7 +1751,6 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS_4_20, };@@ -1789,7 +1778,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1832,7 +1820,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS_4_20, };@@ -1997,7 +1984,7 @@ static int qmp_pcie_power_on(struct phy *phy)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START |PCS_START );if (!cfg->skip_start_delay)usleep_range (1000 ,1200 );@@ -2030,7 +2017,8 @@ static int qmp_pcie_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Vinod Koul
maintainerRe: [PATCH 16/20] phy: qcom-qmp-pcie: drop start-ctrl abstraction
Quoted 10 lines · Dmitry Baryshkov
Quoted 8 lines · Johan Hovold
All PCIe PHYs need to start and stop the SerDes and PCS so drop the start-ctrl abstraction which is no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
Quoted 5 lines
I think it should be possible to also drop the
pwrdn_ctrlby replacing it with something likeno_refclk_drv_dsbl. However I'd like to understand why this is not required for SDX55. Is this the peculiarity of that platform? Or is it a specifics of the EP mode?
Many, Vinod, do you know the answer by chance?
Adding Mani, i am not sure maybe sdx55 specific...?
Quoted 118 lines
Nevertheless, for this patch:
Reviewed-by Dmitry Baryshkov <[email protected]>Quoted 109 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3
-15@@ -1355,7 +1355,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl;unsigned int pwrdn_ctrl;/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */ unsigned int phy_status;@@ -1491,7 +1490,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { .num_vregs = 0, .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1517,7 +1515,6 @@ static const struct qmp_phy_cfg ipq8074_pciephy_gen3_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,@@ -1547,7 +1544,6 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { .num_vregs = 0, .regs = ipq_pciephy_gen3_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1575,7 +1571,6 @@ static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qmp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1601,7 +1596,6 @@ static const struct qmp_phy_cfg sdm845_qhp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_qhp_pciephy_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1639,7 +1633,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1677,7 +1670,6 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1703,7 +1695,6 @@ static const struct qmp_phy_cfg msm8998_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = pciephy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS,@@ -1733,7 +1724,6 @@ static const struct qmp_phy_cfg sc8180x_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1761,7 +1751,6 @@ static const struct qmp_phy_cfg sdx55_qmp_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = PCS_START | SERDES_START, .pwrdn_ctrl = SW_PWRDN, .phy_status = PHYSTATUS_4_20, };@@ -1789,7 +1778,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen3x1_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS, };@@ -1832,7 +1820,6 @@ static const struct qmp_phy_cfg sm8450_qmp_gen4x2_pciephy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8250_pcie_regs_layout, - .start_ctrl = SERDES_START | PCS_START, .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, .phy_status = PHYSTATUS_4_20, };@@ -1997,7 +1984,7 @@ static int qmp_pcie_power_on(struct phy *phy)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START |PCS_START );if (!cfg->skip_start_delay)usleep_range (1000 ,1200 );@@ -2030,7 +2017,8 @@ static int qmp_pcie_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],Signature · 2 lines
With best wishes Dmitry
Signature · 6 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 17/20 phy: qcom-qmp-pcie: add config sanity checks
In reply to Johan HovoldThe driver expects every configuration to set the pwrdn_ctrl and phy_status masks. Add some probe WARN_ON_ONCE() to probe to catch any new driver support that fails to provide them.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +3 -0
@@ -2347,6 +2347,9 @@ static int qmp_pcie_probe(struct platform_device *pdev)if (!cfg)return -EINVAL ; +WARN_ON_ONCE (!cfg->pwrdn_ctrl); +WARN_ON_ONCE (!cfg->phy_status); + serdes =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (serdes))return PTR_ERR (serdes);
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 17/20] phy: qcom-qmp-pcie: add config sanity checks
Quoted 8 lines · Johan Hovold
The driver expects every configuration to set the
pwrdn_ctrlandphy_statusmasks. Add some probeWARN_ON_ONCE()to probe to catch any new driver support that fails to provide them.Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 3 +++ 1 file changed, 3 insertions(+)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 18/20 phy: qcom-qmp-pcie-msm8996: drop start and pwrdn-ctrl abstraction
In reply to Johan HovoldDrop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c +7 -10
@@ -196,9 +196,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; - -unsigned int start_ctrl; -unsigned int pwrdn_ctrl; };/**
@@ -311,9 +308,6 @@ static const struct qmp_phy_cfg msm8996_pciephy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = pciephy_regs_layout, - - .start_ctrl = PCS_START | PLL_READY_GATE_EN, - .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, }; static void qmp_pcie_msm8996_configure_lane(void __iomem *base,
@@ -503,7 +497,8 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)* Pull out PHY from POWER DOWN state. * This is active low enable signal to power-down PHY. */ -qphy_setbits (pcs,QPHY_V2_PCS_POWER_DOWN_CONTROL , cfg->pwrdn_ctrl); +qphy_setbits (pcs,QPHY_V2_PCS_POWER_DOWN_CONTROL , +SW_PWRDN |REFCLK_DRV_DSBL );usleep_range (POWER_DOWN_DELAY_US_MIN ,POWER_DOWN_DELAY_US_MAX );
@@ -511,7 +506,8 @@ static int qmp_pcie_msm8996_power_on(struct phy *phy)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], +PCS_START |PLL_READY_GATE_EN ); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 200,
@@ -542,11 +538,12 @@ static int qmp_pcie_msm8996_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits (qphy->pcs,QPHY_V2_PCS_POWER_DOWN_CONTROL , - cfg->pwrdn_ctrl); +SW_PWRDN |REFCLK_DRV_DSBL );return 0 ; }
Signature · 1 line
2.35.1
Re: [PATCH 18/20] phy: qcom-qmp-pcie-msm8996: drop start and pwrdn-ctrl abstraction
Quoted 7 lines · Johan Hovold
Drop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 19/20 phy: qcom-qmp-ufs: drop start and pwrdn-ctrl abstraction
In reply to Johan HovoldDrop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 35 +++++-------------------- 1 file changed, 7 insertions(+), 28 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +7 -28
@@ -544,9 +544,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl; -unsigned int pwrdn_ctrl; -/* true, if PCS block has no separate SW_RESET register */ bool no_pcs_sw_reset; };
@@ -662,9 +659,6 @@ static const struct qmp_phy_cfg msm8996_ufs_cfg = { .regs = msm8996_ufsphy_regs_layout, - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, - .no_pcs_sw_reset = true, };
@@ -685,9 +679,6 @@ static const struct qmp_phy_cfg sdm845_ufsphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sdm845_ufsphy_regs_layout, - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, - .no_pcs_sw_reset = true, };
@@ -708,9 +699,6 @@ static const struct qmp_phy_cfg sm6115_ufsphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm6115_ufsphy_regs_layout, - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, - .no_pcs_sw_reset = true, };
@@ -730,9 +718,6 @@ static const struct qmp_phy_cfg sm8150_ufsphy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8150_ufsphy_regs_layout, - - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg sm8350_ufsphy_cfg = {
@@ -751,9 +736,6 @@ static const struct qmp_phy_cfg sm8350_ufsphy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8150_ufsphy_regs_layout, - - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg sm8450_ufsphy_cfg = {
@@ -772,9 +754,6 @@ static const struct qmp_phy_cfg sm8450_ufsphy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = sm8150_ufsphy_regs_layout, - - .start_ctrl = SERDES_START, - .pwrdn_ctrl = SW_PWRDN, }; static void qmp_ufs_configure_lane(void __iomem *base,
@@ -832,8 +811,7 @@ static int qmp_ufs_com_init(struct qmp_phy *qphy)if (ret) goto err_disable_regulators; -qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ],SW_PWRDN );return 0 ;
@@ -933,8 +911,9 @@ static int qmp_ufs_power_on(struct phy *phy)/* Pull PHY out of reset state */ if (!cfg->no_pcs_sw_reset)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET ); -/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); + +/* start SerDes */ +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START ); status = pcs + cfg->regs[QPHY_PCS_READY_STATUS ]; ret = readl_poll_timeout(status, val, (val & PCS_READY), 200,
@@ -956,12 +935,12 @@ static int qmp_ufs_power_off(struct phy *phy)if (!cfg->no_pcs_sw_reset)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET ); -/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +/* stop SerDes */ +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits (qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +SW_PWRDN );return 0 ; }
Signature · 1 line
2.35.1
Re: [PATCH 19/20] phy: qcom-qmp-ufs: drop start and pwrdn-ctrl abstraction
Quoted 7 lines · Johan Hovold
Drop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 35 +++++-------------------- 1 file changed, 7 insertions(+), 28 deletions(-)
Signature · 2 lines
With best wishes Dmitry
PATCH 20/20 phy: qcom-qmp-usb: drop start and pwrdn-ctrl abstraction
In reply to Johan HovoldDrop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 61 ++----------------------- 1 file changed, 5 insertions(+), 56 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +5 -56
@@ -1443,9 +1443,6 @@ struct qmp_phy_cfg {/* array of registers with different offsets */ const unsigned int *regs; -unsigned int start_ctrl; -unsigned int pwrdn_ctrl; -/* true, if PHY needs delay after POWER_DOWN */ bool has_pwrdn_delay;
@@ -1599,9 +1596,6 @@ static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = usb3phy_regs_layout, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg msm8996_usb3phy_cfg = {
@@ -1622,9 +1616,6 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = usb3phy_regs_layout, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = {
@@ -1646,9 +1637,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3phy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true, };
@@ -1672,9 +1660,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true, };
@@ -1697,9 +1682,6 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v4_usb3phy_regs_layout, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = {
@@ -1721,9 +1703,6 @@ static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1745,9 +1724,6 @@ static const struct qmp_phy_cfg msm8998_usb3phy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, };static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
@@ -1772,9 +1748,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true, };
@@ -1801,9 +1774,6 @@ static const struct qmp_phy_cfg sm8150_usb3_uniphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x600, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1829,9 +1799,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true, };
@@ -1858,9 +1825,6 @@ static const struct qmp_phy_cfg sm8250_usb3_uniphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x600, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1886,9 +1850,6 @@ static const struct qmp_phy_cfg sdx55_usb3_uniphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x600, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1914,9 +1875,6 @@ static const struct qmp_phy_cfg sdx65_usb3_uniphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x1000, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1942,9 +1900,6 @@ static const struct qmp_phy_cfg sm8350_usb3phy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x300, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, .has_phy_dp_com_ctrl = true, };
@@ -1971,9 +1926,6 @@ static const struct qmp_phy_cfg sm8350_usb3_uniphy_cfg = { .regs = qmp_v4_usb3phy_regs_layout, .pcs_usb_offset = 0x1000, - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, - .has_pwrdn_delay = true, };
@@ -1995,9 +1947,6 @@ static const struct qmp_phy_cfg qcm2290_usb3phy_cfg = { .vreg_list = qmp_phy_vreg_l, .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qcm2290_usb3phy_regs_layout, - - .start_ctrl = SERDES_START | PCS_START, - .pwrdn_ctrl = SW_PWRDN, }; static void qmp_usb_configure_lane(void __iomem *base,
@@ -2092,8 +2041,7 @@ static int qmp_usb_init(struct phy *phy)qphy_clrbits (dp_com,QPHY_V3_DP_COM_SW_RESET ,SW_RESET ); } -qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ],SW_PWRDN );return 0 ;
@@ -2160,7 +2108,7 @@ static int qmp_usb_power_on(struct phy *phy)qphy_clrbits (pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* start SerDes and Phy-Coding-Sublayer */ -qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_setbits (pcs, cfg->regs[QPHY_START_CTRL ],SERDES_START |PCS_START ); status = pcs + cfg->regs[QPHY_PCS_STATUS ]; ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 200,
@@ -2189,11 +2137,12 @@ static int qmp_usb_power_off(struct phy *phy)qphy_setbits (qphy->pcs, cfg->regs[QPHY_SW_RESET ],SW_RESET );/* stop SerDes and Phy-Coding-Sublayer */ -qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], cfg->start_ctrl); +qphy_clrbits (qphy->pcs, cfg->regs[QPHY_START_CTRL ], +SERDES_START |PCS_START );/* Put PHY into POWER DOWN state: active low */ qphy_clrbits (qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL ], - cfg->pwrdn_ctrl); +SW_PWRDN );return 0 ; }
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 20/20] phy: qcom-qmp-usb: drop start and pwrdn-ctrl abstraction
Quoted 7 lines · Johan Hovold
Drop the start and pwrdn-ctrl abstractions which are no longer needed since the QMP driver split.
Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 61 ++----------------------- 1 file changed, 5 insertions(+), 56 deletions(-)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 01/20] phy: qcom-qmp-pcie: fix sc8180x initialisation
In reply to Johan HovoldQuoted 9 lines · Johan Hovold
The
phy_statusmask was never set for SC8180X which meant that the driver would not wait for the PHY to be initialised during power-on and would never detect PHY initialisation timeouts.Fixes f839f14e24f2 ("phy: qcom-qmp: Add sc8180x PCIe support")Signed-off-by Johan Hovold <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 1 + 1 file changed, 1 insertion(+)
Signature · 8 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 5 lines · Johan Hovold
Here's the next batch of QMP fixes and cleanups in preparation for adding support for SC8280XP and its four-lane PCIe PHYs.
Note that these apply on top of the following three series that have been reviewed and should be ready to be merged when the PHY tree opens:
Same here; I forgot to mention this series:
https://lore.kernel.org/lkml/[email protected]/
which has also been reviewed but did not make it into 6.1.
Quoted 3 lines
https://lore.kernel.org/lkml/[email protected]/ https://lore.kernel.org/linux-phy/[email protected]/ https://lore.kernel.org/lkml/[email protected]/
Johan
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 2 lines · Johan Hovold
Here's the next batch of QMP fixes and cleanups in preparation for adding support for SC8280XP and its four-lane PCIe PHYs.
Applied, thanks
Signature · 6 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy