0072-v6.0-phy-qcom-qmp-pcie-make-pipe-clock-rate-configurable.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 2b0fe9137aa32d7fc367bf3a1cef4fa97ece6d58 Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <[email protected]>
  3. Date: Tue, 23 Aug 2022 22:43:51 +0200
  4. Subject: [PATCH] phy: qcom-qmp-pcie: make pipe clock rate configurable
  5. IPQ8074 Gen3 PCIe PHY uses 250MHz as the pipe clock rate instead of 125MHz
  6. like every other PCIe QMP PHY does, so make it configurable as part of the
  7. qmp_phy_cfg.
  8. Signed-off-by: Robert Marko <[email protected]>
  9. Reviewed-by: Dmitry Baryshkov <[email protected]>
  10. Link: https://lore.kernel.org/r/[email protected]
  11. Signed-off-by: Vinod Koul <[email protected]>
  12. ---
  13. drivers/phy/qualcomm/phy-qcom-qmp.c | 14 ++++++++++++--
  14. 1 file changed, 12 insertions(+), 2 deletions(-)
  15. --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
  16. +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
  17. @@ -2842,6 +2842,9 @@ struct qmp_phy_cfg {
  18. /* true, if PHY has secondary tx/rx lanes to be configured */
  19. bool is_dual_lane_phy;
  20. + /* QMP PHY pipe clock interface rate */
  21. + unsigned long pipe_clock_rate;
  22. +
  23. /* true, if PCS block has no separate SW_RESET register */
  24. bool no_pcs_sw_reset;
  25. };
  26. @@ -5139,8 +5142,15 @@ static int phy_pipe_clk_register(struct
  27. init.ops = &clk_fixed_rate_ops;
  28. - /* controllers using QMP phys use 125MHz pipe clock interface */
  29. - fixed->fixed_rate = 125000000;
  30. + /*
  31. + * Controllers using QMP PHY-s use 125MHz pipe clock interface
  32. + * unless other frequency is specified in the PHY config.
  33. + */
  34. + if (qmp->phys[0]->cfg->pipe_clock_rate)
  35. + fixed->fixed_rate = qmp->phys[0]->cfg->pipe_clock_rate;
  36. + else
  37. + fixed->fixed_rate = 125000000;
  38. +
  39. fixed->hw.init = &init;
  40. ret = devm_clk_hw_register(qmp->dev, &fixed->hw);