reg.h 26 KB

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