k3-psil.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2019 Texas Instruments Incorporated - https://www.ti.com
  4. */
  5. #ifndef K3_PSIL_H_
  6. #define K3_PSIL_H_
  7. #include <linux/types.h>
  8. #define K3_PSIL_DST_THREAD_ID_OFFSET 0x8000
  9. struct device;
  10. /**
  11. * enum udma_tp_level - Channel Throughput Levels
  12. * @UDMA_TP_NORMAL: Normal channel
  13. * @UDMA_TP_HIGH: High Throughput channel
  14. * @UDMA_TP_ULTRAHIGH: Ultra High Throughput channel
  15. */
  16. enum udma_tp_level {
  17. UDMA_TP_NORMAL = 0,
  18. UDMA_TP_HIGH,
  19. UDMA_TP_ULTRAHIGH,
  20. UDMA_TP_LAST,
  21. };
  22. /**
  23. * enum psil_endpoint_type - PSI-L Endpoint type
  24. * @PSIL_EP_NATIVE: Normal channel
  25. * @PSIL_EP_PDMA_XY: XY mode PDMA
  26. * @PSIL_EP_PDMA_MCAN: MCAN mode PDMA
  27. * @PSIL_EP_PDMA_AASRC: AASRC mode PDMA
  28. */
  29. enum psil_endpoint_type {
  30. PSIL_EP_NATIVE = 0,
  31. PSIL_EP_PDMA_XY,
  32. PSIL_EP_PDMA_MCAN,
  33. PSIL_EP_PDMA_AASRC,
  34. };
  35. /**
  36. * struct psil_endpoint_config - PSI-L Endpoint configuration
  37. * @ep_type: PSI-L endpoint type
  38. * @channel_tpl: Desired throughput level for the channel
  39. * @pkt_mode: If set, the channel must be in Packet mode, otherwise in
  40. * TR mode
  41. * @notdpkt: TDCM must be suppressed on the TX channel
  42. * @needs_epib: Endpoint needs EPIB
  43. * @pdma_acc32: ACC32 must be enabled on the PDMA side
  44. * @pdma_burst: BURST must be enabled on the PDMA side
  45. * @psd_size: If set, PSdata is used by the endpoint
  46. * @mapped_channel_id: PKTDMA thread to channel mapping for mapped channels.
  47. * The thread must be serviced by the specified channel if
  48. * mapped_channel_id is >= 0 in case of PKTDMA
  49. * @flow_start: PKDMA flow range start of mapped channel. Unmapped
  50. * channels use flow_id == chan_id
  51. * @flow_num: PKDMA flow count of mapped channel. Unmapped channels
  52. * use flow_id == chan_id
  53. * @default_flow_id: PKDMA default (r)flow index of mapped channel.
  54. * Must be within the flow range of the mapped channel.
  55. */
  56. struct psil_endpoint_config {
  57. enum psil_endpoint_type ep_type;
  58. enum udma_tp_level channel_tpl;
  59. unsigned pkt_mode:1;
  60. unsigned notdpkt:1;
  61. unsigned needs_epib:1;
  62. /* PDMA properties, valid for PSIL_EP_PDMA_* */
  63. unsigned pdma_acc32:1;
  64. unsigned pdma_burst:1;
  65. u32 psd_size;
  66. /* PKDMA mapped channel */
  67. s16 mapped_channel_id;
  68. /* PKTDMA tflow and rflow ranges for mapped channel */
  69. u16 flow_start;
  70. u16 flow_num;
  71. s16 default_flow_id;
  72. };
  73. int psil_set_new_ep_config(struct device *dev, const char *name,
  74. struct psil_endpoint_config *ep_config);
  75. #endif /* K3_PSIL_H_ */