1
0

0020-wifi-ath11k-update-ce-configurations-for-IPQ5018.patch 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. From 26af7aabd2d8225c6b2056234626ba5099610871 Mon Sep 17 00:00:00 2001
  2. From: Sriram R <quic_srirrama@quicinc.com>
  3. Date: Fri, 2 Dec 2022 23:37:14 +0200
  4. Subject: [PATCH] wifi: ath11k: update ce configurations for IPQ5018
  5. IPQ5018 is a single pdev device. Update host
  6. and target CE configurations accordingly.
  7. Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
  8. Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
  9. Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  10. Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  11. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  12. Link: https://lore.kernel.org/r/20221122132152.17771-4-quic_kathirve@quicinc.com
  13. ---
  14. drivers/net/wireless/ath/ath11k/core.c | 4 +
  15. drivers/net/wireless/ath/ath11k/core.h | 3 +
  16. drivers/net/wireless/ath/ath11k/hw.c | 191 +++++++++++++++++++++++++
  17. 3 files changed, 198 insertions(+)
  18. --- a/drivers/net/wireless/ath/ath11k/core.c
  19. +++ b/drivers/net/wireless/ath/ath11k/core.c
  20. @@ -630,6 +630,10 @@ static const struct ath11k_hw_params ath
  21. .internal_sleep_clock = false,
  22. .host_ce_config = ath11k_host_ce_config_qcn9074,
  23. .ce_count = CE_CNT_5018,
  24. + .target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
  25. + .target_ce_count = TARGET_CE_CNT_5018,
  26. + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
  27. + .svc_to_ce_map_len = SVC_CE_MAP_LEN_5018,
  28. .rxdma1_enable = true,
  29. .num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
  30. .rx_mac_buf_ring = false,
  31. --- a/drivers/net/wireless/ath/ath11k/core.h
  32. +++ b/drivers/net/wireless/ath/ath11k/core.h
  33. @@ -1145,6 +1145,9 @@ extern const struct service_to_pipe ath1
  34. extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
  35. extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
  36. +extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[];
  37. +extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[];
  38. +
  39. extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
  40. extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
  41. int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
  42. --- a/drivers/net/wireless/ath/ath11k/hw.c
  43. +++ b/drivers/net/wireless/ath/ath11k/hw.c
  44. @@ -1972,6 +1972,197 @@ const struct ath11k_hw_ring_mask ath11k_
  45. },
  46. };
  47. +/* Target firmware's Copy Engine configuration for IPQ5018 */
  48. +const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
  49. + /* CE0: host->target HTC control and raw streams */
  50. + {
  51. + .pipenum = __cpu_to_le32(0),
  52. + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
  53. + .nentries = __cpu_to_le32(32),
  54. + .nbytes_max = __cpu_to_le32(2048),
  55. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  56. + .reserved = __cpu_to_le32(0),
  57. + },
  58. +
  59. + /* CE1: target->host HTT + HTC control */
  60. + {
  61. + .pipenum = __cpu_to_le32(1),
  62. + .pipedir = __cpu_to_le32(PIPEDIR_IN),
  63. + .nentries = __cpu_to_le32(32),
  64. + .nbytes_max = __cpu_to_le32(2048),
  65. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  66. + .reserved = __cpu_to_le32(0),
  67. + },
  68. +
  69. + /* CE2: target->host WMI */
  70. + {
  71. + .pipenum = __cpu_to_le32(2),
  72. + .pipedir = __cpu_to_le32(PIPEDIR_IN),
  73. + .nentries = __cpu_to_le32(32),
  74. + .nbytes_max = __cpu_to_le32(2048),
  75. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  76. + .reserved = __cpu_to_le32(0),
  77. + },
  78. +
  79. + /* CE3: host->target WMI */
  80. + {
  81. + .pipenum = __cpu_to_le32(3),
  82. + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
  83. + .nentries = __cpu_to_le32(32),
  84. + .nbytes_max = __cpu_to_le32(2048),
  85. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  86. + .reserved = __cpu_to_le32(0),
  87. + },
  88. +
  89. + /* CE4: host->target HTT */
  90. + {
  91. + .pipenum = __cpu_to_le32(4),
  92. + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
  93. + .nentries = __cpu_to_le32(256),
  94. + .nbytes_max = __cpu_to_le32(256),
  95. + .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
  96. + .reserved = __cpu_to_le32(0),
  97. + },
  98. +
  99. + /* CE5: target->host Pktlog */
  100. + {
  101. + .pipenum = __cpu_to_le32(5),
  102. + .pipedir = __cpu_to_le32(PIPEDIR_IN),
  103. + .nentries = __cpu_to_le32(32),
  104. + .nbytes_max = __cpu_to_le32(2048),
  105. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  106. + .reserved = __cpu_to_le32(0),
  107. + },
  108. +
  109. + /* CE6: Reserved for target autonomous hif_memcpy */
  110. + {
  111. + .pipenum = __cpu_to_le32(6),
  112. + .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
  113. + .nentries = __cpu_to_le32(32),
  114. + .nbytes_max = __cpu_to_le32(16384),
  115. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  116. + .reserved = __cpu_to_le32(0),
  117. + },
  118. +
  119. + /* CE7 used only by Host */
  120. + {
  121. + .pipenum = __cpu_to_le32(7),
  122. + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
  123. + .nentries = __cpu_to_le32(32),
  124. + .nbytes_max = __cpu_to_le32(2048),
  125. + .flags = __cpu_to_le32(0x2000),
  126. + .reserved = __cpu_to_le32(0),
  127. + },
  128. +
  129. + /* CE8 target->host used only by IPA */
  130. + {
  131. + .pipenum = __cpu_to_le32(8),
  132. + .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
  133. + .nentries = __cpu_to_le32(32),
  134. + .nbytes_max = __cpu_to_le32(16384),
  135. + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
  136. + .reserved = __cpu_to_le32(0),
  137. + },
  138. +};
  139. +
  140. +/* Map from service/endpoint to Copy Engine for IPQ5018.
  141. + * This table is derived from the CE TABLE, above.
  142. + * It is passed to the Target at startup for use by firmware.
  143. + */
  144. +const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[] = {
  145. + {
  146. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
  147. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  148. + .pipenum = __cpu_to_le32(3),
  149. + },
  150. + {
  151. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
  152. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  153. + .pipenum = __cpu_to_le32(2),
  154. + },
  155. + {
  156. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
  157. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  158. + .pipenum = __cpu_to_le32(3),
  159. + },
  160. + {
  161. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
  162. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  163. + .pipenum = __cpu_to_le32(2),
  164. + },
  165. + {
  166. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
  167. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  168. + .pipenum = __cpu_to_le32(3),
  169. + },
  170. + {
  171. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
  172. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  173. + .pipenum = __cpu_to_le32(2),
  174. + },
  175. + {
  176. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
  177. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  178. + .pipenum = __cpu_to_le32(3),
  179. + },
  180. + {
  181. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
  182. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  183. + .pipenum = __cpu_to_le32(2),
  184. + },
  185. + {
  186. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
  187. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  188. + .pipenum = __cpu_to_le32(3),
  189. + },
  190. + {
  191. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
  192. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  193. + .pipenum = __cpu_to_le32(2),
  194. + },
  195. +
  196. + {
  197. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
  198. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  199. + .pipenum = __cpu_to_le32(0),
  200. + },
  201. + {
  202. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
  203. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  204. + .pipenum = __cpu_to_le32(1),
  205. + },
  206. +
  207. + {
  208. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
  209. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  210. + .pipenum = __cpu_to_le32(0),
  211. + },
  212. + {
  213. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
  214. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  215. + .pipenum = __cpu_to_le32(1),
  216. + },
  217. + {
  218. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
  219. + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
  220. + .pipenum = __cpu_to_le32(4),
  221. + },
  222. + {
  223. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
  224. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  225. + .pipenum = __cpu_to_le32(1),
  226. + },
  227. + {
  228. + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG),
  229. + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
  230. + .pipenum = __cpu_to_le32(5),
  231. + },
  232. +
  233. + /* (Additions here) */
  234. +
  235. + { /* terminator entry */ }
  236. +};
  237. +
  238. const struct ath11k_hw_regs ipq8074_regs = {
  239. /* SW2TCL(x) R0 ring configuration address */
  240. .hal_tcl1_ring_base_lsb = 0x00000510,