reg.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. * This file is part of wl12xx
  3. *
  4. * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2009 Nokia Corporation
  6. *
  7. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #ifndef __REG_H__
  25. #define __REG_H__
  26. #include <linux/bitops.h>
  27. #define REGISTERS_BASE 0x00300000
  28. #define DRPW_BASE 0x00310000
  29. #define REGISTERS_DOWN_SIZE 0x00008800
  30. #define REGISTERS_WORK_SIZE 0x0000b000
  31. #define 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. #define ACX_REG_INTERRUPT_TRIG (REGISTERS_BASE + 0x0474)
  58. #define ACX_REG_INTERRUPT_TRIG_H (REGISTERS_BASE + 0x0478)
  59. /*=============================================
  60. Host Interrupt Mask Register - 32bit (RW)
  61. ------------------------------------------
  62. Setting a bit in this register masks the
  63. corresponding interrupt to the host.
  64. 0 - RX0 - Rx first dubble buffer Data Interrupt
  65. 1 - TXD - Tx Data Interrupt
  66. 2 - TXXFR - Tx Transfer Interrupt
  67. 3 - RX1 - Rx second dubble buffer Data Interrupt
  68. 4 - RXXFR - Rx Transfer Interrupt
  69. 5 - EVENT_A - Event Mailbox interrupt
  70. 6 - EVENT_B - Event Mailbox interrupt
  71. 7 - WNONHST - Wake On Host Interrupt
  72. 8 - TRACE_A - Debug Trace interrupt
  73. 9 - TRACE_B - Debug Trace interrupt
  74. 10 - CDCMP - Command Complete Interrupt
  75. 11 -
  76. 12 -
  77. 13 -
  78. 14 - ICOMP - Initialization Complete Interrupt
  79. 16 - SG SE - Soft Gemini - Sense enable interrupt
  80. 17 - SG SD - Soft Gemini - Sense disable interrupt
  81. 18 - -
  82. 19 - -
  83. 20 - -
  84. 21- -
  85. Default: 0x0001
  86. *==============================================*/
  87. #define ACX_REG_INTERRUPT_MASK (REGISTERS_BASE + 0x04DC)
  88. /*=============================================
  89. Host Interrupt Mask Set 16bit, (Write only)
  90. ------------------------------------------
  91. Setting a bit in this register sets
  92. the corresponding bin in ACX_HINT_MASK register
  93. without effecting the mask
  94. state of other bits (0 = no effect).
  95. ==============================================*/
  96. #define ACX_REG_HINT_MASK_SET (REGISTERS_BASE + 0x04E0)
  97. /*=============================================
  98. Host Interrupt Mask Clear 16bit,(Write only)
  99. ------------------------------------------
  100. Setting a bit in this register clears
  101. the corresponding bin in ACX_HINT_MASK register
  102. without effecting the mask
  103. state of other bits (0 = no effect).
  104. =============================================*/
  105. #define ACX_REG_HINT_MASK_CLR (REGISTERS_BASE + 0x04E4)
  106. /*=============================================
  107. Host Interrupt Status Nondestructive Read
  108. 16bit,(Read only)
  109. ------------------------------------------
  110. The host can read this register to determine
  111. which interrupts are active.
  112. Reading this register doesn't
  113. effect its content.
  114. =============================================*/
  115. #define ACX_REG_INTERRUPT_NO_CLEAR (REGISTERS_BASE + 0x04E8)
  116. /*=============================================
  117. Host Interrupt Status Clear on Read Register
  118. 16bit,(Read only)
  119. ------------------------------------------
  120. The host can read this register to determine
  121. which interrupts are active.
  122. Reading this register clears it,
  123. thus making all interrupts inactive.
  124. ==============================================*/
  125. #define ACX_REG_INTERRUPT_CLEAR (REGISTERS_BASE + 0x04F8)
  126. /*=============================================
  127. Host Interrupt Acknowledge Register
  128. 16bit,(Write only)
  129. ------------------------------------------
  130. The host can set individual bits in this
  131. register to clear (acknowledge) the corresp.
  132. interrupt status bits in the HINT_STS_CLR and
  133. HINT_STS_ND registers, thus making the
  134. assotiated interrupt inactive. (0-no effect)
  135. ==============================================*/
  136. #define ACX_REG_INTERRUPT_ACK (REGISTERS_BASE + 0x04F0)
  137. #define RX_DRIVER_COUNTER_ADDRESS (REGISTERS_BASE + 0x0538)
  138. /* Device Configuration registers*/
  139. #define SOR_CFG (REGISTERS_BASE + 0x0800)
  140. /* Embedded ARM CPU Control */
  141. /*===============================================
  142. Halt eCPU - 32bit RW
  143. ------------------------------------------
  144. 0 HALT_ECPU Halt Embedded CPU - This bit is the
  145. compliment of bit 1 (MDATA2) in the SOR_CFG register.
  146. During a hardware reset, this bit holds
  147. the inverse of MDATA2.
  148. When downloading firmware from the host,
  149. set this bit (pull down MDATA2).
  150. The host clears this bit after downloading the firmware into
  151. zero-wait-state SSRAM.
  152. When loading firmware from Flash, clear this bit (pull up MDATA2)
  153. so that the eCPU can run the bootloader code in Flash
  154. HALT_ECPU eCPU State
  155. --------------------
  156. 1 halt eCPU
  157. 0 enable eCPU
  158. ===============================================*/
  159. #define ACX_REG_ECPU_CONTROL (REGISTERS_BASE + 0x0804)
  160. #define HI_CFG (REGISTERS_BASE + 0x0808)
  161. /*===============================================
  162. EEPROM Burst Read Start - 32bit RW
  163. ------------------------------------------
  164. [31:1] Reserved
  165. 0 ACX_EE_START - EEPROM Burst Read Start 0
  166. Setting this bit starts a burst read from
  167. the external EEPROM.
  168. If this bit is set (after reset) before an EEPROM read/write,
  169. the burst read starts at EEPROM address 0.
  170. Otherwise, it starts at the address
  171. following the address of the previous access.
  172. TheWlan hardware hardware clears this bit automatically.
  173. Default: 0x00000000
  174. *================================================*/
  175. #define ACX_REG_EE_START (REGISTERS_BASE + 0x080C)
  176. #define OCP_POR_CTR (REGISTERS_BASE + 0x09B4)
  177. #define OCP_DATA_WRITE (REGISTERS_BASE + 0x09B8)
  178. #define OCP_DATA_READ (REGISTERS_BASE + 0x09BC)
  179. #define OCP_CMD (REGISTERS_BASE + 0x09C0)
  180. #define WL1271_HOST_WR_ACCESS (REGISTERS_BASE + 0x09F8)
  181. #define CHIP_ID_B (REGISTERS_BASE + 0x5674)
  182. #define CHIP_ID_1271_PG10 (0x4030101)
  183. #define CHIP_ID_1271_PG20 (0x4030111)
  184. #define CHIP_ID_1283_PG10 (0x05030101)
  185. #define CHIP_ID_1283_PG20 (0x05030111)
  186. #define ENABLE (REGISTERS_BASE + 0x5450)
  187. /* Power Management registers */
  188. #define ELP_CFG_MODE (REGISTERS_BASE + 0x5804)
  189. #define ELP_CMD (REGISTERS_BASE + 0x5808)
  190. #define PLL_CAL_TIME (REGISTERS_BASE + 0x5810)
  191. #define CLK_REQ_TIME (REGISTERS_BASE + 0x5814)
  192. #define CLK_BUF_TIME (REGISTERS_BASE + 0x5818)
  193. #define CFG_PLL_SYNC_CNT (REGISTERS_BASE + 0x5820)
  194. /* Scratch Pad registers*/
  195. #define SCR_PAD0 (REGISTERS_BASE + 0x5608)
  196. #define SCR_PAD1 (REGISTERS_BASE + 0x560C)
  197. #define SCR_PAD2 (REGISTERS_BASE + 0x5610)
  198. #define SCR_PAD3 (REGISTERS_BASE + 0x5614)
  199. #define SCR_PAD4 (REGISTERS_BASE + 0x5618)
  200. #define SCR_PAD4_SET (REGISTERS_BASE + 0x561C)
  201. #define SCR_PAD4_CLR (REGISTERS_BASE + 0x5620)
  202. #define SCR_PAD5 (REGISTERS_BASE + 0x5624)
  203. #define SCR_PAD5_SET (REGISTERS_BASE + 0x5628)
  204. #define SCR_PAD5_CLR (REGISTERS_BASE + 0x562C)
  205. #define SCR_PAD6 (REGISTERS_BASE + 0x5630)
  206. #define SCR_PAD7 (REGISTERS_BASE + 0x5634)
  207. #define SCR_PAD8 (REGISTERS_BASE + 0x5638)
  208. #define SCR_PAD9 (REGISTERS_BASE + 0x563C)
  209. /* Spare registers*/
  210. #define SPARE_A1 (REGISTERS_BASE + 0x0994)
  211. #define SPARE_A2 (REGISTERS_BASE + 0x0998)
  212. #define SPARE_A3 (REGISTERS_BASE + 0x099C)
  213. #define SPARE_A4 (REGISTERS_BASE + 0x09A0)
  214. #define SPARE_A5 (REGISTERS_BASE + 0x09A4)
  215. #define SPARE_A6 (REGISTERS_BASE + 0x09A8)
  216. #define SPARE_A7 (REGISTERS_BASE + 0x09AC)
  217. #define SPARE_A8 (REGISTERS_BASE + 0x09B0)
  218. #define SPARE_B1 (REGISTERS_BASE + 0x5420)
  219. #define SPARE_B2 (REGISTERS_BASE + 0x5424)
  220. #define SPARE_B3 (REGISTERS_BASE + 0x5428)
  221. #define SPARE_B4 (REGISTERS_BASE + 0x542C)
  222. #define SPARE_B5 (REGISTERS_BASE + 0x5430)
  223. #define SPARE_B6 (REGISTERS_BASE + 0x5434)
  224. #define SPARE_B7 (REGISTERS_BASE + 0x5438)
  225. #define SPARE_B8 (REGISTERS_BASE + 0x543C)
  226. #define PLL_PARAMETERS (REGISTERS_BASE + 0x6040)
  227. #define WU_COUNTER_PAUSE (REGISTERS_BASE + 0x6008)
  228. #define WELP_ARM_COMMAND (REGISTERS_BASE + 0x6100)
  229. #define DRPW_SCRATCH_START (DRPW_BASE + 0x002C)
  230. #define ACX_SLV_SOFT_RESET_BIT BIT(1)
  231. #define ACX_REG_EEPROM_START_BIT BIT(1)
  232. /* Command/Information Mailbox Pointers */
  233. /*===============================================
  234. Command Mailbox Pointer - 32bit RW
  235. ------------------------------------------
  236. This register holds the start address of
  237. the command mailbox located in the Wlan hardware memory.
  238. The host must read this pointer after a reset to
  239. find the location of the command mailbox.
  240. The Wlan hardware initializes the command mailbox
  241. pointer with the default address of the command mailbox.
  242. The command mailbox pointer is not valid until after
  243. the host receives the Init Complete interrupt from
  244. the Wlan hardware.
  245. ===============================================*/
  246. #define REG_COMMAND_MAILBOX_PTR (SCR_PAD0)
  247. /*===============================================
  248. Information Mailbox Pointer - 32bit RW
  249. ------------------------------------------
  250. This register holds the start address of
  251. the information mailbox located in the Wlan hardware memory.
  252. The host must read this pointer after a reset to find
  253. the location of the information mailbox.
  254. The Wlan hardware initializes the information mailbox pointer
  255. with the default address of the information mailbox.
  256. The information mailbox pointer is not valid
  257. until after the host receives the Init Complete interrupt from
  258. the Wlan hardware.
  259. ===============================================*/
  260. #define REG_EVENT_MAILBOX_PTR (SCR_PAD1)
  261. /*===============================================
  262. EEPROM Read/Write Request 32bit RW
  263. ------------------------------------------
  264. 1 EE_READ - EEPROM Read Request 1 - Setting this bit
  265. loads a single byte of data into the EE_DATA
  266. register from the EEPROM location specified in
  267. the EE_ADDR register.
  268. The Wlan hardware hardware clears this bit automatically.
  269. EE_DATA is valid when this bit is cleared.
  270. 0 EE_WRITE - EEPROM Write Request - Setting this bit
  271. writes a single byte of data from the EE_DATA register into the
  272. EEPROM location specified in the EE_ADDR register.
  273. The Wlan hardware hardware clears this bit automatically.
  274. *===============================================*/
  275. #define ACX_EE_CTL_REG EE_CTL
  276. #define EE_WRITE 0x00000001ul
  277. #define EE_READ 0x00000002ul
  278. /*===============================================
  279. EEPROM Address - 32bit RW
  280. ------------------------------------------
  281. This register specifies the address
  282. within the EEPROM from/to which to read/write data.
  283. ===============================================*/
  284. #define ACX_EE_ADDR_REG EE_ADDR
  285. /*===============================================
  286. EEPROM Data - 32bit RW
  287. ------------------------------------------
  288. This register either holds the read 8 bits of
  289. data from the EEPROM or the write data
  290. to be written to the EEPROM.
  291. ===============================================*/
  292. #define ACX_EE_DATA_REG EE_DATA
  293. /*===============================================
  294. EEPROM Base Address - 32bit RW
  295. ------------------------------------------
  296. This register holds the upper nine bits
  297. [23:15] of the 24-bit Wlan hardware memory
  298. address for burst reads from EEPROM accesses.
  299. The EEPROM provides the lower 15 bits of this address.
  300. The MSB of the address from the EEPROM is ignored.
  301. ===============================================*/
  302. #define ACX_EE_CFG EE_CFG
  303. /*===============================================
  304. GPIO Output Values -32bit, RW
  305. ------------------------------------------
  306. [31:16] Reserved
  307. [15: 0] Specify the output values (at the output driver inputs) for
  308. GPIO[15:0], respectively.
  309. ===============================================*/
  310. #define ACX_GPIO_OUT_REG GPIO_OUT
  311. #define ACX_MAX_GPIO_LINES 15
  312. /*===============================================
  313. Contention window -32bit, RW
  314. ------------------------------------------
  315. [31:26] Reserved
  316. [25:16] Max (0x3ff)
  317. [15:07] Reserved
  318. [06:00] Current contention window value - default is 0x1F
  319. ===============================================*/
  320. #define ACX_CONT_WIND_CFG_REG CONT_WIND_CFG
  321. #define ACX_CONT_WIND_MIN_MASK 0x0000007f
  322. #define ACX_CONT_WIND_MAX 0x03ff0000
  323. /*===============================================
  324. HI_CFG Interface Configuration Register Values
  325. ------------------------------------------
  326. ===============================================*/
  327. #define HI_CFG_UART_ENABLE 0x00000004
  328. #define HI_CFG_RST232_ENABLE 0x00000008
  329. #define HI_CFG_CLOCK_REQ_SELECT 0x00000010
  330. #define HI_CFG_HOST_INT_ENABLE 0x00000020
  331. #define HI_CFG_VLYNQ_OUTPUT_ENABLE 0x00000040
  332. #define HI_CFG_HOST_INT_ACTIVE_LOW 0x00000080
  333. #define HI_CFG_UART_TX_OUT_GPIO_15 0x00000100
  334. #define HI_CFG_UART_TX_OUT_GPIO_14 0x00000200
  335. #define HI_CFG_UART_TX_OUT_GPIO_7 0x00000400
  336. #define HI_CFG_DEF_VAL \
  337. (HI_CFG_UART_ENABLE | \
  338. HI_CFG_RST232_ENABLE | \
  339. HI_CFG_CLOCK_REQ_SELECT | \
  340. HI_CFG_HOST_INT_ENABLE)
  341. #define REF_FREQ_19_2 0
  342. #define REF_FREQ_26_0 1
  343. #define REF_FREQ_38_4 2
  344. #define REF_FREQ_40_0 3
  345. #define REF_FREQ_33_6 4
  346. #define REF_FREQ_NUM 5
  347. #define LUT_PARAM_INTEGER_DIVIDER 0
  348. #define LUT_PARAM_FRACTIONAL_DIVIDER 1
  349. #define LUT_PARAM_ATTN_BB 2
  350. #define LUT_PARAM_ALPHA_BB 3
  351. #define LUT_PARAM_STOP_TIME_BB 4
  352. #define LUT_PARAM_BB_PLL_LOOP_FILTER 5
  353. #define LUT_PARAM_NUM 6
  354. #define ACX_EEPROMLESS_IND_REG (SCR_PAD4)
  355. #define USE_EEPROM 0
  356. #define SOFT_RESET_MAX_TIME 1000000
  357. #define SOFT_RESET_STALL_TIME 1000
  358. #define NVS_DATA_BUNDARY_ALIGNMENT 4
  359. /* Firmware image load chunk size */
  360. #define CHUNK_SIZE 16384
  361. /* Firmware image header size */
  362. #define FW_HDR_SIZE 8
  363. #define ECPU_CONTROL_HALT 0x00000101
  364. /******************************************************************************
  365. CHANNELS, BAND & REG DOMAINS definitions
  366. ******************************************************************************/
  367. enum {
  368. RADIO_BAND_2_4GHZ = 0, /* 2.4 Ghz band */
  369. RADIO_BAND_5GHZ = 1, /* 5 Ghz band */
  370. RADIO_BAND_JAPAN_4_9_GHZ = 2,
  371. DEFAULT_BAND = RADIO_BAND_2_4GHZ,
  372. INVALID_BAND = 0xFE,
  373. MAX_RADIO_BANDS = 0xFF
  374. };
  375. #define SHORT_PREAMBLE_BIT BIT(0) /* CCK or Barker depending on the rate */
  376. #define OFDM_RATE_BIT BIT(6)
  377. #define PBCC_RATE_BIT BIT(7)
  378. enum {
  379. CCK_LONG = 0,
  380. CCK_SHORT = SHORT_PREAMBLE_BIT,
  381. PBCC_LONG = PBCC_RATE_BIT,
  382. PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
  383. OFDM = OFDM_RATE_BIT
  384. };
  385. /******************************************************************************
  386. Transmit-Descriptor RATE-SET field definitions...
  387. Define a new "Rate-Set" for TX path that incorporates the
  388. Rate & Modulation info into a single 16-bit field.
  389. TxdRateSet_t:
  390. b15 - Indicates Preamble type (1=SHORT, 0=LONG).
  391. Notes:
  392. Must be LONG (0) for 1Mbps rate.
  393. Does not apply (set to 0) for RevG-OFDM rates.
  394. b14 - Indicates PBCC encoding (1=PBCC, 0=not).
  395. Notes:
  396. Does not apply (set to 0) for rates 1 and 2 Mbps.
  397. Does not apply (set to 0) for RevG-OFDM rates.
  398. b13 - Unused (set to 0).
  399. b12-b0 - Supported Rate indicator bits as defined below.
  400. ******************************************************************************/
  401. /*************************************************************************
  402. Interrupt Trigger Register (Host -> WiLink)
  403. **************************************************************************/
  404. /* Hardware to Embedded CPU Interrupts - first 32-bit register set */
  405. /*
  406. * Host Command Interrupt. Setting this bit masks
  407. * the interrupt that the host issues to inform
  408. * the FW that it has sent a command
  409. * to the Wlan hardware Command Mailbox.
  410. */
  411. #define INTR_TRIG_CMD BIT(0)
  412. /*
  413. * Host Event Acknowlegde Interrupt. The host
  414. * sets this bit to acknowledge that it received
  415. * the unsolicited information from the event
  416. * mailbox.
  417. */
  418. #define INTR_TRIG_EVENT_ACK BIT(1)
  419. /*
  420. * The host sets this bit to inform the Wlan
  421. * FW that a TX packet is in the XFER
  422. * Buffer #0.
  423. */
  424. #define INTR_TRIG_TX_PROC0 BIT(2)
  425. /*
  426. * The host sets this bit to inform the FW
  427. * that it read a packet from RX XFER
  428. * Buffer #0.
  429. */
  430. #define INTR_TRIG_RX_PROC0 BIT(3)
  431. #define INTR_TRIG_DEBUG_ACK BIT(4)
  432. #define INTR_TRIG_STATE_CHANGED BIT(5)
  433. /* Hardware to Embedded CPU Interrupts - second 32-bit register set */
  434. /*
  435. * The host sets this bit to inform the FW
  436. * that it read a packet from RX XFER
  437. * Buffer #1.
  438. */
  439. #define INTR_TRIG_RX_PROC1 BIT(17)
  440. /*
  441. * The host sets this bit to inform the Wlan
  442. * hardware that a TX packet is in the XFER
  443. * Buffer #1.
  444. */
  445. #define INTR_TRIG_TX_PROC1 BIT(18)
  446. #define WL127X_REG_FUSE_DATA_2_1 0x050a
  447. #define WL128X_REG_FUSE_DATA_2_1 0x2152
  448. #define PG_VER_MASK 0x3c
  449. #define PG_VER_OFFSET 2
  450. #define WL127X_PG_MAJOR_VER_MASK 0x3
  451. #define WL127X_PG_MAJOR_VER_OFFSET 0x0
  452. #define WL127X_PG_MINOR_VER_MASK 0xc
  453. #define WL127X_PG_MINOR_VER_OFFSET 0x2
  454. #define WL128X_PG_MAJOR_VER_MASK 0xc
  455. #define WL128X_PG_MAJOR_VER_OFFSET 0x2
  456. #define WL128X_PG_MINOR_VER_MASK 0x3
  457. #define WL128X_PG_MINOR_VER_OFFSET 0x0
  458. #define WL127X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL127X_PG_MAJOR_VER_MASK) >> \
  459. WL127X_PG_MAJOR_VER_OFFSET)
  460. #define WL127X_PG_GET_MINOR(pg_ver) ((pg_ver & WL127X_PG_MINOR_VER_MASK) >> \
  461. WL127X_PG_MINOR_VER_OFFSET)
  462. #define WL128X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL128X_PG_MAJOR_VER_MASK) >> \
  463. WL128X_PG_MAJOR_VER_OFFSET)
  464. #define WL128X_PG_GET_MINOR(pg_ver) ((pg_ver & WL128X_PG_MINOR_VER_MASK) >> \
  465. WL128X_PG_MINOR_VER_OFFSET)
  466. #define WL12XX_REG_FUSE_BD_ADDR_1 0x00310eb4
  467. #define WL12XX_REG_FUSE_BD_ADDR_2 0x00310eb8
  468. #endif