9000.c 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2015-2017 Intel Deutschland GmbH
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of version 2 of the GNU General Public License as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * BSD LICENSE
  20. *
  21. * Copyright(c) 2015-2017 Intel Deutschland GmbH
  22. * All rights reserved.
  23. *
  24. * Redistribution and use in source and binary forms, with or without
  25. * modification, are permitted provided that the following conditions
  26. * are met:
  27. *
  28. * * Redistributions of source code must retain the above copyright
  29. * notice, this list of conditions and the following disclaimer.
  30. * * Redistributions in binary form must reproduce the above copyright
  31. * notice, this list of conditions and the following disclaimer in
  32. * the documentation and/or other materials provided with the
  33. * distribution.
  34. * * Neither the name Intel Corporation nor the names of its
  35. * contributors may be used to endorse or promote products derived
  36. * from this software without specific prior written permission.
  37. *
  38. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  39. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  40. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  41. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  42. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  43. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  44. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  45. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  46. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  47. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  48. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  49. *
  50. *****************************************************************************/
  51. #include <linux/module.h>
  52. #include <linux/stringify.h>
  53. #include "iwl-config.h"
  54. #include "iwl-agn-hw.h"
  55. /* Highest firmware API version supported */
  56. #define IWL9000_UCODE_API_MAX 34
  57. /* Lowest firmware API version supported */
  58. #define IWL9000_UCODE_API_MIN 30
  59. /* NVM versions */
  60. #define IWL9000_NVM_VERSION 0x0a1d
  61. #define IWL9000_TX_POWER_VERSION 0xffff /* meaningless */
  62. /* Memory offsets and lengths */
  63. #define IWL9000_DCCM_OFFSET 0x800000
  64. #define IWL9000_DCCM_LEN 0x18000
  65. #define IWL9000_DCCM2_OFFSET 0x880000
  66. #define IWL9000_DCCM2_LEN 0x8000
  67. #define IWL9000_SMEM_OFFSET 0x400000
  68. #define IWL9000_SMEM_LEN 0x68000
  69. #define IWL9000_FW_PRE "iwlwifi-9000-pu-a0-jf-a0-"
  70. #define IWL9000RFB_FW_PRE "iwlwifi-9000-pu-a0-jf-b0-"
  71. #define IWL9260A_FW_PRE "iwlwifi-9260-th-a0-jf-a0-"
  72. #define IWL9260B_FW_PRE "iwlwifi-9260-th-b0-jf-b0-"
  73. #define IWL9000_MODULE_FIRMWARE(api) \
  74. IWL9000_FW_PRE "-" __stringify(api) ".ucode"
  75. #define IWL9000RFB_MODULE_FIRMWARE(api) \
  76. IWL9000RFB_FW_PRE "-" __stringify(api) ".ucode"
  77. #define IWL9260A_MODULE_FIRMWARE(api) \
  78. IWL9260A_FW_PRE "-" __stringify(api) ".ucode"
  79. #define IWL9260B_MODULE_FIRMWARE(api) \
  80. IWL9260B_FW_PRE "-" __stringify(api) ".ucode"
  81. #define NVM_HW_SECTION_NUM_FAMILY_9000 10
  82. static const struct iwl_base_params iwl9000_base_params = {
  83. .eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_9000,
  84. .num_of_queues = 31,
  85. .shadow_ram_support = true,
  86. .led_compensation = 57,
  87. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  88. .max_event_log_size = 512,
  89. .shadow_reg_enable = true,
  90. .pcie_l1_allowed = true,
  91. };
  92. static const struct iwl_ht_params iwl9000_ht_params = {
  93. .stbc = true,
  94. .ldpc = true,
  95. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  96. };
  97. static const struct iwl_tt_params iwl9000_tt_params = {
  98. .ct_kill_entry = 115,
  99. .ct_kill_exit = 93,
  100. .ct_kill_duration = 5,
  101. .dynamic_smps_entry = 111,
  102. .dynamic_smps_exit = 107,
  103. .tx_protection_entry = 112,
  104. .tx_protection_exit = 105,
  105. .tx_backoff = {
  106. {.temperature = 110, .backoff = 200},
  107. {.temperature = 111, .backoff = 600},
  108. {.temperature = 112, .backoff = 1200},
  109. {.temperature = 113, .backoff = 2000},
  110. {.temperature = 114, .backoff = 4000},
  111. },
  112. .support_ct_kill = true,
  113. .support_dynamic_smps = true,
  114. .support_tx_protection = true,
  115. .support_tx_backoff = true,
  116. };
  117. #define IWL_DEVICE_9000 \
  118. .ucode_api_max = IWL9000_UCODE_API_MAX, \
  119. .ucode_api_min = IWL9000_UCODE_API_MIN, \
  120. .device_family = IWL_DEVICE_FAMILY_9000, \
  121. .max_inst_size = IWL60_RTC_INST_SIZE, \
  122. .max_data_size = IWL60_RTC_DATA_SIZE, \
  123. .base_params = &iwl9000_base_params, \
  124. .led_mode = IWL_LED_RF_STATE, \
  125. .nvm_hw_section_num = NVM_HW_SECTION_NUM_FAMILY_9000, \
  126. .non_shared_ant = ANT_A, \
  127. .dccm_offset = IWL9000_DCCM_OFFSET, \
  128. .dccm_len = IWL9000_DCCM_LEN, \
  129. .dccm2_offset = IWL9000_DCCM2_OFFSET, \
  130. .dccm2_len = IWL9000_DCCM2_LEN, \
  131. .smem_offset = IWL9000_SMEM_OFFSET, \
  132. .smem_len = IWL9000_SMEM_LEN, \
  133. .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \
  134. .thermal_params = &iwl9000_tt_params, \
  135. .apmg_not_supported = true, \
  136. .mq_rx_supported = true, \
  137. .vht_mu_mimo_supported = true, \
  138. .mac_addr_from_csr = true, \
  139. .rf_id = true, \
  140. .ext_nvm = true, \
  141. .dbgc_supported = true
  142. const struct iwl_cfg iwl9160_2ac_cfg = {
  143. .name = "Intel(R) Dual Band Wireless AC 9160",
  144. .fw_name_pre = IWL9260A_FW_PRE,
  145. .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
  146. IWL_DEVICE_9000,
  147. .ht_params = &iwl9000_ht_params,
  148. .nvm_ver = IWL9000_NVM_VERSION,
  149. .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
  150. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  151. };
  152. const struct iwl_cfg iwl9260_2ac_cfg = {
  153. .name = "Intel(R) Dual Band Wireless AC 9260",
  154. .fw_name_pre = IWL9260A_FW_PRE,
  155. .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
  156. IWL_DEVICE_9000,
  157. .ht_params = &iwl9000_ht_params,
  158. .nvm_ver = IWL9000_NVM_VERSION,
  159. .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
  160. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  161. };
  162. const struct iwl_cfg iwl9270_2ac_cfg = {
  163. .name = "Intel(R) Dual Band Wireless AC 9270",
  164. .fw_name_pre = IWL9260A_FW_PRE,
  165. .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
  166. IWL_DEVICE_9000,
  167. .ht_params = &iwl9000_ht_params,
  168. .nvm_ver = IWL9000_NVM_VERSION,
  169. .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
  170. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  171. };
  172. const struct iwl_cfg iwl9460_2ac_cfg = {
  173. .name = "Intel(R) Dual Band Wireless AC 9460",
  174. .fw_name_pre = IWL9260A_FW_PRE,
  175. .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
  176. IWL_DEVICE_9000,
  177. .ht_params = &iwl9000_ht_params,
  178. .nvm_ver = IWL9000_NVM_VERSION,
  179. .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
  180. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  181. .integrated = true,
  182. };
  183. const struct iwl_cfg iwl9560_2ac_cfg = {
  184. .name = "Intel(R) Dual Band Wireless AC 9560",
  185. .fw_name_pre = IWL9260A_FW_PRE,
  186. .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE,
  187. IWL_DEVICE_9000,
  188. .ht_params = &iwl9000_ht_params,
  189. .nvm_ver = IWL9000_NVM_VERSION,
  190. .nvm_calib_ver = IWL9000_TX_POWER_VERSION,
  191. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
  192. .integrated = true,
  193. };
  194. MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
  195. MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
  196. MODULE_FIRMWARE(IWL9260A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
  197. MODULE_FIRMWARE(IWL9260B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));