0024-wifi-ath11k-add-new-hw-ops-for-IPQ5018-to-get-rx-des.patch 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 69968f88f1770d61cae0febef805fd00d66cf6a1 Mon Sep 17 00:00:00 2001
  2. From: Sriram R <quic_srirrama@quicinc.com>
  3. Date: Fri, 2 Dec 2022 23:37:15 +0200
  4. Subject: [PATCH] wifi: ath11k: add new hw ops for IPQ5018 to get rx dest ring
  5. hashmap
  6. The Destination ring control register is different
  7. for IPQ5018 when compared to IPQ8074/IPQ6018/QCN9074.
  8. Hence create a new hw ops to fetch the hash ring map
  9. for different device variants. ipq5018 hw ops
  10. is similar to qcn9074 except for this change, so reuse
  11. all the qcn9074 ops for ipq5018.
  12. Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
  13. Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
  14. Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  15. Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
  16. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  17. Link: https://lore.kernel.org/r/20221122132152.17771-8-quic_kathirve@quicinc.com
  18. ---
  19. drivers/net/wireless/ath/ath11k/hw.c | 44 ++++++++++++++++++++++++++++
  20. 1 file changed, 44 insertions(+)
  21. --- a/drivers/net/wireless/ath/ath11k/hw.c
  22. +++ b/drivers/net/wireless/ath/ath11k/hw.c
  23. @@ -791,6 +791,49 @@ static void ath11k_hw_wcn6855_reo_setup(
  24. ring_hash_map);
  25. }
  26. +static void ath11k_hw_ipq5018_reo_setup(struct ath11k_base *ab)
  27. +{
  28. + u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
  29. + u32 val;
  30. +
  31. + /* Each hash entry uses three bits to map to a particular ring. */
  32. + u32 ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
  33. + HAL_HASH_ROUTING_RING_SW2 << 4 |
  34. + HAL_HASH_ROUTING_RING_SW3 << 8 |
  35. + HAL_HASH_ROUTING_RING_SW4 << 12 |
  36. + HAL_HASH_ROUTING_RING_SW1 << 16 |
  37. + HAL_HASH_ROUTING_RING_SW2 << 20 |
  38. + HAL_HASH_ROUTING_RING_SW3 << 24 |
  39. + HAL_HASH_ROUTING_RING_SW4 << 28;
  40. +
  41. + val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
  42. +
  43. + val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
  44. + val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING,
  45. + HAL_SRNG_RING_ID_REO2SW1) |
  46. + FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
  47. + FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
  48. + ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
  49. +
  50. + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab),
  51. + HAL_DEFAULT_REO_TIMEOUT_USEC);
  52. + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_1(ab),
  53. + HAL_DEFAULT_REO_TIMEOUT_USEC);
  54. + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_2(ab),
  55. + HAL_DEFAULT_REO_TIMEOUT_USEC);
  56. + ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3(ab),
  57. + HAL_DEFAULT_REO_TIMEOUT_USEC);
  58. +
  59. + ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_0,
  60. + ring_hash_map);
  61. + ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_1,
  62. + ring_hash_map);
  63. + ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
  64. + ring_hash_map);
  65. + ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
  66. + ring_hash_map);
  67. +}
  68. +
  69. static u16 ath11k_hw_ipq8074_mpdu_info_get_peerid(u8 *tlv_data)
  70. {
  71. u16 peer_id = 0;
  72. @@ -1117,6 +1160,7 @@ const struct ath11k_hw_ops ipq5018_ops =
  73. .rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id,
  74. .rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len,
  75. .rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
  76. + .reo_setup = ath11k_hw_ipq5018_reo_setup,
  77. .rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
  78. .mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
  79. .rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,