reg.h 19 KB

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