950-4-4-ath10k-Enable-support-for-QCA9984.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. From 651b4cdcf97e75f6346784b75ca7bf3c85187143 Mon Sep 17 00:00:00 2001
  2. From: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
  3. Date: Mon, 23 May 2016 23:12:45 +0300
  4. Subject: ath10k: enable support for QCA9984
  5. QCA9984 shares the same configuration with QCA99X0.
  6. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
  7. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  8. ---
  9. drivers/net/wireless/ath/ath10k/core.c | 23 +++++++++++++++++++++++
  10. drivers/net/wireless/ath/ath10k/hw.h | 11 +++++++++++
  11. drivers/net/wireless/ath/ath10k/pci.c | 14 ++++++++++++++
  12. 3 files changed, 48 insertions(+)
  13. diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
  14. index 49af624..a003980 100644
  15. --- a/drivers/net/wireless/ath/ath10k/core.c
  16. +++ b/drivers/net/wireless/ath/ath10k/core.c
  17. @@ -163,6 +163,28 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
  18. },
  19. },
  20. {
  21. + .id = QCA9984_HW_1_0_DEV_VERSION,
  22. + .dev_id = QCA9984_1_0_DEVICE_ID,
  23. + .name = "qca9984/qca9994 hw1.0",
  24. + .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
  25. + .uart_pin = 7,
  26. + .otp_exe_param = 0x00000700,
  27. + .continuous_frag_desc = true,
  28. + .channel_counters_freq_hz = 150000,
  29. + .max_probe_resp_desc_thres = 24,
  30. + .hw_4addr_pad = ATH10K_HW_4ADDR_PAD_BEFORE,
  31. + .tx_chain_mask = 0xf,
  32. + .rx_chain_mask = 0xf,
  33. + .max_spatial_stream = 4,
  34. + .cal_data_len = 12064,
  35. + .fw = {
  36. + .dir = QCA9984_HW_1_0_FW_DIR,
  37. + .board = QCA9984_HW_1_0_BOARD_DATA_FILE,
  38. + .board_size = QCA99X0_BOARD_DATA_SZ,
  39. + .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
  40. + },
  41. + },
  42. + {
  43. .id = QCA9377_HW_1_0_DEV_VERSION,
  44. .dev_id = QCA9377_1_0_DEVICE_ID,
  45. .name = "qca9377 hw1.0",
  46. @@ -2071,6 +2093,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
  47. ar->hw_values = &qca6174_values;
  48. break;
  49. case ATH10K_HW_QCA99X0:
  50. + case ATH10K_HW_QCA9984:
  51. ar->regs = &qca99x0_regs;
  52. ar->hw_values = &qca99x0_values;
  53. break;
  54. diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
  55. index aedd898..f41c91c 100644
  56. --- a/drivers/net/wireless/ath/ath10k/hw.h
  57. +++ b/drivers/net/wireless/ath/ath10k/hw.h
  58. @@ -26,6 +26,7 @@
  59. #define QCA6164_2_1_DEVICE_ID (0x0041)
  60. #define QCA6174_2_1_DEVICE_ID (0x003e)
  61. #define QCA99X0_2_0_DEVICE_ID (0x0040)
  62. +#define QCA9984_1_0_DEVICE_ID (0x0046)
  63. #define QCA9377_1_0_DEVICE_ID (0x0042)
  64. /* QCA988X 1.0 definitions (unsupported) */
  65. @@ -91,6 +92,14 @@ enum qca9377_chip_id_rev {
  66. #define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
  67. #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
  68. +/* QCA9984 1.0 defines */
  69. +#define QCA9984_HW_1_0_DEV_VERSION 0x1000000
  70. +#define QCA9984_HW_DEV_TYPE 0xa
  71. +#define QCA9984_HW_1_0_CHIP_ID_REV 0x0
  72. +#define QCA9984_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9984/hw1.0"
  73. +#define QCA9984_HW_1_0_BOARD_DATA_FILE "board.bin"
  74. +#define QCA9984_HW_1_0_PATCH_LOAD_ADDR 0x1234
  75. +
  76. /* QCA9377 1.0 definitions */
  77. #define QCA9377_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9377/hw1.0"
  78. #define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
  79. @@ -193,6 +202,7 @@ enum ath10k_hw_rev {
  80. ATH10K_HW_QCA988X,
  81. ATH10K_HW_QCA6174,
  82. ATH10K_HW_QCA99X0,
  83. + ATH10K_HW_QCA9984,
  84. ATH10K_HW_QCA9377,
  85. ATH10K_HW_QCA4019,
  86. };
  87. @@ -249,6 +259,7 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
  88. #define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
  89. #define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
  90. #define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
  91. +#define QCA_REV_9984(ar) ((ar)->hw_rev == ATH10K_HW_QCA9984)
  92. #define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
  93. #define QCA_REV_40XX(ar) ((ar)->hw_rev == ATH10K_HW_QCA4019)
  94. diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
  95. index 81d6bad..8e8e1eb 100644
  96. --- a/drivers/net/wireless/ath/ath10k/pci.c
  97. +++ b/drivers/net/wireless/ath/ath10k/pci.c
  98. @@ -56,6 +56,7 @@ static const struct pci_device_id ath10k_pci_id_table[] = {
  99. { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
  100. { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */
  101. { PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
  102. + { PCI_VDEVICE(ATHEROS, QCA9984_1_0_DEVICE_ID) }, /* PCI-E QCA9984 V1 */
  103. { PCI_VDEVICE(ATHEROS, QCA9377_1_0_DEVICE_ID) }, /* PCI-E QCA9377 V1 */
  104. {0}
  105. };
  106. @@ -81,8 +82,11 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
  107. { QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
  108. + { QCA9984_1_0_DEVICE_ID, QCA9984_HW_1_0_CHIP_ID_REV },
  109. +
  110. { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
  111. { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
  112. +
  113. };
  114. static void ath10k_pci_buffer_cleanup(struct ath10k *ar);
  115. @@ -844,6 +848,7 @@ static u32 ath10k_pci_targ_cpu_to_ce_addr(struct ath10k *ar, u32 addr)
  116. 0x7ff) << 21;
  117. break;
  118. case ATH10K_HW_QCA99X0:
  119. + case ATH10K_HW_QCA9984:
  120. case ATH10K_HW_QCA4019:
  121. val = ath10k_pci_read32(ar, PCIE_BAR_REG_ADDRESS);
  122. break;
  123. @@ -1569,6 +1574,7 @@ static void ath10k_pci_irq_msi_fw_mask(struct ath10k *ar)
  124. CORE_CTRL_ADDRESS, val);
  125. break;
  126. case ATH10K_HW_QCA99X0:
  127. + case ATH10K_HW_QCA9984:
  128. case ATH10K_HW_QCA4019:
  129. /* TODO: Find appropriate register configuration for QCA99X0
  130. * to mask irq/MSI.
  131. @@ -1592,6 +1598,7 @@ static void ath10k_pci_irq_msi_fw_unmask(struct ath10k *ar)
  132. CORE_CTRL_ADDRESS, val);
  133. break;
  134. case ATH10K_HW_QCA99X0:
  135. + case ATH10K_HW_QCA9984:
  136. case ATH10K_HW_QCA4019:
  137. /* TODO: Find appropriate register configuration for QCA99X0
  138. * to unmask irq/MSI.
  139. @@ -1932,6 +1939,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
  140. switch (ar_pci->pdev->device) {
  141. case QCA988X_2_0_DEVICE_ID:
  142. case QCA99X0_2_0_DEVICE_ID:
  143. + case QCA9984_1_0_DEVICE_ID:
  144. return 1;
  145. case QCA6164_2_1_DEVICE_ID:
  146. case QCA6174_2_1_DEVICE_ID:
  147. @@ -2999,6 +3007,12 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
  148. pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
  149. pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
  150. break;
  151. + case QCA9984_1_0_DEVICE_ID:
  152. + hw_rev = ATH10K_HW_QCA9984;
  153. + pci_ps = false;
  154. + pci_soft_reset = ath10k_pci_qca99x0_soft_chip_reset;
  155. + pci_hard_reset = ath10k_pci_qca99x0_chip_reset;
  156. + break;
  157. case QCA9377_1_0_DEVICE_ID:
  158. hw_rev = ATH10K_HW_QCA9377;
  159. pci_ps = true;
  160. --
  161. cgit v0.12