phy: qcom-qmp-usb: fix initialization of PCS_USB
Subsystems (2)
v2 cover phy: qcom-qmp-usb: fix initialization of PCS_USB
This series attempts at making sure PCS_USB registers are properly initialized. I tested it on the sa8775p. AFAICT there's no noticeable change before/after the patch series: lsusb and dmesg output are the same. USB is still working properly. I don't know what those PCS_USB registers do exactly on the qmp PHY and I don't have access to the PHY datasheet, so it's hard for me to tell the impact of them being initialized vs not.
v1 -> v2:
- Don't fallback to pcs for PCS_USB initialization (Dmitry Baryshkov)
Adrien Thierry (2):
phy: qcom-qmp-usb: initialize PCS_USB registers
phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p
drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
Signature · 7 lines
2.41.0 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v2 1/2 phy: qcom-qmp-usb: initialize PCS_USB registers
Currently, PCS_USB registers that have their initialization data in a pcs_usb_tbl table are never initialized. Fix that.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +4 -0
@@ -2233,6 +2233,7 @@ static int qmp_usb_power_on(struct phy *phy)void __iomem *tx = qmp->tx;void __iomem *rx = qmp->rx;void __iomem *pcs = qmp->pcs; +void __iomem *pcs_usb = qmp->pcs_usb;void __iomem *status;unsigned int val;int ret;
@@ -2256,6 +2257,9 @@ static int qmp_usb_power_on(struct phy *phy)qmp_usb_configure (pcs, cfg->pcs_tbl, cfg->pcs_tbl_num); +if (pcs_usb) +qmp_usb_configure (pcs_usb, cfg->pcs_usb_tbl, cfg->pcs_usb_tbl_num); +if (cfg->has_pwrdn_delay)usleep_range (10 ,20 );
Signature · 7 lines
2.41.0 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v2 1/2] phy: qcom-qmp-usb: initialize PCS_USB registers
Quoted 6 lines · Adrien Thierry
Currently,
PCS_USBregisters that have their initialization data in apcs_usb_tbltable are never initialized. Fix that.Fixes fc64623637da ("phy: qcom-qmp-combo,usb: add support for separate PCS_USB region")Signed-off-by Adrien Thierry <[email protected]>
Quoted 3 lines
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 4 ++++ 1 file changed, 4 insertions(+)
Signature · 7 lines
With best wishes Dmitry -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v2 1/2] phy: qcom-qmp-usb: initialize PCS_USB registers
Quoted 9 lines · Dmitry Baryshkov
Quoted 6 lines · Adrien Thierry
Currently,
PCS_USBregisters that have their initialization data in apcs_usb_tbltable are never initialized. Fix that.Fixes fc64623637da ("phy: qcom-qmp-combo,usb: add support for separate PCS_USB region")Signed-off-by Adrien Thierry <[email protected]>Reviewed-by Dmitry Baryshkov <[email protected]>
I noticed the same is missing in the combo phy driver!
Konrad
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH v2 2/2 phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p
In reply to Adrien ThierryFor sc8280xp and sa8775p, PCS and PCS_USB initialization data is described in the same table, thus the pcs_usb offset is not being applied during initialization of PCS_USB registers. Fix this by adding the appropriate pcs_usb_tbl tables.
--- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-usb.c +15 -5
@@ -1480,8 +1480,6 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = {QMP_PHY_INIT_CFG (QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H ,0x03 ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_RX_SIGDET_LVL ,0xaa ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCS_TX_RX_CONFIG ,0x0c ), -QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 ,0x07 ), -QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL ,0xf8 ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_CDR_RESET_TIME ,0x0a ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_ALIGN_DETECT_CONFIG1 ,0x88 ), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1490,6 +1488,11 @@ static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sc8280xp_usb3_uniphy_pcs_usb_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 ,0x07 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL ,0xf8 ), +}; +static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {QMP_PHY_INIT_CFG (QPHY_V5_PCS_LOCK_DETECT_CONFIG1 ,0xc4 ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_LOCK_DETECT_CONFIG2 ,0x89 ),
@@ -1499,9 +1502,6 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = {QMP_PHY_INIT_CFG (QPHY_V5_PCS_RCVR_DTCT_DLY_P1U2_H ,0x03 ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_RX_SIGDET_LVL ,0xaa ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCS_TX_RX_CONFIG ,0x0c ), -QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 ,0x07 ), -QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL ,0xf8 ), -QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1 ,0x6f ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_CDR_RESET_TIME ,0x0a ),QMP_PHY_INIT_CFG (QPHY_V5_PCS_ALIGN_DETECT_CONFIG1 ,0x88 ), QMP_PHY_INIT_CFG(QPHY_V5_PCS_ALIGN_DETECT_CONFIG2, 0x13),
@@ -1510,6 +1510,12 @@ static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_PCS_REFGEN_REQ_CONFIG1, 0x21), }; +static const struct qmp_phy_init_tbl sa8775p_usb3_uniphy_pcs_usb_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 ,0x07 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL ,0xf8 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_USB3_POWER_STATE_CONFIG1 ,0x6f ), +}; +struct qmp_usb_offsets {u16 serdes;u16 pcs;
@@ -1788,6 +1794,8 @@ static const struct qmp_phy_cfg sa8775p_usb3_uniphy_cfg = { .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sa8775p_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sa8775p_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sa8775p_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l,
@@ -1833,6 +1841,8 @@ static const struct qmp_phy_cfg sc8280xp_usb3_uniphy_cfg = { .rx_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_rx_tbl), .pcs_tbl = sc8280xp_usb3_uniphy_pcs_tbl, .pcs_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_tbl), + .pcs_usb_tbl = sc8280xp_usb3_uniphy_pcs_usb_tbl, + .pcs_usb_tbl_num = ARRAY_SIZE(sc8280xp_usb3_uniphy_pcs_usb_tbl), .clk_list = qmp_v4_phy_clk_l, .num_clks = ARRAY_SIZE(qmp_v4_phy_clk_l), .reset_list = qcm2290_usb3phy_reset_l,
Signature · 7 lines
2.41.0 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Gentle ping for this series, is there still anything preventing it from being merged?
Best,
Adrien
Quoted 25 lines · Adrien Thierry
This series attempts at making sure
PCS_USBregisters are properly initialized. I tested it on the sa8775p. AFAICT there's no noticeable change before/after the patch series: lsusb and dmesg output are the same. USB is still working properly. I don't know what thosePCS_USBregisters do exactly on the qmp PHY and I don't have access to the PHY datasheet, so it's hard for me to tell the impact of them being initialized vs not.v1 -> v2:
- Don't fallback to pcs forPCS_USBinitialization (Dmitry Baryshkov)Adrien Thierry (2):
phy: qcom-qmp-usb: initializePCS_USBregisters
phy: qcom-qmp-usb: splitPCS_USBinit table for sc8280xp and sa8775pdrivers/phy/qualcomm/phy-qcom-qmp-usb.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)Signature · 7 lines
2.41.0 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 8 lines · Adrien Thierry
This series attempts at making sure
PCS_USBregisters are properly initialized. I tested it on the sa8775p. AFAICT there's no noticeable change before/after the patch series: lsusb and dmesg output are the same. USB is still working properly. I don't know what thosePCS_USBregisters do exactly on the qmp PHY and I don't have access to the PHY datasheet, so it's hard for me to tell the impact of them being initialized vs not.[...]
Applied, thanks!
[1/2] phy: qcom-qmp-usb: initialize PCS_USB registers
commit: 2d3465a75c9f83684d17da6807423824bf260524
[2/2] phy: qcom-qmp-usb: split PCS_USB init table for sc8280xp and sa8775p
commit: c599dc5cca4dd6a5c664e4a8837246e68a96cb4cBest regards,
Signature · 8 lines
~Vinod -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy