phy-comphy-cp110.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (C) 2018 Marvell International Ltd.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. * https://spdx.org/licenses
  6. */
  7. /* Those are parameters for xfi mode, which need to be tune for each board type.
  8. * For known DB boards the parameters was already calibrated and placed under
  9. * the plat/marvell/armada/a8k/<board_type>/board/phy-porting-layer.h
  10. */
  11. struct xfi_params {
  12. uint8_t g1_ffe_res_sel;
  13. uint8_t g1_ffe_cap_sel;
  14. uint8_t align90;
  15. uint8_t g1_dfe_res;
  16. uint8_t g1_amp;
  17. uint8_t g1_emph;
  18. uint8_t g1_emph_en;
  19. uint8_t g1_tx_amp_adj;
  20. uint8_t g1_tx_emph_en;
  21. uint8_t g1_tx_emph;
  22. uint8_t g1_rx_selmuff;
  23. uint8_t g1_rx_selmufi;
  24. uint8_t g1_rx_selmupf;
  25. uint8_t g1_rx_selmupi;
  26. _Bool valid;
  27. };
  28. struct sata_params {
  29. uint8_t g1_amp;
  30. uint8_t g2_amp;
  31. uint8_t g3_amp;
  32. uint8_t g1_emph;
  33. uint8_t g2_emph;
  34. uint8_t g3_emph;
  35. uint8_t g1_emph_en;
  36. uint8_t g2_emph_en;
  37. uint8_t g3_emph_en;
  38. uint8_t g1_tx_amp_adj;
  39. uint8_t g2_tx_amp_adj;
  40. uint8_t g3_tx_amp_adj;
  41. uint8_t g1_tx_emph_en;
  42. uint8_t g2_tx_emph_en;
  43. uint8_t g3_tx_emph_en;
  44. uint8_t g1_tx_emph;
  45. uint8_t g2_tx_emph;
  46. uint8_t g3_tx_emph;
  47. uint8_t g3_dfe_res;
  48. uint8_t g3_ffe_res_sel;
  49. uint8_t g3_ffe_cap_sel;
  50. uint8_t align90;
  51. uint8_t g1_rx_selmuff;
  52. uint8_t g2_rx_selmuff;
  53. uint8_t g3_rx_selmuff;
  54. uint8_t g1_rx_selmufi;
  55. uint8_t g2_rx_selmufi;
  56. uint8_t g3_rx_selmufi;
  57. uint8_t g1_rx_selmupf;
  58. uint8_t g2_rx_selmupf;
  59. uint8_t g3_rx_selmupf;
  60. uint8_t g1_rx_selmupi;
  61. uint8_t g2_rx_selmupi;
  62. uint8_t g3_rx_selmupi;
  63. uint8_t polarity_invert;
  64. _Bool valid;
  65. };
  66. struct usb_params {
  67. uint8_t polarity_invert;
  68. };
  69. int mvebu_cp110_comphy_is_pll_locked(uint64_t comphy_base,
  70. uint8_t comphy_index);
  71. int mvebu_cp110_comphy_power_off(uint64_t comphy_base,
  72. uint8_t comphy_index, uint64_t comphy_mode);
  73. int mvebu_cp110_comphy_power_on(uint64_t comphy_base, uint8_t comphy_index,
  74. uint64_t comphy_mode,
  75. uint64_t comphy_train_base);
  76. int mvebu_cp110_comphy_xfi_rx_training(uint64_t comphy_base,
  77. uint8_t comphy_index);
  78. int mvebu_cp110_comphy_digital_reset(uint64_t comphy_base, uint8_t comphy_index,
  79. uint32_t comphy_mode, uint32_t command);
  80. #define COMPHY_POLARITY_NO_INVERT 0
  81. #define COMPHY_POLARITY_TXD_INVERT 1
  82. #define COMPHY_POLARITY_RXD_INVERT 2