reg.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (c) 1998-2007 Texas Instruments Incorporated
  5. * Copyright (C) 2008 Nokia Corporation
  6. *
  7. * Contact: Kalle Valo <kalle.valo@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 HW_ACCESS_ELP_CTRL_REG_ADDR 0x1FFFC
  32. /* ELP register commands */
  33. #define ELPCTRL_WAKE_UP 0x1
  34. #define ELPCTRL_WAKE_UP_WLAN_READY 0x5
  35. #define ELPCTRL_SLEEP 0x0
  36. /* ELP WLAN_READY bit */
  37. #define ELPCTRL_WLAN_READY 0x2
  38. /*
  39. * Interrupt registers.
  40. * 64 bit interrupt sources registers ws ced.
  41. * sme interupts were removed and new ones were added.
  42. * Order was changed.
  43. */
  44. #define FIQ_MASK (REGISTERS_BASE + 0x0400)
  45. #define FIQ_MASK_L (REGISTERS_BASE + 0x0400)
  46. #define FIQ_MASK_H (REGISTERS_BASE + 0x0404)
  47. #define FIQ_MASK_SET (REGISTERS_BASE + 0x0408)
  48. #define FIQ_MASK_SET_L (REGISTERS_BASE + 0x0408)
  49. #define FIQ_MASK_SET_H (REGISTERS_BASE + 0x040C)
  50. #define FIQ_MASK_CLR (REGISTERS_BASE + 0x0410)
  51. #define FIQ_MASK_CLR_L (REGISTERS_BASE + 0x0410)
  52. #define FIQ_MASK_CLR_H (REGISTERS_BASE + 0x0414)
  53. #define IRQ_MASK (REGISTERS_BASE + 0x0418)
  54. #define IRQ_MASK_L (REGISTERS_BASE + 0x0418)
  55. #define IRQ_MASK_H (REGISTERS_BASE + 0x041C)
  56. #define IRQ_MASK_SET (REGISTERS_BASE + 0x0420)
  57. #define IRQ_MASK_SET_L (REGISTERS_BASE + 0x0420)
  58. #define IRQ_MASK_SET_H (REGISTERS_BASE + 0x0424)
  59. #define IRQ_MASK_CLR (REGISTERS_BASE + 0x0428)
  60. #define IRQ_MASK_CLR_L (REGISTERS_BASE + 0x0428)
  61. #define IRQ_MASK_CLR_H (REGISTERS_BASE + 0x042C)
  62. #define ECPU_MASK (REGISTERS_BASE + 0x0448)
  63. #define FIQ_STS_L (REGISTERS_BASE + 0x044C)
  64. #define FIQ_STS_H (REGISTERS_BASE + 0x0450)
  65. #define IRQ_STS_L (REGISTERS_BASE + 0x0454)
  66. #define IRQ_STS_H (REGISTERS_BASE + 0x0458)
  67. #define INT_STS_ND (REGISTERS_BASE + 0x0464)
  68. #define INT_STS_RAW_L (REGISTERS_BASE + 0x0464)
  69. #define INT_STS_RAW_H (REGISTERS_BASE + 0x0468)
  70. #define INT_STS_CLR (REGISTERS_BASE + 0x04B4)
  71. #define INT_STS_CLR_L (REGISTERS_BASE + 0x04B4)
  72. #define INT_STS_CLR_H (REGISTERS_BASE + 0x04B8)
  73. #define INT_ACK (REGISTERS_BASE + 0x046C)
  74. #define INT_ACK_L (REGISTERS_BASE + 0x046C)
  75. #define INT_ACK_H (REGISTERS_BASE + 0x0470)
  76. #define INT_TRIG (REGISTERS_BASE + 0x0474)
  77. #define INT_TRIG_L (REGISTERS_BASE + 0x0474)
  78. #define INT_TRIG_H (REGISTERS_BASE + 0x0478)
  79. #define HOST_STS_L (REGISTERS_BASE + 0x045C)
  80. #define HOST_STS_H (REGISTERS_BASE + 0x0460)
  81. #define HOST_MASK (REGISTERS_BASE + 0x0430)
  82. #define HOST_MASK_L (REGISTERS_BASE + 0x0430)
  83. #define HOST_MASK_H (REGISTERS_BASE + 0x0434)
  84. #define HOST_MASK_SET (REGISTERS_BASE + 0x0438)
  85. #define HOST_MASK_SET_L (REGISTERS_BASE + 0x0438)
  86. #define HOST_MASK_SET_H (REGISTERS_BASE + 0x043C)
  87. #define HOST_MASK_CLR (REGISTERS_BASE + 0x0440)
  88. #define HOST_MASK_CLR_L (REGISTERS_BASE + 0x0440)
  89. #define HOST_MASK_CLR_H (REGISTERS_BASE + 0x0444)
  90. /* Host Interrupts*/
  91. #define HINT_MASK (REGISTERS_BASE + 0x0494)
  92. #define HINT_MASK_SET (REGISTERS_BASE + 0x0498)
  93. #define HINT_MASK_CLR (REGISTERS_BASE + 0x049C)
  94. #define HINT_STS_ND_MASKED (REGISTERS_BASE + 0x04A0)
  95. /*1150 spec calls this HINT_STS_RAW*/
  96. #define HINT_STS_ND (REGISTERS_BASE + 0x04B0)
  97. #define HINT_STS_CLR (REGISTERS_BASE + 0x04A4)
  98. #define HINT_ACK (REGISTERS_BASE + 0x04A8)
  99. #define HINT_TRIG (REGISTERS_BASE + 0x04AC)
  100. /* Device Configuration registers*/
  101. #define SOR_CFG (REGISTERS_BASE + 0x0800)
  102. #define ECPU_CTRL (REGISTERS_BASE + 0x0804)
  103. #define HI_CFG (REGISTERS_BASE + 0x0808)
  104. #define EE_START (REGISTERS_BASE + 0x080C)
  105. #define CHIP_ID_B (REGISTERS_BASE + 0x5674)
  106. #define CHIP_ID_1251_PG10 (0x7010101)
  107. #define CHIP_ID_1251_PG11 (0x7020101)
  108. #define CHIP_ID_1251_PG12 (0x7030101)
  109. #define ENABLE (REGISTERS_BASE + 0x5450)
  110. /* Power Management registers */
  111. #define ELP_CFG_MODE (REGISTERS_BASE + 0x5804)
  112. #define ELP_CMD (REGISTERS_BASE + 0x5808)
  113. #define PLL_CAL_TIME (REGISTERS_BASE + 0x5810)
  114. #define CLK_REQ_TIME (REGISTERS_BASE + 0x5814)
  115. #define CLK_BUF_TIME (REGISTERS_BASE + 0x5818)
  116. #define CFG_PLL_SYNC_CNT (REGISTERS_BASE + 0x5820)
  117. /* Scratch Pad registers*/
  118. #define SCR_PAD0 (REGISTERS_BASE + 0x5608)
  119. #define SCR_PAD1 (REGISTERS_BASE + 0x560C)
  120. #define SCR_PAD2 (REGISTERS_BASE + 0x5610)
  121. #define SCR_PAD3 (REGISTERS_BASE + 0x5614)
  122. #define SCR_PAD4 (REGISTERS_BASE + 0x5618)
  123. #define SCR_PAD4_SET (REGISTERS_BASE + 0x561C)
  124. #define SCR_PAD4_CLR (REGISTERS_BASE + 0x5620)
  125. #define SCR_PAD5 (REGISTERS_BASE + 0x5624)
  126. #define SCR_PAD5_SET (REGISTERS_BASE + 0x5628)
  127. #define SCR_PAD5_CLR (REGISTERS_BASE + 0x562C)
  128. #define SCR_PAD6 (REGISTERS_BASE + 0x5630)
  129. #define SCR_PAD7 (REGISTERS_BASE + 0x5634)
  130. #define SCR_PAD8 (REGISTERS_BASE + 0x5638)
  131. #define SCR_PAD9 (REGISTERS_BASE + 0x563C)
  132. /* Spare registers*/
  133. #define SPARE_A1 (REGISTERS_BASE + 0x0994)
  134. #define SPARE_A2 (REGISTERS_BASE + 0x0998)
  135. #define SPARE_A3 (REGISTERS_BASE + 0x099C)
  136. #define SPARE_A4 (REGISTERS_BASE + 0x09A0)
  137. #define SPARE_A5 (REGISTERS_BASE + 0x09A4)
  138. #define SPARE_A6 (REGISTERS_BASE + 0x09A8)
  139. #define SPARE_A7 (REGISTERS_BASE + 0x09AC)
  140. #define SPARE_A8 (REGISTERS_BASE + 0x09B0)
  141. #define SPARE_B1 (REGISTERS_BASE + 0x5420)
  142. #define SPARE_B2 (REGISTERS_BASE + 0x5424)
  143. #define SPARE_B3 (REGISTERS_BASE + 0x5428)
  144. #define SPARE_B4 (REGISTERS_BASE + 0x542C)
  145. #define SPARE_B5 (REGISTERS_BASE + 0x5430)
  146. #define SPARE_B6 (REGISTERS_BASE + 0x5434)
  147. #define SPARE_B7 (REGISTERS_BASE + 0x5438)
  148. #define SPARE_B8 (REGISTERS_BASE + 0x543C)
  149. enum wl12xx_acx_int_reg {
  150. ACX_REG_INTERRUPT_TRIG,
  151. ACX_REG_INTERRUPT_TRIG_H,
  152. /*=============================================
  153. Host Interrupt Mask Register - 32bit (RW)
  154. ------------------------------------------
  155. Setting a bit in this register masks the
  156. corresponding interrupt to the host.
  157. 0 - RX0 - Rx first dubble buffer Data Interrupt
  158. 1 - TXD - Tx Data Interrupt
  159. 2 - TXXFR - Tx Transfer Interrupt
  160. 3 - RX1 - Rx second dubble buffer Data Interrupt
  161. 4 - RXXFR - Rx Transfer Interrupt
  162. 5 - EVENT_A - Event Mailbox interrupt
  163. 6 - EVENT_B - Event Mailbox interrupt
  164. 7 - WNONHST - Wake On Host Interrupt
  165. 8 - TRACE_A - Debug Trace interrupt
  166. 9 - TRACE_B - Debug Trace interrupt
  167. 10 - CDCMP - Command Complete Interrupt
  168. 11 -
  169. 12 -
  170. 13 -
  171. 14 - ICOMP - Initialization Complete Interrupt
  172. 16 - SG SE - Soft Gemini - Sense enable interrupt
  173. 17 - SG SD - Soft Gemini - Sense disable interrupt
  174. 18 - -
  175. 19 - -
  176. 20 - -
  177. 21- -
  178. Default: 0x0001
  179. *==============================================*/
  180. ACX_REG_INTERRUPT_MASK,
  181. /*=============================================
  182. Host Interrupt Mask Set 16bit, (Write only)
  183. ------------------------------------------
  184. Setting a bit in this register sets
  185. the corresponding bin in ACX_HINT_MASK register
  186. without effecting the mask
  187. state of other bits (0 = no effect).
  188. ==============================================*/
  189. ACX_REG_HINT_MASK_SET,
  190. /*=============================================
  191. Host Interrupt Mask Clear 16bit,(Write only)
  192. ------------------------------------------
  193. Setting a bit in this register clears
  194. the corresponding bin in ACX_HINT_MASK register
  195. without effecting the mask
  196. state of other bits (0 = no effect).
  197. =============================================*/
  198. ACX_REG_HINT_MASK_CLR,
  199. /*=============================================
  200. Host Interrupt Status Nondestructive Read
  201. 16bit,(Read only)
  202. ------------------------------------------
  203. The host can read this register to determine
  204. which interrupts are active.
  205. Reading this register doesn't
  206. effect its content.
  207. =============================================*/
  208. ACX_REG_INTERRUPT_NO_CLEAR,
  209. /*=============================================
  210. Host Interrupt Status Clear on Read Register
  211. 16bit,(Read only)
  212. ------------------------------------------
  213. The host can read this register to determine
  214. which interrupts are active.
  215. Reading this register clears it,
  216. thus making all interrupts inactive.
  217. ==============================================*/
  218. ACX_REG_INTERRUPT_CLEAR,
  219. /*=============================================
  220. Host Interrupt Acknowledge Register
  221. 16bit,(Write only)
  222. ------------------------------------------
  223. The host can set individual bits in this
  224. register to clear (acknowledge) the corresp.
  225. interrupt status bits in the HINT_STS_CLR and
  226. HINT_STS_ND registers, thus making the
  227. assotiated interrupt inactive. (0-no effect)
  228. ==============================================*/
  229. ACX_REG_INTERRUPT_ACK,
  230. /*===============================================
  231. Host Software Reset - 32bit RW
  232. ------------------------------------------
  233. [31:1] Reserved
  234. 0 SOFT_RESET Soft Reset - When this bit is set,
  235. it holds the Wlan hardware in a soft reset state.
  236. This reset disables all MAC and baseband processor
  237. clocks except the CardBus/PCI interface clock.
  238. It also initializes all MAC state machines except
  239. the host interface. It does not reload the
  240. contents of the EEPROM. When this bit is cleared
  241. (not self-clearing), the Wlan hardware
  242. exits the software reset state.
  243. ===============================================*/
  244. ACX_REG_SLV_SOFT_RESET,
  245. /*===============================================
  246. EEPROM Burst Read Start - 32bit RW
  247. ------------------------------------------
  248. [31:1] Reserved
  249. 0 ACX_EE_START - EEPROM Burst Read Start 0
  250. Setting this bit starts a burst read from
  251. the external EEPROM.
  252. If this bit is set (after reset) before an EEPROM read/write,
  253. the burst read starts at EEPROM address 0.
  254. Otherwise, it starts at the address
  255. following the address of the previous access.
  256. TheWlan hardware hardware clears this bit automatically.
  257. Default: 0x00000000
  258. *================================================*/
  259. ACX_REG_EE_START,
  260. /* Embedded ARM CPU Control */
  261. /*===============================================
  262. Halt eCPU - 32bit RW
  263. ------------------------------------------
  264. 0 HALT_ECPU Halt Embedded CPU - This bit is the
  265. compliment of bit 1 (MDATA2) in the SOR_CFG register.
  266. During a hardware reset, this bit holds
  267. the inverse of MDATA2.
  268. When downloading firmware from the host,
  269. set this bit (pull down MDATA2).
  270. The host clears this bit after downloading the firmware into
  271. zero-wait-state SSRAM.
  272. When loading firmware from Flash, clear this bit (pull up MDATA2)
  273. so that the eCPU can run the bootloader code in Flash
  274. HALT_ECPU eCPU State
  275. --------------------
  276. 1 halt eCPU
  277. 0 enable eCPU
  278. ===============================================*/
  279. ACX_REG_ECPU_CONTROL,
  280. ACX_REG_TABLE_LEN
  281. };
  282. #define ACX_SLV_SOFT_RESET_BIT BIT(1)
  283. #define ACX_REG_EEPROM_START_BIT BIT(1)
  284. /* Command/Information Mailbox Pointers */
  285. /*===============================================
  286. Command Mailbox Pointer - 32bit RW
  287. ------------------------------------------
  288. This register holds the start address of
  289. the command mailbox located in the Wlan hardware memory.
  290. The host must read this pointer after a reset to
  291. find the location of the command mailbox.
  292. The Wlan hardware initializes the command mailbox
  293. pointer with the default address of the command mailbox.
  294. The command mailbox pointer is not valid until after
  295. the host receives the Init Complete interrupt from
  296. the Wlan hardware.
  297. ===============================================*/
  298. #define REG_COMMAND_MAILBOX_PTR (SCR_PAD0)
  299. /*===============================================
  300. Information Mailbox Pointer - 32bit RW
  301. ------------------------------------------
  302. This register holds the start address of
  303. the information mailbox located in the Wlan hardware memory.
  304. The host must read this pointer after a reset to find
  305. the location of the information mailbox.
  306. The Wlan hardware initializes the information mailbox pointer
  307. with the default address of the information mailbox.
  308. The information mailbox pointer is not valid
  309. until after the host receives the Init Complete interrupt from
  310. the Wlan hardware.
  311. ===============================================*/
  312. #define REG_EVENT_MAILBOX_PTR (SCR_PAD1)
  313. /* Misc */
  314. #define REG_ENABLE_TX_RX (ENABLE)
  315. /*
  316. * Rx configuration (filter) information element
  317. * ---------------------------------------------
  318. */
  319. #define REG_RX_CONFIG (RX_CFG)
  320. #define REG_RX_FILTER (RX_FILTER_CFG)
  321. #define RX_CFG_ENABLE_PHY_HEADER_PLCP 0x0002
  322. /* promiscuous - receives all valid frames */
  323. #define RX_CFG_PROMISCUOUS 0x0008
  324. /* receives frames from any BSSID */
  325. #define RX_CFG_BSSID 0x0020
  326. /* receives frames destined to any MAC address */
  327. #define RX_CFG_MAC 0x0010
  328. #define RX_CFG_ENABLE_ONLY_MY_DEST_MAC 0x0010
  329. #define RX_CFG_ENABLE_ANY_DEST_MAC 0x0000
  330. #define RX_CFG_ENABLE_ONLY_MY_BSSID 0x0020
  331. #define RX_CFG_ENABLE_ANY_BSSID 0x0000
  332. /* discards all broadcast frames */
  333. #define RX_CFG_DISABLE_BCAST 0x0200
  334. #define RX_CFG_ENABLE_ONLY_MY_SSID 0x0400
  335. #define RX_CFG_ENABLE_RX_CMPLT_FCS_ERROR 0x0800
  336. #define RX_CFG_COPY_RX_STATUS 0x2000
  337. #define RX_CFG_TSF 0x10000
  338. #define RX_CONFIG_OPTION_ANY_DST_MY_BSS (RX_CFG_ENABLE_ANY_DEST_MAC | \
  339. RX_CFG_ENABLE_ONLY_MY_BSSID)
  340. #define RX_CONFIG_OPTION_MY_DST_ANY_BSS (RX_CFG_ENABLE_ONLY_MY_DEST_MAC\
  341. | RX_CFG_ENABLE_ANY_BSSID)
  342. #define RX_CONFIG_OPTION_ANY_DST_ANY_BSS (RX_CFG_ENABLE_ANY_DEST_MAC | \
  343. RX_CFG_ENABLE_ANY_BSSID)
  344. #define RX_CONFIG_OPTION_MY_DST_MY_BSS (RX_CFG_ENABLE_ONLY_MY_DEST_MAC\
  345. | RX_CFG_ENABLE_ONLY_MY_BSSID)
  346. #define RX_CONFIG_OPTION_FOR_SCAN (RX_CFG_ENABLE_PHY_HEADER_PLCP \
  347. | RX_CFG_ENABLE_RX_CMPLT_FCS_ERROR \
  348. | RX_CFG_COPY_RX_STATUS | RX_CFG_TSF)
  349. #define RX_CONFIG_OPTION_FOR_MEASUREMENT (RX_CFG_ENABLE_ANY_DEST_MAC)
  350. #define RX_CONFIG_OPTION_FOR_JOIN (RX_CFG_ENABLE_ONLY_MY_BSSID | \
  351. RX_CFG_ENABLE_ONLY_MY_DEST_MAC)
  352. #define RX_CONFIG_OPTION_FOR_IBSS_JOIN (RX_CFG_ENABLE_ONLY_MY_SSID | \
  353. RX_CFG_ENABLE_ONLY_MY_DEST_MAC)
  354. #define RX_FILTER_OPTION_DEF (CFG_RX_MGMT_EN | CFG_RX_DATA_EN\
  355. | CFG_RX_CTL_EN | CFG_RX_BCN_EN\
  356. | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)
  357. #define RX_FILTER_OPTION_FILTER_ALL 0
  358. #define RX_FILTER_OPTION_DEF_PRSP_BCN (CFG_RX_PRSP_EN | CFG_RX_MGMT_EN\
  359. | CFG_RX_RCTS_ACK | CFG_RX_BCN_EN)
  360. #define RX_FILTER_OPTION_JOIN (CFG_RX_MGMT_EN | CFG_RX_DATA_EN\
  361. | CFG_RX_BCN_EN | CFG_RX_AUTH_EN\
  362. | CFG_RX_ASSOC_EN | CFG_RX_RCTS_ACK\
  363. | CFG_RX_PRSP_EN)
  364. /*===============================================
  365. Phy regs
  366. ===============================================*/
  367. #define ACX_PHY_ADDR_REG SBB_ADDR
  368. #define ACX_PHY_DATA_REG SBB_DATA
  369. #define ACX_PHY_CTRL_REG SBB_CTL
  370. #define ACX_PHY_REG_WR_MASK 0x00000001ul
  371. #define ACX_PHY_REG_RD_MASK 0x00000002ul
  372. /*===============================================
  373. EEPROM Read/Write Request 32bit RW
  374. ------------------------------------------
  375. 1 EE_READ - EEPROM Read Request 1 - Setting this bit
  376. loads a single byte of data into the EE_DATA
  377. register from the EEPROM location specified in
  378. the EE_ADDR register.
  379. The Wlan hardware hardware clears this bit automatically.
  380. EE_DATA is valid when this bit is cleared.
  381. 0 EE_WRITE - EEPROM Write Request - Setting this bit
  382. writes a single byte of data from the EE_DATA register into the
  383. EEPROM location specified in the EE_ADDR register.
  384. The Wlan hardware hardware clears this bit automatically.
  385. *===============================================*/
  386. #define ACX_EE_CTL_REG EE_CTL
  387. #define EE_WRITE 0x00000001ul
  388. #define EE_READ 0x00000002ul
  389. /*===============================================
  390. EEPROM Address - 32bit RW
  391. ------------------------------------------
  392. This register specifies the address
  393. within the EEPROM from/to which to read/write data.
  394. ===============================================*/
  395. #define ACX_EE_ADDR_REG EE_ADDR
  396. /*===============================================
  397. EEPROM Data - 32bit RW
  398. ------------------------------------------
  399. This register either holds the read 8 bits of
  400. data from the EEPROM or the write data
  401. to be written to the EEPROM.
  402. ===============================================*/
  403. #define ACX_EE_DATA_REG EE_DATA
  404. /*===============================================
  405. EEPROM Base Address - 32bit RW
  406. ------------------------------------------
  407. This register holds the upper nine bits
  408. [23:15] of the 24-bit Wlan hardware memory
  409. address for burst reads from EEPROM accesses.
  410. The EEPROM provides the lower 15 bits of this address.
  411. The MSB of the address from the EEPROM is ignored.
  412. ===============================================*/
  413. #define ACX_EE_CFG EE_CFG
  414. /*===============================================
  415. GPIO Output Values -32bit, RW
  416. ------------------------------------------
  417. [31:16] Reserved
  418. [15: 0] Specify the output values (at the output driver inputs) for
  419. GPIO[15:0], respectively.
  420. ===============================================*/
  421. #define ACX_GPIO_OUT_REG GPIO_OUT
  422. #define ACX_MAX_GPIO_LINES 15
  423. /*===============================================
  424. Contention window -32bit, RW
  425. ------------------------------------------
  426. [31:26] Reserved
  427. [25:16] Max (0x3ff)
  428. [15:07] Reserved
  429. [06:00] Current contention window value - default is 0x1F
  430. ===============================================*/
  431. #define ACX_CONT_WIND_CFG_REG CONT_WIND_CFG
  432. #define ACX_CONT_WIND_MIN_MASK 0x0000007f
  433. #define ACX_CONT_WIND_MAX 0x03ff0000
  434. /*
  435. * Indirect slave register/memory registers
  436. * ----------------------------------------
  437. */
  438. #define HW_SLAVE_REG_ADDR_REG 0x00000004
  439. #define HW_SLAVE_REG_DATA_REG 0x00000008
  440. #define HW_SLAVE_REG_CTRL_REG 0x0000000c
  441. #define SLAVE_AUTO_INC 0x00010000
  442. #define SLAVE_NO_AUTO_INC 0x00000000
  443. #define SLAVE_HOST_LITTLE_ENDIAN 0x00000000
  444. #define HW_SLAVE_MEM_ADDR_REG SLV_MEM_ADDR
  445. #define HW_SLAVE_MEM_DATA_REG SLV_MEM_DATA
  446. #define HW_SLAVE_MEM_CTRL_REG SLV_MEM_CTL
  447. #define HW_SLAVE_MEM_ENDIAN_REG SLV_END_CTL
  448. #define HW_FUNC_EVENT_INT_EN 0x8000
  449. #define HW_FUNC_EVENT_MASK_REG 0x00000034
  450. #define ACX_MAC_TIMESTAMP_REG (MAC_TIMESTAMP)
  451. /*===============================================
  452. HI_CFG Interface Configuration Register Values
  453. ------------------------------------------
  454. ===============================================*/
  455. #define HI_CFG_UART_ENABLE 0x00000004
  456. #define HI_CFG_RST232_ENABLE 0x00000008
  457. #define HI_CFG_CLOCK_REQ_SELECT 0x00000010
  458. #define HI_CFG_HOST_INT_ENABLE 0x00000020
  459. #define HI_CFG_VLYNQ_OUTPUT_ENABLE 0x00000040
  460. #define HI_CFG_HOST_INT_ACTIVE_LOW 0x00000080
  461. #define HI_CFG_UART_TX_OUT_GPIO_15 0x00000100
  462. #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200
  463. #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400
  464. /*
  465. * NOTE: USE_ACTIVE_HIGH compilation flag should be defined in makefile
  466. * for platforms using active high interrupt level
  467. */
  468. #ifdef USE_ACTIVE_HIGH
  469. #define HI_CFG_DEF_VAL \
  470. (HI_CFG_UART_ENABLE | \
  471. HI_CFG_RST232_ENABLE | \
  472. HI_CFG_CLOCK_REQ_SELECT | \
  473. HI_CFG_HOST_INT_ENABLE)
  474. #else
  475. #define HI_CFG_DEF_VAL \
  476. (HI_CFG_UART_ENABLE | \
  477. HI_CFG_RST232_ENABLE | \
  478. HI_CFG_CLOCK_REQ_SELECT | \
  479. HI_CFG_HOST_INT_ENABLE)
  480. #endif
  481. #define REF_FREQ_19_2 0
  482. #define REF_FREQ_26_0 1
  483. #define REF_FREQ_38_4 2
  484. #define REF_FREQ_40_0 3
  485. #define REF_FREQ_33_6 4
  486. #define REF_FREQ_NUM 5
  487. #define LUT_PARAM_INTEGER_DIVIDER 0
  488. #define LUT_PARAM_FRACTIONAL_DIVIDER 1
  489. #define LUT_PARAM_ATTN_BB 2
  490. #define LUT_PARAM_ALPHA_BB 3
  491. #define LUT_PARAM_STOP_TIME_BB 4
  492. #define LUT_PARAM_BB_PLL_LOOP_FILTER 5
  493. #define LUT_PARAM_NUM 6
  494. #define ACX_EEPROMLESS_IND_REG (SCR_PAD4)
  495. #define USE_EEPROM 0
  496. #define SOFT_RESET_MAX_TIME 1000000
  497. #define SOFT_RESET_STALL_TIME 1000
  498. #define NVS_DATA_BUNDARY_ALIGNMENT 4
  499. /* Firmware image load chunk size */
  500. #define CHUNK_SIZE 512
  501. /* Firmware image header size */
  502. #define FW_HDR_SIZE 8
  503. #define ECPU_CONTROL_HALT 0x00000101
  504. /******************************************************************************
  505. CHANNELS, BAND & REG DOMAINS definitions
  506. ******************************************************************************/
  507. enum {
  508. RADIO_BAND_2_4GHZ = 0, /* 2.4 Ghz band */
  509. RADIO_BAND_5GHZ = 1, /* 5 Ghz band */
  510. RADIO_BAND_JAPAN_4_9_GHZ = 2,
  511. DEFAULT_BAND = RADIO_BAND_2_4GHZ,
  512. INVALID_BAND = 0xFE,
  513. MAX_RADIO_BANDS = 0xFF
  514. };
  515. enum {
  516. NO_RATE = 0,
  517. RATE_1MBPS = 0x0A,
  518. RATE_2MBPS = 0x14,
  519. RATE_5_5MBPS = 0x37,
  520. RATE_6MBPS = 0x0B,
  521. RATE_9MBPS = 0x0F,
  522. RATE_11MBPS = 0x6E,
  523. RATE_12MBPS = 0x0A,
  524. RATE_18MBPS = 0x0E,
  525. RATE_22MBPS = 0xDC,
  526. RATE_24MBPS = 0x09,
  527. RATE_36MBPS = 0x0D,
  528. RATE_48MBPS = 0x08,
  529. RATE_54MBPS = 0x0C
  530. };
  531. enum {
  532. RATE_INDEX_1MBPS = 0,
  533. RATE_INDEX_2MBPS = 1,
  534. RATE_INDEX_5_5MBPS = 2,
  535. RATE_INDEX_6MBPS = 3,
  536. RATE_INDEX_9MBPS = 4,
  537. RATE_INDEX_11MBPS = 5,
  538. RATE_INDEX_12MBPS = 6,
  539. RATE_INDEX_18MBPS = 7,
  540. RATE_INDEX_22MBPS = 8,
  541. RATE_INDEX_24MBPS = 9,
  542. RATE_INDEX_36MBPS = 10,
  543. RATE_INDEX_48MBPS = 11,
  544. RATE_INDEX_54MBPS = 12,
  545. RATE_INDEX_MAX = RATE_INDEX_54MBPS,
  546. MAX_RATE_INDEX,
  547. INVALID_RATE_INDEX = MAX_RATE_INDEX,
  548. RATE_INDEX_ENUM_MAX_SIZE = 0x7FFFFFFF
  549. };
  550. enum {
  551. RATE_MASK_1MBPS = 0x1,
  552. RATE_MASK_2MBPS = 0x2,
  553. RATE_MASK_5_5MBPS = 0x4,
  554. RATE_MASK_11MBPS = 0x20,
  555. };
  556. #define SHORT_PREAMBLE_BIT BIT(0) /* CCK or Barker depending on the rate */
  557. #define OFDM_RATE_BIT BIT(6)
  558. #define PBCC_RATE_BIT BIT(7)
  559. enum {
  560. CCK_LONG = 0,
  561. CCK_SHORT = SHORT_PREAMBLE_BIT,
  562. PBCC_LONG = PBCC_RATE_BIT,
  563. PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
  564. OFDM = OFDM_RATE_BIT
  565. };
  566. /******************************************************************************
  567. Transmit-Descriptor RATE-SET field definitions...
  568. Define a new "Rate-Set" for TX path that incorporates the
  569. Rate & Modulation info into a single 16-bit field.
  570. TxdRateSet_t:
  571. b15 - Indicates Preamble type (1=SHORT, 0=LONG).
  572. Notes:
  573. Must be LONG (0) for 1Mbps rate.
  574. Does not apply (set to 0) for RevG-OFDM rates.
  575. b14 - Indicates PBCC encoding (1=PBCC, 0=not).
  576. Notes:
  577. Does not apply (set to 0) for rates 1 and 2 Mbps.
  578. Does not apply (set to 0) for RevG-OFDM rates.
  579. b13 - Unused (set to 0).
  580. b12-b0 - Supported Rate indicator bits as defined below.
  581. ******************************************************************************/
  582. #define TNETW1251_CHIP_ID_PG1_0 0x07010101
  583. #define TNETW1251_CHIP_ID_PG1_1 0x07020101
  584. #define TNETW1251_CHIP_ID_PG1_2 0x07030101
  585. /*************************************************************************
  586. Interrupt Trigger Register (Host -> WiLink)
  587. **************************************************************************/
  588. /* Hardware to Embedded CPU Interrupts - first 32-bit register set */
  589. /*
  590. * Host Command Interrupt. Setting this bit masks
  591. * the interrupt that the host issues to inform
  592. * the FW that it has sent a command
  593. * to the Wlan hardware Command Mailbox.
  594. */
  595. #define INTR_TRIG_CMD BIT(0)
  596. /*
  597. * Host Event Acknowlegde Interrupt. The host
  598. * sets this bit to acknowledge that it received
  599. * the unsolicited information from the event
  600. * mailbox.
  601. */
  602. #define INTR_TRIG_EVENT_ACK BIT(1)
  603. /*
  604. * The host sets this bit to inform the Wlan
  605. * FW that a TX packet is in the XFER
  606. * Buffer #0.
  607. */
  608. #define INTR_TRIG_TX_PROC0 BIT(2)
  609. /*
  610. * The host sets this bit to inform the FW
  611. * that it read a packet from RX XFER
  612. * Buffer #0.
  613. */
  614. #define INTR_TRIG_RX_PROC0 BIT(3)
  615. #define INTR_TRIG_DEBUG_ACK BIT(4)
  616. #define INTR_TRIG_STATE_CHANGED BIT(5)
  617. /* Hardware to Embedded CPU Interrupts - second 32-bit register set */
  618. /*
  619. * The host sets this bit to inform the FW
  620. * that it read a packet from RX XFER
  621. * Buffer #1.
  622. */
  623. #define INTR_TRIG_RX_PROC1 BIT(17)
  624. /*
  625. * The host sets this bit to inform the Wlan
  626. * hardware that a TX packet is in the XFER
  627. * Buffer #1.
  628. */
  629. #define INTR_TRIG_TX_PROC1 BIT(18)
  630. #endif