lahaina-port-config.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _LAHAINA_PORT_CONFIG
  6. #define _LAHAINA_PORT_CONFIG
  7. #include <soc/swr-common.h>
  8. #define WSA_MSTR_PORT_MASK 0xFF
  9. /*
  10. * Add port configuration in the format
  11. *{ si, off1, off2, hstart, hstop, wd_len, bp_mode, bgp_ctrl, lane_ctrl}
  12. */
  13. static struct port_params wsa_frame_params_default[SWR_MSTR_PORT_LEN] = {
  14. {7, 1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  15. {31, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  16. {63, 12, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF},
  17. {7, 6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  18. {31, 18, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  19. {63, 13, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF},
  20. {15, 7, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  21. {15, 10, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
  22. };
  23. static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = {
  24. {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1},
  25. {31, 0, 0, 3, 6, 7, 0, 0xFF, 0},
  26. {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0},
  27. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0},
  28. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0},
  29. };
  30. static struct port_params rx_frame_params_dsd[SWR_MSTR_PORT_LEN] = {
  31. {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1},
  32. {31, 0, 0, 3, 6, 7, 0, 0xFF, 0},
  33. {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0},
  34. {7, 9, 0, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0},
  35. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 3, 0},
  36. };
  37. /* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
  38. static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = {
  39. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX1 */
  40. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX2 */
  41. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX3 */
  42. };
  43. /* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
  44. static struct port_params tx_frame_params_v2[SWR_MSTR_PORT_LEN] = {
  45. {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},/* PCM OUT */
  46. {1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1}, /* TX1 */
  47. {1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2}, /* TX2 */
  48. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX3 */
  49. {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 2}, /* TX4 */
  50. };
  51. static struct swr_mstr_port_map sm_port_map[] = {
  52. {TX_MACRO, SWR_UC0, tx_frame_params_default},
  53. {RX_MACRO, SWR_UC0, rx_frame_params_default},
  54. {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
  55. {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
  56. };
  57. static struct swr_mstr_port_map sm_port_map_v2[] = {
  58. {TX_MACRO, SWR_UC0, tx_frame_params_v2},
  59. {RX_MACRO, SWR_UC0, rx_frame_params_default},
  60. {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
  61. {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
  62. };
  63. #endif /* _LAHAINA_PORT_CONFIG */