6000.c 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
  4. * Copyright(c) 2018 Intel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of version 2 of the GNU General Public License as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  18. *
  19. * The full GNU General Public License is included in this distribution in the
  20. * file called LICENSE.
  21. *
  22. * Contact Information:
  23. * Intel Linux Wireless <linuxwifi@intel.com>
  24. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  25. *
  26. *****************************************************************************/
  27. #include <linux/module.h>
  28. #include <linux/stringify.h>
  29. #include "iwl-config.h"
  30. #include "iwl-agn-hw.h"
  31. #include "dvm/commands.h" /* needed for BT for now */
  32. /* Highest firmware API version supported */
  33. #define IWL6000_UCODE_API_MAX 6
  34. #define IWL6050_UCODE_API_MAX 5
  35. #define IWL6000G2_UCODE_API_MAX 6
  36. #define IWL6035_UCODE_API_MAX 6
  37. /* Lowest firmware API version supported */
  38. #define IWL6000_UCODE_API_MIN 4
  39. #define IWL6050_UCODE_API_MIN 4
  40. #define IWL6000G2_UCODE_API_MIN 5
  41. #define IWL6035_UCODE_API_MIN 6
  42. /* EEPROM versions */
  43. #define EEPROM_6000_TX_POWER_VERSION (4)
  44. #define EEPROM_6000_EEPROM_VERSION (0x423)
  45. #define EEPROM_6050_TX_POWER_VERSION (4)
  46. #define EEPROM_6050_EEPROM_VERSION (0x532)
  47. #define EEPROM_6150_TX_POWER_VERSION (6)
  48. #define EEPROM_6150_EEPROM_VERSION (0x553)
  49. #define EEPROM_6005_TX_POWER_VERSION (6)
  50. #define EEPROM_6005_EEPROM_VERSION (0x709)
  51. #define EEPROM_6030_TX_POWER_VERSION (6)
  52. #define EEPROM_6030_EEPROM_VERSION (0x709)
  53. #define EEPROM_6035_TX_POWER_VERSION (6)
  54. #define EEPROM_6035_EEPROM_VERSION (0x753)
  55. #define IWL6000_FW_PRE "iwlwifi-6000-"
  56. #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
  57. #define IWL6050_FW_PRE "iwlwifi-6050-"
  58. #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
  59. #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
  60. #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
  61. #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
  62. #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
  63. static const struct iwl_base_params iwl6000_base_params = {
  64. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  65. .num_of_queues = IWLAGN_NUM_QUEUES,
  66. .max_tfd_queue_size = 256,
  67. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  68. .shadow_ram_support = true,
  69. .led_compensation = 51,
  70. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  71. .max_event_log_size = 512,
  72. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  73. .scd_chain_ext_wa = true,
  74. };
  75. static const struct iwl_base_params iwl6050_base_params = {
  76. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  77. .num_of_queues = IWLAGN_NUM_QUEUES,
  78. .max_tfd_queue_size = 256,
  79. .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
  80. .shadow_ram_support = true,
  81. .led_compensation = 51,
  82. .wd_timeout = IWL_DEF_WD_TIMEOUT,
  83. .max_event_log_size = 1024,
  84. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  85. .scd_chain_ext_wa = true,
  86. };
  87. static const struct iwl_base_params iwl6000_g2_base_params = {
  88. .eeprom_size = OTP_LOW_IMAGE_SIZE,
  89. .num_of_queues = IWLAGN_NUM_QUEUES,
  90. .max_tfd_queue_size = 256,
  91. .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
  92. .shadow_ram_support = true,
  93. .led_compensation = 57,
  94. .wd_timeout = IWL_LONG_WD_TIMEOUT,
  95. .max_event_log_size = 512,
  96. .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
  97. .scd_chain_ext_wa = true,
  98. };
  99. static const struct iwl_ht_params iwl6000_ht_params = {
  100. .ht_greenfield_support = true,
  101. .use_rts_for_aggregation = true, /* use rts/cts protection */
  102. .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
  103. };
  104. static const struct iwl_eeprom_params iwl6000_eeprom_params = {
  105. .regulatory_bands = {
  106. EEPROM_REG_BAND_1_CHANNELS,
  107. EEPROM_REG_BAND_2_CHANNELS,
  108. EEPROM_REG_BAND_3_CHANNELS,
  109. EEPROM_REG_BAND_4_CHANNELS,
  110. EEPROM_REG_BAND_5_CHANNELS,
  111. EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
  112. EEPROM_REG_BAND_52_HT40_CHANNELS
  113. },
  114. .enhanced_txpower = true,
  115. };
  116. #define IWL_DEVICE_6005 \
  117. .fw_name_pre = IWL6005_FW_PRE, \
  118. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  119. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  120. .device_family = IWL_DEVICE_FAMILY_6005, \
  121. .max_inst_size = IWL60_RTC_INST_SIZE, \
  122. .max_data_size = IWL60_RTC_DATA_SIZE, \
  123. .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
  124. .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
  125. .base_params = &iwl6000_g2_base_params, \
  126. .eeprom_params = &iwl6000_eeprom_params, \
  127. .led_mode = IWL_LED_RF_STATE, \
  128. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  129. .csr = &iwl_csr_v1
  130. const struct iwl_cfg iwl6005_2agn_cfg = {
  131. .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
  132. IWL_DEVICE_6005,
  133. .ht_params = &iwl6000_ht_params,
  134. };
  135. const struct iwl_cfg iwl6005_2abg_cfg = {
  136. .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
  137. IWL_DEVICE_6005,
  138. };
  139. const struct iwl_cfg iwl6005_2bg_cfg = {
  140. .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
  141. IWL_DEVICE_6005,
  142. };
  143. const struct iwl_cfg iwl6005_2agn_sff_cfg = {
  144. .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
  145. IWL_DEVICE_6005,
  146. .ht_params = &iwl6000_ht_params,
  147. };
  148. const struct iwl_cfg iwl6005_2agn_d_cfg = {
  149. .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
  150. IWL_DEVICE_6005,
  151. .ht_params = &iwl6000_ht_params,
  152. };
  153. const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
  154. .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
  155. IWL_DEVICE_6005,
  156. .ht_params = &iwl6000_ht_params,
  157. };
  158. const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
  159. .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
  160. IWL_DEVICE_6005,
  161. .ht_params = &iwl6000_ht_params,
  162. };
  163. #define IWL_DEVICE_6030 \
  164. .fw_name_pre = IWL6030_FW_PRE, \
  165. .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
  166. .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
  167. .device_family = IWL_DEVICE_FAMILY_6030, \
  168. .max_inst_size = IWL60_RTC_INST_SIZE, \
  169. .max_data_size = IWL60_RTC_DATA_SIZE, \
  170. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  171. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  172. .base_params = &iwl6000_g2_base_params, \
  173. .eeprom_params = &iwl6000_eeprom_params, \
  174. .led_mode = IWL_LED_RF_STATE, \
  175. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  176. .csr = &iwl_csr_v1
  177. const struct iwl_cfg iwl6030_2agn_cfg = {
  178. .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
  179. IWL_DEVICE_6030,
  180. .ht_params = &iwl6000_ht_params,
  181. };
  182. const struct iwl_cfg iwl6030_2abg_cfg = {
  183. .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
  184. IWL_DEVICE_6030,
  185. };
  186. const struct iwl_cfg iwl6030_2bgn_cfg = {
  187. .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
  188. IWL_DEVICE_6030,
  189. .ht_params = &iwl6000_ht_params,
  190. };
  191. const struct iwl_cfg iwl6030_2bg_cfg = {
  192. .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
  193. IWL_DEVICE_6030,
  194. };
  195. #define IWL_DEVICE_6035 \
  196. .fw_name_pre = IWL6030_FW_PRE, \
  197. .ucode_api_max = IWL6035_UCODE_API_MAX, \
  198. .ucode_api_min = IWL6035_UCODE_API_MIN, \
  199. .device_family = IWL_DEVICE_FAMILY_6030, \
  200. .max_inst_size = IWL60_RTC_INST_SIZE, \
  201. .max_data_size = IWL60_RTC_DATA_SIZE, \
  202. .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
  203. .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
  204. .base_params = &iwl6000_g2_base_params, \
  205. .eeprom_params = &iwl6000_eeprom_params, \
  206. .led_mode = IWL_LED_RF_STATE, \
  207. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  208. .csr = &iwl_csr_v1
  209. const struct iwl_cfg iwl6035_2agn_cfg = {
  210. .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
  211. IWL_DEVICE_6035,
  212. .ht_params = &iwl6000_ht_params,
  213. };
  214. const struct iwl_cfg iwl6035_2agn_sff_cfg = {
  215. .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
  216. IWL_DEVICE_6035,
  217. .ht_params = &iwl6000_ht_params,
  218. };
  219. const struct iwl_cfg iwl1030_bgn_cfg = {
  220. .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
  221. IWL_DEVICE_6030,
  222. .ht_params = &iwl6000_ht_params,
  223. };
  224. const struct iwl_cfg iwl1030_bg_cfg = {
  225. .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
  226. IWL_DEVICE_6030,
  227. };
  228. const struct iwl_cfg iwl130_bgn_cfg = {
  229. .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
  230. IWL_DEVICE_6030,
  231. .ht_params = &iwl6000_ht_params,
  232. .rx_with_siso_diversity = true,
  233. };
  234. const struct iwl_cfg iwl130_bg_cfg = {
  235. .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
  236. IWL_DEVICE_6030,
  237. .rx_with_siso_diversity = true,
  238. };
  239. /*
  240. * "i": Internal configuration, use internal Power Amplifier
  241. */
  242. #define IWL_DEVICE_6000i \
  243. .fw_name_pre = IWL6000_FW_PRE, \
  244. .ucode_api_max = IWL6000_UCODE_API_MAX, \
  245. .ucode_api_min = IWL6000_UCODE_API_MIN, \
  246. .device_family = IWL_DEVICE_FAMILY_6000i, \
  247. .max_inst_size = IWL60_RTC_INST_SIZE, \
  248. .max_data_size = IWL60_RTC_DATA_SIZE, \
  249. .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
  250. .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
  251. .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
  252. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
  253. .base_params = &iwl6000_base_params, \
  254. .eeprom_params = &iwl6000_eeprom_params, \
  255. .led_mode = IWL_LED_BLINK, \
  256. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  257. .csr = &iwl_csr_v1
  258. const struct iwl_cfg iwl6000i_2agn_cfg = {
  259. .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
  260. IWL_DEVICE_6000i,
  261. .ht_params = &iwl6000_ht_params,
  262. };
  263. const struct iwl_cfg iwl6000i_2abg_cfg = {
  264. .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
  265. IWL_DEVICE_6000i,
  266. };
  267. const struct iwl_cfg iwl6000i_2bg_cfg = {
  268. .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
  269. IWL_DEVICE_6000i,
  270. };
  271. #define IWL_DEVICE_6050 \
  272. .fw_name_pre = IWL6050_FW_PRE, \
  273. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  274. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  275. .device_family = IWL_DEVICE_FAMILY_6050, \
  276. .max_inst_size = IWL60_RTC_INST_SIZE, \
  277. .max_data_size = IWL60_RTC_DATA_SIZE, \
  278. .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
  279. .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
  280. .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
  281. .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
  282. .base_params = &iwl6050_base_params, \
  283. .eeprom_params = &iwl6000_eeprom_params, \
  284. .led_mode = IWL_LED_BLINK, \
  285. .internal_wimax_coex = true, \
  286. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  287. .csr = &iwl_csr_v1
  288. const struct iwl_cfg iwl6050_2agn_cfg = {
  289. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
  290. IWL_DEVICE_6050,
  291. .ht_params = &iwl6000_ht_params,
  292. };
  293. const struct iwl_cfg iwl6050_2abg_cfg = {
  294. .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
  295. IWL_DEVICE_6050,
  296. };
  297. #define IWL_DEVICE_6150 \
  298. .fw_name_pre = IWL6050_FW_PRE, \
  299. .ucode_api_max = IWL6050_UCODE_API_MAX, \
  300. .ucode_api_min = IWL6050_UCODE_API_MIN, \
  301. .device_family = IWL_DEVICE_FAMILY_6150, \
  302. .max_inst_size = IWL60_RTC_INST_SIZE, \
  303. .max_data_size = IWL60_RTC_DATA_SIZE, \
  304. .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
  305. .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
  306. .base_params = &iwl6050_base_params, \
  307. .eeprom_params = &iwl6000_eeprom_params, \
  308. .led_mode = IWL_LED_BLINK, \
  309. .internal_wimax_coex = true, \
  310. .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \
  311. .csr = &iwl_csr_v1
  312. const struct iwl_cfg iwl6150_bgn_cfg = {
  313. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
  314. IWL_DEVICE_6150,
  315. .ht_params = &iwl6000_ht_params,
  316. };
  317. const struct iwl_cfg iwl6150_bg_cfg = {
  318. .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
  319. IWL_DEVICE_6150,
  320. };
  321. const struct iwl_cfg iwl6000_3agn_cfg = {
  322. .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
  323. .fw_name_pre = IWL6000_FW_PRE,
  324. .ucode_api_max = IWL6000_UCODE_API_MAX,
  325. .ucode_api_min = IWL6000_UCODE_API_MIN,
  326. .device_family = IWL_DEVICE_FAMILY_6000,
  327. .max_inst_size = IWL60_RTC_INST_SIZE,
  328. .max_data_size = IWL60_RTC_DATA_SIZE,
  329. .nvm_ver = EEPROM_6000_EEPROM_VERSION,
  330. .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
  331. .base_params = &iwl6000_base_params,
  332. .eeprom_params = &iwl6000_eeprom_params,
  333. .ht_params = &iwl6000_ht_params,
  334. .led_mode = IWL_LED_BLINK,
  335. .csr = &iwl_csr_v1,
  336. };
  337. MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
  338. MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
  339. MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
  340. MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));