wl1271_reg.h 26 KB

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