blob: 4aa8f0a05c8aea14ec98392cd9e0c6091687b458 [file] [log] [blame]
Tomas Winkler5a6a2562008-04-24 11:55:23 -07001/******************************************************************************
2 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02003 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
Tomas Winkler5a6a2562008-04-24 11:55:23 -07004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
Emmanuel Grumbachd01c5362015-11-17 15:39:56 +020022 * Intel Linux Wireless <linuxwifi@intel.com>
Tomas Winkler5a6a2562008-04-24 11:55:23 -070023 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Tomas Winkler5a6a2562008-04-24 11:55:23 -070027#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070028#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070029#include "iwl-config.h"
Johannes Berg0db19cd2012-04-03 20:57:59 +020030#include "iwl-agn-hw.h"
31#include "iwl-csr.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070032
Reinette Chatrea0987a82008-12-02 12:14:06 -080033/* Highest firmware API version supported */
Fry, Donald H41504cc2011-02-16 11:49:34 -080034#define IWL5000_UCODE_API_MAX 5
Jay Sternberg39e6d222009-02-27 16:21:19 -080035#define IWL5150_UCODE_API_MAX 2
Tomas Winkler5a6a2562008-04-24 11:55:23 -070036
Reinette Chatrea0987a82008-12-02 12:14:06 -080037/* Lowest firmware API version supported */
38#define IWL5000_UCODE_API_MIN 1
39#define IWL5150_UCODE_API_MIN 1
40
Johannes Berg586aed92012-04-03 20:41:07 +020041/* EEPROM versions */
42#define EEPROM_5000_TX_POWER_VERSION (4)
43#define EEPROM_5000_EEPROM_VERSION (0x11A)
44#define EEPROM_5050_TX_POWER_VERSION (4)
45#define EEPROM_5050_EEPROM_VERSION (0x21E)
46
Reinette Chatrea0987a82008-12-02 12:14:06 -080047#define IWL5000_FW_PRE "iwlwifi-5000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070048#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
Reinette Chatrea0987a82008-12-02 12:14:06 -080049
50#define IWL5150_FW_PRE "iwlwifi-5150-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070051#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
Jay Sternberg4e062f92008-10-14 12:32:41 -070052
Johannes Berg6794f3e2012-03-06 13:30:56 -080053static const struct iwl_base_params iwl5000_base_params = {
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070054 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070055 .num_of_queues = IWLAGN_NUM_QUEUES,
Johannes Berg77d76932016-04-12 12:36:01 +020056 .pll_cfg = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -070057 .led_compensation = 51,
Paul Bolle6de49022012-05-30 09:14:41 +020058 .wd_timeout = IWL_WATCHDOG_DISABLED,
Wey-Yi Guy678b3852010-03-26 12:54:37 -070059 .max_event_log_size = 512,
Emmanuel Grumbache03bbb62014-04-13 10:49:16 +030060 .scd_chain_ext_wa = true,
Tomas Winkler5a6a2562008-04-24 11:55:23 -070061};
Johannes Berg6794f3e2012-03-06 13:30:56 -080062
63static const struct iwl_ht_params iwl5000_ht_params = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070064 .ht_greenfield_support = true,
Johannes Berg57fbcce2016-04-12 15:56:15 +020065 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070066};
67
Johannes Berg26a7ca92012-05-21 11:55:54 +020068static const struct iwl_eeprom_params iwl5000_eeprom_params = {
69 .regulatory_bands = {
70 EEPROM_REG_BAND_1_CHANNELS,
71 EEPROM_REG_BAND_2_CHANNELS,
72 EEPROM_REG_BAND_3_CHANNELS,
73 EEPROM_REG_BAND_4_CHANNELS,
74 EEPROM_REG_BAND_5_CHANNELS,
75 EEPROM_REG_BAND_24_HT40_CHANNELS,
76 EEPROM_REG_BAND_52_HT40_CHANNELS
77 },
78};
79
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080080#define IWL_DEVICE_5000 \
81 .fw_name_pre = IWL5000_FW_PRE, \
82 .ucode_api_max = IWL5000_UCODE_API_MAX, \
83 .ucode_api_min = IWL5000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -070084 .device_family = IWL_DEVICE_FAMILY_5000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +020085 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
86 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +020087 .nvm_ver = EEPROM_5000_EEPROM_VERSION, \
88 .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080089 .base_params = &iwl5000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +020090 .eeprom_params = &iwl5000_eeprom_params, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +020091 .led_mode = IWL_LED_BLINK, \
92 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080093
Johannes Berg706c4ff2012-03-05 11:24:33 -080094const struct iwl_cfg iwl5300_agn_cfg = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070095 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080096 IWL_DEVICE_5000,
Johannes Berg2845fd82011-04-05 08:55:05 -070097 /* at least EEPROM 0x11A has wrong info */
98 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
99 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700100 .ht_params = &iwl5000_ht_params,
101};
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700102
Johannes Berg706c4ff2012-03-05 11:24:33 -0800103const struct iwl_cfg iwl5100_bgn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800104 .name = "Intel(R) WiFi Link 5100 BGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800105 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800106 .valid_tx_ant = ANT_B, /* .cfg overwrite */
107 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700108 .ht_params = &iwl5000_ht_params,
Esti Kummer47408632008-07-11 11:53:30 +0800109};
110
Johannes Berg706c4ff2012-03-05 11:24:33 -0800111const struct iwl_cfg iwl5100_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800112 .name = "Intel(R) WiFi Link 5100 ABG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800113 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800114 .valid_tx_ant = ANT_B, /* .cfg overwrite */
115 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Esti Kummer47408632008-07-11 11:53:30 +0800116};
117
Johannes Berg706c4ff2012-03-05 11:24:33 -0800118const struct iwl_cfg iwl5100_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800119 .name = "Intel(R) WiFi Link 5100 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800120 IWL_DEVICE_5000,
Wey-Yi Guydbbf1752010-11-15 13:43:07 -0800121 .valid_tx_ant = ANT_B, /* .cfg overwrite */
122 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700123 .ht_params = &iwl5000_ht_params,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700124};
125
Johannes Berg706c4ff2012-03-05 11:24:33 -0800126const struct iwl_cfg iwl5350_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800127 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800128 .fw_name_pre = IWL5000_FW_PRE,
129 .ucode_api_max = IWL5000_UCODE_API_MAX,
130 .ucode_api_min = IWL5000_UCODE_API_MIN,
Johannes Berg2d771cb2012-04-09 17:47:00 -0700131 .device_family = IWL_DEVICE_FAMILY_5000,
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200132 .max_inst_size = IWLAGN_RTC_INST_SIZE,
133 .max_data_size = IWLAGN_RTC_DATA_SIZE,
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200134 .nvm_ver = EEPROM_5050_EEPROM_VERSION,
135 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700136 .base_params = &iwl5000_base_params,
Johannes Berg26a7ca92012-05-21 11:55:54 +0200137 .eeprom_params = &iwl5000_eeprom_params,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700138 .ht_params = &iwl5000_ht_params,
Wey-Yi Guy564b3442010-11-09 09:21:34 -0800139 .led_mode = IWL_LED_BLINK,
Wey-Yi Guy50619ac2010-12-07 08:06:31 -0800140 .internal_wimax_coex = true,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700141};
142
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800143#define IWL_DEVICE_5150 \
144 .fw_name_pre = IWL5150_FW_PRE, \
145 .ucode_api_max = IWL5150_UCODE_API_MAX, \
146 .ucode_api_min = IWL5150_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700147 .device_family = IWL_DEVICE_FAMILY_5150, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200148 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
149 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Eytan Lifshitzb7998c82012-12-01 20:59:49 +0200150 .nvm_ver = EEPROM_5050_EEPROM_VERSION, \
151 .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800152 .base_params = &iwl5000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200153 .eeprom_params = &iwl5000_eeprom_params, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800154 .led_mode = IWL_LED_BLINK, \
Emmanuel Grumbach540623c2015-02-23 02:40:07 +0200155 .internal_wimax_coex = true, \
156 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800157
Johannes Berg706c4ff2012-03-05 11:24:33 -0800158const struct iwl_cfg iwl5150_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800159 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800160 IWL_DEVICE_5150,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700161 .ht_params = &iwl5000_ht_params,
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800162
Tomas Winkler7100e922008-12-01 16:32:18 -0800163};
164
Johannes Berg706c4ff2012-03-05 11:24:33 -0800165const struct iwl_cfg iwl5150_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800166 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800167 IWL_DEVICE_5150,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700168};
169
Emmanuel Grumbach9d9b21d2016-03-24 08:44:57 +0200170MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
171MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));