kona-port-config.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _KONA_PORT_CONFIG
  6. #define _KONA_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. {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},/* PCM OUT */
  40. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX1 */
  41. {1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1}, /* TX2 */
  42. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX3 */
  43. {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1}, /* TX4 */
  44. };
  45. static struct swr_mstr_port_map sm_port_map[] = {
  46. {TX_MACRO, SWR_UC0, tx_frame_params_default},
  47. {RX_MACRO, SWR_UC0, rx_frame_params_default},
  48. {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
  49. {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
  50. };
  51. #endif /* _KONA_PORT_CONFIG */