aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945-hw.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-hw.h213
1 files changed, 3 insertions, 210 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
index 571815d7e8bf..ad612a8719f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. 8 * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved.
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 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 11 * it under the terms of version 2 of the GNU General Public License as
@@ -30,7 +30,7 @@
30 * 30 *
31 * BSD LICENSE 31 * BSD LICENSE
32 * 32 *
33 * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. 33 * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved.
34 * All rights reserved. 34 * All rights reserved.
35 * 35 *
36 * Redistribution and use in source and binary forms, with or without 36 * Redistribution and use in source and binary forms, with or without
@@ -198,43 +198,27 @@ struct iwl3945_eeprom_temperature_corr {
198 */ 198 */
199struct iwl3945_eeprom { 199struct iwl3945_eeprom {
200 u8 reserved0[16]; 200 u8 reserved0[16];
201#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
202 u16 device_id; /* abs.ofs: 16 */ 201 u16 device_id; /* abs.ofs: 16 */
203 u8 reserved1[2]; 202 u8 reserved1[2];
204#define EEPROM_PMC (2*0x0A) /* 2 bytes */
205 u16 pmc; /* abs.ofs: 20 */ 203 u16 pmc; /* abs.ofs: 20 */
206 u8 reserved2[20]; 204 u8 reserved2[20];
207#define EEPROM_MAC_ADDRESS (2*0x15) /* 6 bytes */
208 u8 mac_address[6]; /* abs.ofs: 42 */ 205 u8 mac_address[6]; /* abs.ofs: 42 */
209 u8 reserved3[58]; 206 u8 reserved3[58];
210#define EEPROM_BOARD_REVISION (2*0x35) /* 2 bytes */
211 u16 board_revision; /* abs.ofs: 106 */ 207 u16 board_revision; /* abs.ofs: 106 */
212 u8 reserved4[11]; 208 u8 reserved4[11];
213#define EEPROM_BOARD_PBA_NUMBER (2*0x3B+1) /* 9 bytes */
214 u8 board_pba_number[9]; /* abs.ofs: 119 */ 209 u8 board_pba_number[9]; /* abs.ofs: 119 */
215 u8 reserved5[8]; 210 u8 reserved5[8];
216#define EEPROM_VERSION (2*0x44) /* 2 bytes */
217 u16 version; /* abs.ofs: 136 */ 211 u16 version; /* abs.ofs: 136 */
218#define EEPROM_SKU_CAP (2*0x45) /* 1 bytes */
219 u8 sku_cap; /* abs.ofs: 138 */ 212 u8 sku_cap; /* abs.ofs: 138 */
220#define EEPROM_LEDS_MODE (2*0x45+1) /* 1 bytes */
221 u8 leds_mode; /* abs.ofs: 139 */ 213 u8 leds_mode; /* abs.ofs: 139 */
222#define EEPROM_OEM_MODE (2*0x46) /* 2 bytes */
223 u16 oem_mode; 214 u16 oem_mode;
224#define EEPROM_WOWLAN_MODE (2*0x47) /* 2 bytes */
225 u16 wowlan_mode; /* abs.ofs: 142 */ 215 u16 wowlan_mode; /* abs.ofs: 142 */
226#define EEPROM_LEDS_TIME_INTERVAL (2*0x48) /* 2 bytes */
227 u16 leds_time_interval; /* abs.ofs: 144 */ 216 u16 leds_time_interval; /* abs.ofs: 144 */
228#define EEPROM_LEDS_OFF_TIME (2*0x49) /* 1 bytes */
229 u8 leds_off_time; /* abs.ofs: 146 */ 217 u8 leds_off_time; /* abs.ofs: 146 */
230#define EEPROM_LEDS_ON_TIME (2*0x49+1) /* 1 bytes */
231 u8 leds_on_time; /* abs.ofs: 147 */ 218 u8 leds_on_time; /* abs.ofs: 147 */
232#define EEPROM_ALMGOR_M_VERSION (2*0x4A) /* 1 bytes */
233 u8 almgor_m_version; /* abs.ofs: 148 */ 219 u8 almgor_m_version; /* abs.ofs: 148 */
234#define EEPROM_ANTENNA_SWITCH_TYPE (2*0x4A+1) /* 1 bytes */
235 u8 antenna_switch_type; /* abs.ofs: 149 */ 220 u8 antenna_switch_type; /* abs.ofs: 149 */
236 u8 reserved6[42]; 221 u8 reserved6[42];
237#define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */
238 u8 sku_id[4]; /* abs.ofs: 192 */ 222 u8 sku_id[4]; /* abs.ofs: 192 */
239 223
240/* 224/*
@@ -249,9 +233,7 @@ struct iwl3945_eeprom {
249 * 233 *
250 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 234 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
251 */ 235 */
252#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
253 u16 band_1_count; /* abs.ofs: 196 */ 236 u16 band_1_count; /* abs.ofs: 196 */
254#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
255 struct iwl3945_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */ 237 struct iwl3945_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
256 238
257/* 239/*
@@ -259,36 +241,28 @@ struct iwl3945_eeprom {
259 * 5.0 GHz channels 7, 8, 11, 12, 16 241 * 5.0 GHz channels 7, 8, 11, 12, 16
260 * (4915-5080MHz) (none of these is ever supported) 242 * (4915-5080MHz) (none of these is ever supported)
261 */ 243 */
262#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
263 u16 band_2_count; /* abs.ofs: 226 */ 244 u16 band_2_count; /* abs.ofs: 226 */
264#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
265 struct iwl3945_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */ 245 struct iwl3945_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
266 246
267/* 247/*
268 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 248 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
269 * (5170-5320MHz) 249 * (5170-5320MHz)
270 */ 250 */
271#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
272 u16 band_3_count; /* abs.ofs: 254 */ 251 u16 band_3_count; /* abs.ofs: 254 */
273#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
274 struct iwl3945_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */ 252 struct iwl3945_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
275 253
276/* 254/*
277 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 255 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
278 * (5500-5700MHz) 256 * (5500-5700MHz)
279 */ 257 */
280#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
281 u16 band_4_count; /* abs.ofs: 280 */ 258 u16 band_4_count; /* abs.ofs: 280 */
282#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
283 struct iwl3945_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */ 259 struct iwl3945_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
284 260
285/* 261/*
286 * 5.7 GHz channels 145, 149, 153, 157, 161, 165 262 * 5.7 GHz channels 145, 149, 153, 157, 161, 165
287 * (5725-5825MHz) 263 * (5725-5825MHz)
288 */ 264 */
289#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
290 u16 band_5_count; /* abs.ofs: 304 */ 265 u16 band_5_count; /* abs.ofs: 304 */
291#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
292 struct iwl3945_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */ 266 struct iwl3945_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
293 267
294 u8 reserved9[194]; 268 u8 reserved9[194];
@@ -296,15 +270,9 @@ struct iwl3945_eeprom {
296/* 270/*
297 * 3945 Txpower calibration data. 271 * 3945 Txpower calibration data.
298 */ 272 */
299#define EEPROM_TXPOWER_CALIB_GROUP0 0x200
300#define EEPROM_TXPOWER_CALIB_GROUP1 0x240
301#define EEPROM_TXPOWER_CALIB_GROUP2 0x280
302#define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0
303#define EEPROM_TXPOWER_CALIB_GROUP4 0x300
304#define IWL_NUM_TX_CALIB_GROUPS 5 273#define IWL_NUM_TX_CALIB_GROUPS 5
305 struct iwl3945_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS]; 274 struct iwl3945_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS];
306/* abs.ofs: 512 */ 275/* abs.ofs: 512 */
307#define EEPROM_CALIB_TEMPERATURE_CORRECT 0x340
308 struct iwl3945_eeprom_temperature_corr corrections; /* abs.ofs: 832 */ 276 struct iwl3945_eeprom_temperature_corr corrections; /* abs.ofs: 832 */
309 u8 reserved16[172]; /* fill out to full 1024 byte block */ 277 u8 reserved16[172]; /* fill out to full 1024 byte block */
310} __attribute__ ((packed)); 278} __attribute__ ((packed));
@@ -321,181 +289,6 @@ struct iwl3945_eeprom {
321#define PCI_REG_WUM8 0x0E8 289#define PCI_REG_WUM8 0x0E8
322#define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) 290#define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000)
323 291
324/*=== CSR (control and status registers) ===*/
325#define CSR_BASE (0x000)
326
327#define CSR_SW_VER (CSR_BASE+0x000)
328#define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */
329#define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */
330#define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */
331#define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */
332#define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/
333#define CSR_GPIO_IN (CSR_BASE+0x018) /* read external chip pins */
334#define CSR_RESET (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
335#define CSR_GP_CNTRL (CSR_BASE+0x024)
336
337/*
338 * Hardware revision info
339 * Bit fields:
340 * 31-8: Reserved
341 * 7-4: Type of device: 0x0 = 4965, 0xd = 3945
342 * 3-2: Revision step: 0 = A, 1 = B, 2 = C, 3 = D
343 * 1-0: "Dash" value, as in A-1, etc.
344 */
345#define CSR_HW_REV (CSR_BASE+0x028)
346
347/* EEPROM reads */
348#define CSR_EEPROM_REG (CSR_BASE+0x02c)
349#define CSR_EEPROM_GP (CSR_BASE+0x030)
350#define CSR_GP_UCODE (CSR_BASE+0x044)
351#define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054)
352#define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058)
353#define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c)
354#define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060)
355#define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
356
357/* Analog phase-lock-loop configuration (3945 only)
358 * Set bit 24. */
359#define CSR_ANA_PLL_CFG (CSR_BASE+0x20c)
360
361/* Bits for CSR_HW_IF_CONFIG_REG */
362#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100)
363#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200)
364#define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400)
365#define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800)
366#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)
367#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000)
368#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
369
370/* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
371 * acknowledged (reset) by host writing "1" to flagged bits. */
372#define CSR_INT_BIT_FH_RX (1 << 31) /* Rx DMA, cmd responses, FH_INT[17:16] */
373#define CSR_INT_BIT_HW_ERR (1 << 29) /* DMA hardware error FH_INT[31] */
374#define CSR_INT_BIT_DNLD (1 << 28) /* uCode Download */
375#define CSR_INT_BIT_FH_TX (1 << 27) /* Tx DMA FH_INT[1:0] */
376#define CSR_INT_BIT_SCD (1 << 26) /* TXQ pointer advanced */
377#define CSR_INT_BIT_SW_ERR (1 << 25) /* uCode error */
378#define CSR_INT_BIT_RF_KILL (1 << 7) /* HW RFKILL switch GP_CNTRL[27] toggled */
379#define CSR_INT_BIT_CT_KILL (1 << 6) /* Critical temp (chip too hot) rfkill */
380#define CSR_INT_BIT_SW_RX (1 << 3) /* Rx, command responses, 3945 */
381#define CSR_INT_BIT_WAKEUP (1 << 1) /* NIC controller waking up (pwr mgmt) */
382#define CSR_INT_BIT_ALIVE (1 << 0) /* uCode interrupts once it initializes */
383
384#define CSR_INI_SET_MASK (CSR_INT_BIT_FH_RX | \
385 CSR_INT_BIT_HW_ERR | \
386 CSR_INT_BIT_FH_TX | \
387 CSR_INT_BIT_SW_ERR | \
388 CSR_INT_BIT_RF_KILL | \
389 CSR_INT_BIT_SW_RX | \
390 CSR_INT_BIT_WAKEUP | \
391 CSR_INT_BIT_ALIVE)
392
393/* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
394#define CSR_FH_INT_BIT_ERR (1 << 31) /* Error */
395#define CSR_FH_INT_BIT_HI_PRIOR (1 << 30) /* High priority Rx, bypass coalescing */
396#define CSR_FH_INT_BIT_RX_CHNL2 (1 << 18) /* Rx channel 2 (3945 only) */
397#define CSR_FH_INT_BIT_RX_CHNL1 (1 << 17) /* Rx channel 1 */
398#define CSR_FH_INT_BIT_RX_CHNL0 (1 << 16) /* Rx channel 0 */
399#define CSR_FH_INT_BIT_TX_CHNL6 (1 << 6) /* Tx channel 6 (3945 only) */
400#define CSR_FH_INT_BIT_TX_CHNL1 (1 << 1) /* Tx channel 1 */
401#define CSR_FH_INT_BIT_TX_CHNL0 (1 << 0) /* Tx channel 0 */
402
403#define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \
404 CSR_FH_INT_BIT_RX_CHNL2 | \
405 CSR_FH_INT_BIT_RX_CHNL1 | \
406 CSR_FH_INT_BIT_RX_CHNL0)
407
408#define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL6 | \
409 CSR_FH_INT_BIT_TX_CHNL1 | \
410 CSR_FH_INT_BIT_TX_CHNL0)
411
412
413/* RESET */
414#define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001)
415#define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002)
416#define CSR_RESET_REG_FLAG_SW_RESET (0x00000080)
417#define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100)
418#define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200)
419
420/* GP (general purpose) CONTROL */
421#define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001)
422#define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004)
423#define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008)
424#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
425
426#define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001)
427
428#define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000)
429#define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000)
430#define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000)
431
432
433/* EEPROM REG */
434#define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001)
435#define CSR_EEPROM_REG_BIT_CMD (0x00000002)
436
437/* EEPROM GP */
438#define CSR_EEPROM_GP_VALID_MSK (0x00000006)
439#define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000)
440#define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180)
441
442/* UCODE DRV GP */
443#define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001)
444#define CSR_UCODE_SW_BIT_RFKILL (0x00000002)
445#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004)
446#define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008)
447
448/* GPIO */
449#define CSR_GPIO_IN_BIT_AUX_POWER (0x00000200)
450#define CSR_GPIO_IN_VAL_VAUX_PWR_SRC (0x00000000)
451#define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC CSR_GPIO_IN_BIT_AUX_POWER
452
453/* GI Chicken Bits */
454#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000)
455#define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000)
456
457/* CSR_ANA_PLL_CFG */
458#define CSR_ANA_PLL_CFG_SH (0x00880300)
459
460/*=== HBUS (Host-side Bus) ===*/
461#define HBUS_BASE (0x400)
462
463/*
464 * Registers for accessing device's internal SRAM memory (e.g. SCD SRAM
465 * structures, error log, event log, verifying uCode load).
466 * First write to address register, then read from or write to data register
467 * to complete the job. Once the address register is set up, accesses to
468 * data registers auto-increment the address by one dword.
469 * Bit usage for address registers (read or write):
470 * 0-31: memory address within device
471 */
472#define HBUS_TARG_MEM_RADDR (HBUS_BASE+0x00c)
473#define HBUS_TARG_MEM_WADDR (HBUS_BASE+0x010)
474#define HBUS_TARG_MEM_WDAT (HBUS_BASE+0x018)
475#define HBUS_TARG_MEM_RDAT (HBUS_BASE+0x01c)
476
477/*
478 * Registers for accessing device's internal peripheral registers
479 * (e.g. SCD, BSM, etc.). First write to address register,
480 * then read from or write to data register to complete the job.
481 * Bit usage for address registers (read or write):
482 * 0-15: register address (offset) within device
483 * 24-25: (# bytes - 1) to read or write (e.g. 3 for dword)
484 */
485#define HBUS_TARG_PRPH_WADDR (HBUS_BASE+0x044)
486#define HBUS_TARG_PRPH_RADDR (HBUS_BASE+0x048)
487#define HBUS_TARG_PRPH_WDAT (HBUS_BASE+0x04c)
488#define HBUS_TARG_PRPH_RDAT (HBUS_BASE+0x050)
489
490/*
491 * Per-Tx-queue write pointer (index, really!) (3945 and 4965).
492 * Indicates index to next TFD that driver will fill (1 past latest filled).
493 * Bit usage:
494 * 0-7: queue write index
495 * 11-8: queue selector
496 */
497#define HBUS_TARG_WRPTR (HBUS_BASE+0x060)
498
499/* SCD (3945 Tx Frame Scheduler) */ 292/* SCD (3945 Tx Frame Scheduler) */
500#define SCD_BASE (CSR_BASE + 0x2E00) 293#define SCD_BASE (CSR_BASE + 0x2E00)
501 294
@@ -663,7 +456,7 @@ struct iwl3945_eeprom {
663/* Size of uCode instruction memory in bootstrap state machine */ 456/* Size of uCode instruction memory in bootstrap state machine */
664#define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE 457#define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
665 458
666#define IWL_MAX_NUM_QUEUES 8 459#define IWL39_MAX_NUM_QUEUES 8
667 460
668static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr) 461static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr)
669{ 462{