reg.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2009 Nokia Corporation
  6. *
  7. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #ifndef __REG_H__
  25. #define __REG_H__
  26. #include <linux/bitops.h>
  27. #define REGISTERS_BASE 0x00300000
  28. #define DRPW_BASE 0x00310000
  29. #define REGISTERS_DOWN_SIZE 0x00008800
  30. #define REGISTERS_WORK_SIZE 0x0000b000
  31. #define FW_STATUS_ADDR (0x14FC0 + 0xA000)
  32. /*===============================================
  33. Host Software Reset - 32bit RW
  34. ------------------------------------------
  35. [31:1] Reserved
  36. 0 SOFT_RESET Soft Reset - When this bit is set,
  37. it holds the Wlan hardware in a soft reset state.
  38. This reset disables all MAC and baseband processor
  39. clocks except the CardBus/PCI interface clock.
  40. It also initializes all MAC state machines except
  41. the host interface. It does not reload the
  42. contents of the EEPROM. When this bit is cleared
  43. (not self-clearing), the Wlan hardware
  44. exits the software reset state.
  45. ===============================================*/
  46. #define WL12XX_SLV_SOFT_RESET (REGISTERS_BASE + 0x0000)
  47. #define WL1271_SLV_REG_DATA (REGISTERS_BASE + 0x0008)
  48. #define WL1271_SLV_REG_ADATA (REGISTERS_BASE + 0x000c)
  49. #define WL1271_SLV_MEM_DATA (REGISTERS_BASE + 0x0018)
  50. #define WL12XX_REG_INTERRUPT_TRIG (REGISTERS_BASE + 0x0474)
  51. #define WL12XX_REG_INTERRUPT_TRIG_H (REGISTERS_BASE + 0x0478)
  52. /*=============================================
  53. Host Interrupt Mask Register - 32bit (RW)
  54. ------------------------------------------
  55. Setting a bit in this register masks the
  56. corresponding interrupt to the host.
  57. 0 - RX0 - Rx first dubble buffer Data Interrupt
  58. 1 - TXD - Tx Data Interrupt
  59. 2 - TXXFR - Tx Transfer Interrupt
  60. 3 - RX1 - Rx second dubble buffer Data Interrupt
  61. 4 - RXXFR - Rx Transfer Interrupt
  62. 5 - EVENT_A - Event Mailbox interrupt
  63. 6 - EVENT_B - Event Mailbox interrupt
  64. 7 - WNONHST - Wake On Host Interrupt
  65. 8 - TRACE_A - Debug Trace interrupt
  66. 9 - TRACE_B - Debug Trace interrupt
  67. 10 - CDCMP - Command Complete Interrupt
  68. 11 -
  69. 12 -
  70. 13 -
  71. 14 - ICOMP - Initialization Complete Interrupt
  72. 16 - SG SE - Soft Gemini - Sense enable interrupt
  73. 17 - SG SD - Soft Gemini - Sense disable interrupt
  74. 18 - -
  75. 19 - -
  76. 20 - -
  77. 21- -
  78. Default: 0x0001
  79. *==============================================*/
  80. #define WL12XX_REG_INTERRUPT_MASK (REGISTERS_BASE + 0x04DC)
  81. /*=============================================
  82. Host Interrupt Mask Set 16bit, (Write only)
  83. ------------------------------------------
  84. Setting a bit in this register sets
  85. the corresponding bin in ACX_HINT_MASK register
  86. without effecting the mask
  87. state of other bits (0 = no effect).
  88. ==============================================*/
  89. #define ACX_REG_HINT_MASK_SET (REGISTERS_BASE + 0x04E0)
  90. /*=============================================
  91. Host Interrupt Mask Clear 16bit,(Write only)
  92. ------------------------------------------
  93. Setting a bit in this register clears
  94. the corresponding bin in ACX_HINT_MASK register
  95. without effecting the mask
  96. state of other bits (0 = no effect).
  97. =============================================*/
  98. #define ACX_REG_HINT_MASK_CLR (REGISTERS_BASE + 0x04E4)
  99. /*=============================================
  100. Host Interrupt Status Nondestructive Read
  101. 16bit,(Read only)
  102. ------------------------------------------
  103. The host can read this register to determine
  104. which interrupts are active.
  105. Reading this register doesn't
  106. effect its content.
  107. =============================================*/
  108. #define WL12XX_REG_INTERRUPT_NO_CLEAR (REGISTERS_BASE + 0x04E8)
  109. /*=============================================
  110. Host Interrupt Status Clear on Read Register
  111. 16bit,(Read only)
  112. ------------------------------------------
  113. The host can read this register to determine
  114. which interrupts are active.
  115. Reading this register clears it,
  116. thus making all interrupts inactive.
  117. ==============================================*/
  118. #define ACX_REG_INTERRUPT_CLEAR (REGISTERS_BASE + 0x04F8)
  119. /*=============================================
  120. Host Interrupt Acknowledge Register
  121. 16bit,(Write only)
  122. ------------------------------------------
  123. The host can set individual bits in this
  124. register to clear (acknowledge) the corresp.
  125. interrupt status bits in the HINT_STS_CLR and
  126. HINT_STS_ND registers, thus making the
  127. assotiated interrupt inactive. (0-no effect)
  128. ==============================================*/
  129. #define WL12XX_REG_INTERRUPT_ACK (REGISTERS_BASE + 0x04F0)
  130. #define WL12XX_REG_RX_DRIVER_COUNTER (REGISTERS_BASE + 0x0538)
  131. /* Device Configuration registers*/
  132. #define SOR_CFG (REGISTERS_BASE + 0x0800)
  133. /* Embedded ARM CPU Control */
  134. /*===============================================
  135. Halt eCPU - 32bit RW
  136. ------------------------------------------
  137. 0 HALT_ECPU Halt Embedded CPU - This bit is the
  138. compliment of bit 1 (MDATA2) in the SOR_CFG register.
  139. During a hardware reset, this bit holds
  140. the inverse of MDATA2.
  141. When downloading firmware from the host,
  142. set this bit (pull down MDATA2).
  143. The host clears this bit after downloading the firmware into
  144. zero-wait-state SSRAM.
  145. When loading firmware from Flash, clear this bit (pull up MDATA2)
  146. so that the eCPU can run the bootloader code in Flash
  147. HALT_ECPU eCPU State
  148. --------------------
  149. 1 halt eCPU
  150. 0 enable eCPU
  151. ===============================================*/
  152. #define WL12XX_REG_ECPU_CONTROL (REGISTERS_BASE + 0x0804)
  153. #define WL12XX_HI_CFG (REGISTERS_BASE + 0x0808)
  154. /*===============================================
  155. EEPROM Burst Read Start - 32bit RW
  156. ------------------------------------------
  157. [31:1] Reserved
  158. 0 ACX_EE_START - EEPROM Burst Read Start 0
  159. Setting this bit starts a burst read from
  160. the external EEPROM.
  161. If this bit is set (after reset) before an EEPROM read/write,
  162. the burst read starts at EEPROM address 0.
  163. Otherwise, it starts at the address
  164. following the address of the previous access.
  165. TheWlan hardware hardware clears this bit automatically.
  166. Default: 0x00000000
  167. *================================================*/
  168. #define ACX_REG_EE_START (REGISTERS_BASE + 0x080C)
  169. #define WL12XX_OCP_POR_CTR (REGISTERS_BASE + 0x09B4)
  170. #define WL12XX_OCP_DATA_WRITE (REGISTERS_BASE + 0x09B8)
  171. #define WL12XX_OCP_DATA_READ (REGISTERS_BASE + 0x09BC)
  172. #define WL12XX_OCP_CMD (REGISTERS_BASE + 0x09C0)
  173. #define WL12XX_HOST_WR_ACCESS (REGISTERS_BASE + 0x09F8)
  174. #define WL12XX_CHIP_ID_B (REGISTERS_BASE + 0x5674)
  175. #define WL12XX_ENABLE (REGISTERS_BASE + 0x5450)
  176. /* Power Management registers */
  177. #define WL12XX_ELP_CFG_MODE (REGISTERS_BASE + 0x5804)
  178. #define WL12XX_ELP_CMD (REGISTERS_BASE + 0x5808)
  179. #define WL12XX_PLL_CAL_TIME (REGISTERS_BASE + 0x5810)
  180. #define WL12XX_CLK_REQ_TIME (REGISTERS_BASE + 0x5814)
  181. #define WL12XX_CLK_BUF_TIME (REGISTERS_BASE + 0x5818)
  182. #define WL12XX_CFG_PLL_SYNC_CNT (REGISTERS_BASE + 0x5820)
  183. /* Scratch Pad registers*/
  184. #define WL12XX_SCR_PAD0 (REGISTERS_BASE + 0x5608)
  185. #define WL12XX_SCR_PAD1 (REGISTERS_BASE + 0x560C)
  186. #define WL12XX_SCR_PAD2 (REGISTERS_BASE + 0x5610)
  187. #define WL12XX_SCR_PAD3 (REGISTERS_BASE + 0x5614)
  188. #define WL12XX_SCR_PAD4 (REGISTERS_BASE + 0x5618)
  189. #define WL12XX_SCR_PAD4_SET (REGISTERS_BASE + 0x561C)
  190. #define WL12XX_SCR_PAD4_CLR (REGISTERS_BASE + 0x5620)
  191. #define WL12XX_SCR_PAD5 (REGISTERS_BASE + 0x5624)
  192. #define WL12XX_SCR_PAD5_SET (REGISTERS_BASE + 0x5628)
  193. #define WL12XX_SCR_PAD5_CLR (REGISTERS_BASE + 0x562C)
  194. #define WL12XX_SCR_PAD6 (REGISTERS_BASE + 0x5630)
  195. #define WL12XX_SCR_PAD7 (REGISTERS_BASE + 0x5634)
  196. #define WL12XX_SCR_PAD8 (REGISTERS_BASE + 0x5638)
  197. #define WL12XX_SCR_PAD9 (REGISTERS_BASE + 0x563C)
  198. /* Spare registers*/
  199. #define WL12XX_SPARE_A1 (REGISTERS_BASE + 0x0994)
  200. #define WL12XX_SPARE_A2 (REGISTERS_BASE + 0x0998)
  201. #define WL12XX_SPARE_A3 (REGISTERS_BASE + 0x099C)
  202. #define WL12XX_SPARE_A4 (REGISTERS_BASE + 0x09A0)
  203. #define WL12XX_SPARE_A5 (REGISTERS_BASE + 0x09A4)
  204. #define WL12XX_SPARE_A6 (REGISTERS_BASE + 0x09A8)
  205. #define WL12XX_SPARE_A7 (REGISTERS_BASE + 0x09AC)
  206. #define WL12XX_SPARE_A8 (REGISTERS_BASE + 0x09B0)
  207. #define WL12XX_SPARE_B1 (REGISTERS_BASE + 0x5420)
  208. #define WL12XX_SPARE_B2 (REGISTERS_BASE + 0x5424)
  209. #define WL12XX_SPARE_B3 (REGISTERS_BASE + 0x5428)
  210. #define WL12XX_SPARE_B4 (REGISTERS_BASE + 0x542C)
  211. #define WL12XX_SPARE_B5 (REGISTERS_BASE + 0x5430)
  212. #define WL12XX_SPARE_B6 (REGISTERS_BASE + 0x5434)
  213. #define WL12XX_SPARE_B7 (REGISTERS_BASE + 0x5438)
  214. #define WL12XX_SPARE_B8 (REGISTERS_BASE + 0x543C)
  215. #define WL12XX_PLL_PARAMETERS (REGISTERS_BASE + 0x6040)
  216. #define WL12XX_WU_COUNTER_PAUSE (REGISTERS_BASE + 0x6008)
  217. #define WL12XX_WELP_ARM_COMMAND (REGISTERS_BASE + 0x6100)
  218. #define WL12XX_DRPW_SCRATCH_START (DRPW_BASE + 0x002C)
  219. #define WL12XX_CMD_MBOX_ADDRESS 0x407B4
  220. #define ACX_REG_EEPROM_START_BIT BIT(1)
  221. /* Command/Information Mailbox Pointers */
  222. /*===============================================
  223. Command Mailbox Pointer - 32bit RW
  224. ------------------------------------------
  225. This register holds the start address of
  226. the command mailbox located in the Wlan hardware memory.
  227. The host must read this pointer after a reset to
  228. find the location of the command mailbox.
  229. The Wlan hardware initializes the command mailbox
  230. pointer with the default address of the command mailbox.
  231. The command mailbox pointer is not valid until after
  232. the host receives the Init Complete interrupt from
  233. the Wlan hardware.
  234. ===============================================*/
  235. #define WL12XX_REG_COMMAND_MAILBOX_PTR (WL12XX_SCR_PAD0)
  236. /*===============================================
  237. Information Mailbox Pointer - 32bit RW
  238. ------------------------------------------
  239. This register holds the start address of
  240. the information mailbox located in the Wlan hardware memory.
  241. The host must read this pointer after a reset to find
  242. the location of the information mailbox.
  243. The Wlan hardware initializes the information mailbox pointer
  244. with the default address of the information mailbox.
  245. The information mailbox pointer is not valid
  246. until after the host receives the Init Complete interrupt from
  247. the Wlan hardware.
  248. ===============================================*/
  249. #define WL12XX_REG_EVENT_MAILBOX_PTR (WL12XX_SCR_PAD1)
  250. /*===============================================
  251. EEPROM Read/Write Request 32bit RW
  252. ------------------------------------------
  253. 1 EE_READ - EEPROM Read Request 1 - Setting this bit
  254. loads a single byte of data into the EE_DATA
  255. register from the EEPROM location specified in
  256. the EE_ADDR register.
  257. The Wlan hardware hardware clears this bit automatically.
  258. EE_DATA is valid when this bit is cleared.
  259. 0 EE_WRITE - EEPROM Write Request - Setting this bit
  260. writes a single byte of data from the EE_DATA register into the
  261. EEPROM location specified in the EE_ADDR register.
  262. The Wlan hardware hardware clears this bit automatically.
  263. *===============================================*/
  264. #define ACX_EE_CTL_REG EE_CTL
  265. #define EE_WRITE 0x00000001ul
  266. #define EE_READ 0x00000002ul
  267. /*===============================================
  268. EEPROM Address - 32bit RW
  269. ------------------------------------------
  270. This register specifies the address
  271. within the EEPROM from/to which to read/write data.
  272. ===============================================*/
  273. #define ACX_EE_ADDR_REG EE_ADDR
  274. /*===============================================
  275. EEPROM Data - 32bit RW
  276. ------------------------------------------
  277. This register either holds the read 8 bits of
  278. data from the EEPROM or the write data
  279. to be written to the EEPROM.
  280. ===============================================*/
  281. #define ACX_EE_DATA_REG EE_DATA
  282. /*===============================================
  283. EEPROM Base Address - 32bit RW
  284. ------------------------------------------
  285. This register holds the upper nine bits
  286. [23:15] of the 24-bit Wlan hardware memory
  287. address for burst reads from EEPROM accesses.
  288. The EEPROM provides the lower 15 bits of this address.
  289. The MSB of the address from the EEPROM is ignored.
  290. ===============================================*/
  291. #define ACX_EE_CFG EE_CFG
  292. /*===============================================
  293. GPIO Output Values -32bit, RW
  294. ------------------------------------------
  295. [31:16] Reserved
  296. [15: 0] Specify the output values (at the output driver inputs) for
  297. GPIO[15:0], respectively.
  298. ===============================================*/
  299. #define ACX_GPIO_OUT_REG GPIO_OUT
  300. #define ACX_MAX_GPIO_LINES 15
  301. /*===============================================
  302. Contention window -32bit, RW
  303. ------------------------------------------
  304. [31:26] Reserved
  305. [25:16] Max (0x3ff)
  306. [15:07] Reserved
  307. [06:00] Current contention window value - default is 0x1F
  308. ===============================================*/
  309. #define ACX_CONT_WIND_CFG_REG CONT_WIND_CFG
  310. #define ACX_CONT_WIND_MIN_MASK 0x0000007f
  311. #define ACX_CONT_WIND_MAX 0x03ff0000
  312. #define REF_FREQ_19_2 0
  313. #define REF_FREQ_26_0 1
  314. #define REF_FREQ_38_4 2
  315. #define REF_FREQ_40_0 3
  316. #define REF_FREQ_33_6 4
  317. #define REF_FREQ_NUM 5
  318. #define LUT_PARAM_INTEGER_DIVIDER 0
  319. #define LUT_PARAM_FRACTIONAL_DIVIDER 1
  320. #define LUT_PARAM_ATTN_BB 2
  321. #define LUT_PARAM_ALPHA_BB 3
  322. #define LUT_PARAM_STOP_TIME_BB 4
  323. #define LUT_PARAM_BB_PLL_LOOP_FILTER 5
  324. #define LUT_PARAM_NUM 6
  325. #define WL12XX_EEPROMLESS_IND (WL12XX_SCR_PAD4)
  326. #define USE_EEPROM 0
  327. #define NVS_DATA_BUNDARY_ALIGNMENT 4
  328. /* Firmware image header size */
  329. #define FW_HDR_SIZE 8
  330. /******************************************************************************
  331. CHANNELS, BAND & REG DOMAINS definitions
  332. ******************************************************************************/
  333. #define SHORT_PREAMBLE_BIT BIT(0) /* CCK or Barker depending on the rate */
  334. #define OFDM_RATE_BIT BIT(6)
  335. #define PBCC_RATE_BIT BIT(7)
  336. enum {
  337. CCK_LONG = 0,
  338. CCK_SHORT = SHORT_PREAMBLE_BIT,
  339. PBCC_LONG = PBCC_RATE_BIT,
  340. PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
  341. OFDM = OFDM_RATE_BIT
  342. };
  343. /******************************************************************************
  344. Transmit-Descriptor RATE-SET field definitions...
  345. Define a new "Rate-Set" for TX path that incorporates the
  346. Rate & Modulation info into a single 16-bit field.
  347. TxdRateSet_t:
  348. b15 - Indicates Preamble type (1=SHORT, 0=LONG).
  349. Notes:
  350. Must be LONG (0) for 1Mbps rate.
  351. Does not apply (set to 0) for RevG-OFDM rates.
  352. b14 - Indicates PBCC encoding (1=PBCC, 0=not).
  353. Notes:
  354. Does not apply (set to 0) for rates 1 and 2 Mbps.
  355. Does not apply (set to 0) for RevG-OFDM rates.
  356. b13 - Unused (set to 0).
  357. b12-b0 - Supported Rate indicator bits as defined below.
  358. ******************************************************************************/
  359. #define OCP_CMD_LOOP 32
  360. #define OCP_CMD_WRITE 0x1
  361. #define OCP_CMD_READ 0x2
  362. #define OCP_READY_MASK BIT(18)
  363. #define OCP_STATUS_MASK (BIT(16) | BIT(17))
  364. #define OCP_STATUS_NO_RESP 0x00000
  365. #define OCP_STATUS_OK 0x10000
  366. #define OCP_STATUS_REQ_FAILED 0x20000
  367. #define OCP_STATUS_RESP_ERROR 0x30000
  368. #define OCP_REG_POLARITY 0x0064
  369. #define OCP_REG_CLK_TYPE 0x0448
  370. #define OCP_REG_CLK_POLARITY 0x0cb2
  371. #define OCP_REG_CLK_PULL 0x0cb4
  372. #define POLARITY_LOW BIT(1)
  373. #define NO_PULL (BIT(14) | BIT(15))
  374. #define FREF_CLK_TYPE_BITS 0xfffffe7f
  375. #define CLK_REQ_PRCM 0x100
  376. #define FREF_CLK_POLARITY_BITS 0xfffff8ff
  377. #define CLK_REQ_OUTN_SEL 0x700
  378. #define WU_COUNTER_PAUSE_VAL 0x3FF
  379. /* PLL configuration algorithm for wl128x */
  380. #define SYS_CLK_CFG_REG 0x2200
  381. /* Bit[0] - 0-TCXO, 1-FREF */
  382. #define MCS_PLL_CLK_SEL_FREF BIT(0)
  383. /* Bit[3:2] - 01-TCXO, 10-FREF */
  384. #define WL_CLK_REQ_TYPE_FREF BIT(3)
  385. #define WL_CLK_REQ_TYPE_PG2 (BIT(3) | BIT(2))
  386. /* Bit[4] - 0-TCXO, 1-FREF */
  387. #define PRCM_CM_EN_MUX_WLAN_FREF BIT(4)
  388. #define TCXO_ILOAD_INT_REG 0x2264
  389. #define TCXO_CLK_DETECT_REG 0x2266
  390. #define TCXO_DET_FAILED BIT(4)
  391. #define FREF_ILOAD_INT_REG 0x2084
  392. #define FREF_CLK_DETECT_REG 0x2086
  393. #define FREF_CLK_DETECT_FAIL BIT(4)
  394. /* Use this reg for masking during driver access */
  395. #define WL_SPARE_REG 0x2320
  396. #define WL_SPARE_VAL BIT(2)
  397. /* Bit[6:5:3] - mask wl write SYS_CLK_CFG[8:5:2:4] */
  398. #define WL_SPARE_MASK_8526 (BIT(6) | BIT(5) | BIT(3))
  399. #define PLL_LOCK_COUNTERS_REG 0xD8C
  400. #define PLL_LOCK_COUNTERS_COEX 0x0F
  401. #define PLL_LOCK_COUNTERS_MCS 0xF0
  402. #define MCS_PLL_OVERRIDE_REG 0xD90
  403. #define MCS_PLL_CONFIG_REG 0xD92
  404. #define MCS_SEL_IN_FREQ_MASK 0x0070
  405. #define MCS_SEL_IN_FREQ_SHIFT 4
  406. #define MCS_PLL_CONFIG_REG_VAL 0x73
  407. #define MCS_PLL_ENABLE_HP (BIT(0) | BIT(1))
  408. #define MCS_PLL_M_REG 0xD94
  409. #define MCS_PLL_N_REG 0xD96
  410. #define MCS_PLL_M_REG_VAL 0xC8
  411. #define MCS_PLL_N_REG_VAL 0x07
  412. #define SDIO_IO_DS 0xd14
  413. /* SDIO/wSPI DS configuration values */
  414. enum {
  415. HCI_IO_DS_8MA = 0,
  416. HCI_IO_DS_4MA = 1, /* default */
  417. HCI_IO_DS_6MA = 2,
  418. HCI_IO_DS_2MA = 3,
  419. };
  420. /* end PLL configuration algorithm for wl128x */
  421. /*
  422. * Host Command Interrupt. Setting this bit masks
  423. * the interrupt that the host issues to inform
  424. * the FW that it has sent a command
  425. * to the Wlan hardware Command Mailbox.
  426. */
  427. #define WL12XX_INTR_TRIG_CMD BIT(0)
  428. /*
  429. * Host Event Acknowlegde Interrupt. The host
  430. * sets this bit to acknowledge that it received
  431. * the unsolicited information from the event
  432. * mailbox.
  433. */
  434. #define WL12XX_INTR_TRIG_EVENT_ACK BIT(1)
  435. /*===============================================
  436. HI_CFG Interface Configuration Register Values
  437. ------------------------------------------
  438. ===============================================*/
  439. #define HI_CFG_UART_ENABLE 0x00000004
  440. #define HI_CFG_RST232_ENABLE 0x00000008
  441. #define HI_CFG_CLOCK_REQ_SELECT 0x00000010
  442. #define HI_CFG_HOST_INT_ENABLE 0x00000020
  443. #define HI_CFG_VLYNQ_OUTPUT_ENABLE 0x00000040
  444. #define HI_CFG_HOST_INT_ACTIVE_LOW 0x00000080
  445. #define HI_CFG_UART_TX_OUT_GPIO_15 0x00000100
  446. #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200
  447. #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400
  448. #define HI_CFG_DEF_VAL \
  449. (HI_CFG_UART_ENABLE | \
  450. HI_CFG_RST232_ENABLE | \
  451. HI_CFG_CLOCK_REQ_SELECT | \
  452. HI_CFG_HOST_INT_ENABLE)
  453. #define WL127X_REG_FUSE_DATA_2_1 0x050a
  454. #define WL128X_REG_FUSE_DATA_2_1 0x2152
  455. #define PG_VER_MASK 0x3c
  456. #define PG_VER_OFFSET 2
  457. #define WL127X_PG_MAJOR_VER_MASK 0x3
  458. #define WL127X_PG_MAJOR_VER_OFFSET 0x0
  459. #define WL127X_PG_MINOR_VER_MASK 0xc
  460. #define WL127X_PG_MINOR_VER_OFFSET 0x2
  461. #define WL128X_PG_MAJOR_VER_MASK 0xc
  462. #define WL128X_PG_MAJOR_VER_OFFSET 0x2
  463. #define WL128X_PG_MINOR_VER_MASK 0x3
  464. #define WL128X_PG_MINOR_VER_OFFSET 0x0
  465. #define WL127X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL127X_PG_MAJOR_VER_MASK) >> \
  466. WL127X_PG_MAJOR_VER_OFFSET)
  467. #define WL127X_PG_GET_MINOR(pg_ver) ((pg_ver & WL127X_PG_MINOR_VER_MASK) >> \
  468. WL127X_PG_MINOR_VER_OFFSET)
  469. #define WL128X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL128X_PG_MAJOR_VER_MASK) >> \
  470. WL128X_PG_MAJOR_VER_OFFSET)
  471. #define WL128X_PG_GET_MINOR(pg_ver) ((pg_ver & WL128X_PG_MINOR_VER_MASK) >> \
  472. WL128X_PG_MINOR_VER_OFFSET)
  473. #define WL12XX_REG_FUSE_BD_ADDR_1 0x00310eb4
  474. #define WL12XX_REG_FUSE_BD_ADDR_2 0x00310eb8
  475. #endif