18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is part of wl12xx
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
68c2ecf20Sopenharmony_ci * Copyright (C) 2009 Nokia Corporation
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Contact: Luciano Coelho <luciano.coelho@nokia.com>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __REG_H__
128c2ecf20Sopenharmony_ci#define __REG_H__
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/bitops.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define REGISTERS_BASE 0x00300000
178c2ecf20Sopenharmony_ci#define DRPW_BASE      0x00310000
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define REGISTERS_DOWN_SIZE 0x00008800
208c2ecf20Sopenharmony_ci#define REGISTERS_WORK_SIZE 0x0000b000
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define FW_STATUS_ADDR                      (0x14FC0 + 0xA000)
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci/*===============================================
258c2ecf20Sopenharmony_ci   Host Software Reset - 32bit RW
268c2ecf20Sopenharmony_ci ------------------------------------------
278c2ecf20Sopenharmony_ci    [31:1] Reserved
288c2ecf20Sopenharmony_ci    0  SOFT_RESET Soft Reset  - When this bit is set,
298c2ecf20Sopenharmony_ci    it holds the Wlan hardware in a soft reset state.
308c2ecf20Sopenharmony_ci    This reset disables all MAC and baseband processor
318c2ecf20Sopenharmony_ci    clocks except the CardBus/PCI interface clock.
328c2ecf20Sopenharmony_ci    It also initializes all MAC state machines except
338c2ecf20Sopenharmony_ci    the host interface. It does not reload the
348c2ecf20Sopenharmony_ci    contents of the EEPROM. When this bit is cleared
358c2ecf20Sopenharmony_ci    (not self-clearing), the Wlan hardware
368c2ecf20Sopenharmony_ci    exits the software reset state.
378c2ecf20Sopenharmony_ci===============================================*/
388c2ecf20Sopenharmony_ci#define WL12XX_SLV_SOFT_RESET		(REGISTERS_BASE + 0x0000)
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define WL1271_SLV_REG_DATA            (REGISTERS_BASE + 0x0008)
418c2ecf20Sopenharmony_ci#define WL1271_SLV_REG_ADATA           (REGISTERS_BASE + 0x000c)
428c2ecf20Sopenharmony_ci#define WL1271_SLV_MEM_DATA            (REGISTERS_BASE + 0x0018)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define WL12XX_REG_INTERRUPT_TRIG         (REGISTERS_BASE + 0x0474)
458c2ecf20Sopenharmony_ci#define WL12XX_REG_INTERRUPT_TRIG_H       (REGISTERS_BASE + 0x0478)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/*=============================================
488c2ecf20Sopenharmony_ci  Host Interrupt Mask Register - 32bit (RW)
498c2ecf20Sopenharmony_ci  ------------------------------------------
508c2ecf20Sopenharmony_ci  Setting a bit in this register masks the
518c2ecf20Sopenharmony_ci  corresponding interrupt to the host.
528c2ecf20Sopenharmony_ci  0 - RX0		- Rx first dubble buffer Data Interrupt
538c2ecf20Sopenharmony_ci  1 - TXD		- Tx Data Interrupt
548c2ecf20Sopenharmony_ci  2 - TXXFR		- Tx Transfer Interrupt
558c2ecf20Sopenharmony_ci  3 - RX1		- Rx second dubble buffer Data Interrupt
568c2ecf20Sopenharmony_ci  4 - RXXFR		- Rx Transfer Interrupt
578c2ecf20Sopenharmony_ci  5 - EVENT_A	- Event Mailbox interrupt
588c2ecf20Sopenharmony_ci  6 - EVENT_B	- Event Mailbox interrupt
598c2ecf20Sopenharmony_ci  7 - WNONHST	- Wake On Host Interrupt
608c2ecf20Sopenharmony_ci  8 - TRACE_A	- Debug Trace interrupt
618c2ecf20Sopenharmony_ci  9 - TRACE_B	- Debug Trace interrupt
628c2ecf20Sopenharmony_ci 10 - CDCMP		- Command Complete Interrupt
638c2ecf20Sopenharmony_ci 11 -
648c2ecf20Sopenharmony_ci 12 -
658c2ecf20Sopenharmony_ci 13 -
668c2ecf20Sopenharmony_ci 14 - ICOMP		- Initialization Complete Interrupt
678c2ecf20Sopenharmony_ci 16 - SG SE		- Soft Gemini - Sense enable interrupt
688c2ecf20Sopenharmony_ci 17 - SG SD		- Soft Gemini - Sense disable interrupt
698c2ecf20Sopenharmony_ci 18 -			-
708c2ecf20Sopenharmony_ci 19 -			-
718c2ecf20Sopenharmony_ci 20 -			-
728c2ecf20Sopenharmony_ci 21-			-
738c2ecf20Sopenharmony_ci Default: 0x0001
748c2ecf20Sopenharmony_ci*==============================================*/
758c2ecf20Sopenharmony_ci#define WL12XX_REG_INTERRUPT_MASK         (REGISTERS_BASE + 0x04DC)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/*=============================================
788c2ecf20Sopenharmony_ci  Host Interrupt Mask Set 16bit, (Write only)
798c2ecf20Sopenharmony_ci  ------------------------------------------
808c2ecf20Sopenharmony_ci Setting a bit in this register sets
818c2ecf20Sopenharmony_ci the corresponding bin in ACX_HINT_MASK register
828c2ecf20Sopenharmony_ci without effecting the mask
838c2ecf20Sopenharmony_ci state of other bits (0 = no effect).
848c2ecf20Sopenharmony_ci==============================================*/
858c2ecf20Sopenharmony_ci#define ACX_REG_HINT_MASK_SET          (REGISTERS_BASE + 0x04E0)
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci/*=============================================
888c2ecf20Sopenharmony_ci  Host Interrupt Mask Clear 16bit,(Write only)
898c2ecf20Sopenharmony_ci  ------------------------------------------
908c2ecf20Sopenharmony_ci Setting a bit in this register clears
918c2ecf20Sopenharmony_ci the corresponding bin in ACX_HINT_MASK register
928c2ecf20Sopenharmony_ci without effecting the mask
938c2ecf20Sopenharmony_ci state of other bits (0 = no effect).
948c2ecf20Sopenharmony_ci=============================================*/
958c2ecf20Sopenharmony_ci#define ACX_REG_HINT_MASK_CLR          (REGISTERS_BASE + 0x04E4)
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci/*=============================================
988c2ecf20Sopenharmony_ci  Host Interrupt Status Nondestructive Read
998c2ecf20Sopenharmony_ci  16bit,(Read only)
1008c2ecf20Sopenharmony_ci  ------------------------------------------
1018c2ecf20Sopenharmony_ci The host can read this register to determine
1028c2ecf20Sopenharmony_ci which interrupts are active.
1038c2ecf20Sopenharmony_ci Reading this register doesn't
1048c2ecf20Sopenharmony_ci effect its content.
1058c2ecf20Sopenharmony_ci=============================================*/
1068c2ecf20Sopenharmony_ci#define WL12XX_REG_INTERRUPT_NO_CLEAR     (REGISTERS_BASE + 0x04E8)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/*=============================================
1098c2ecf20Sopenharmony_ci  Host Interrupt Status Clear on Read  Register
1108c2ecf20Sopenharmony_ci  16bit,(Read only)
1118c2ecf20Sopenharmony_ci  ------------------------------------------
1128c2ecf20Sopenharmony_ci The host can read this register to determine
1138c2ecf20Sopenharmony_ci which interrupts are active.
1148c2ecf20Sopenharmony_ci Reading this register clears it,
1158c2ecf20Sopenharmony_ci thus making all interrupts inactive.
1168c2ecf20Sopenharmony_ci==============================================*/
1178c2ecf20Sopenharmony_ci#define ACX_REG_INTERRUPT_CLEAR        (REGISTERS_BASE + 0x04F8)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/*=============================================
1208c2ecf20Sopenharmony_ci  Host Interrupt Acknowledge Register
1218c2ecf20Sopenharmony_ci  16bit,(Write only)
1228c2ecf20Sopenharmony_ci  ------------------------------------------
1238c2ecf20Sopenharmony_ci The host can set individual bits in this
1248c2ecf20Sopenharmony_ci register to clear (acknowledge) the corresp.
1258c2ecf20Sopenharmony_ci interrupt status bits in the HINT_STS_CLR and
1268c2ecf20Sopenharmony_ci HINT_STS_ND registers, thus making the
1278c2ecf20Sopenharmony_ci assotiated interrupt inactive. (0-no effect)
1288c2ecf20Sopenharmony_ci==============================================*/
1298c2ecf20Sopenharmony_ci#define WL12XX_REG_INTERRUPT_ACK          (REGISTERS_BASE + 0x04F0)
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci#define WL12XX_REG_RX_DRIVER_COUNTER	(REGISTERS_BASE + 0x0538)
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci/* Device Configuration registers*/
1348c2ecf20Sopenharmony_ci#define SOR_CFG                        (REGISTERS_BASE + 0x0800)
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/* Embedded ARM CPU Control */
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci/*===============================================
1398c2ecf20Sopenharmony_ci Halt eCPU   - 32bit RW
1408c2ecf20Sopenharmony_ci ------------------------------------------
1418c2ecf20Sopenharmony_ci 0 HALT_ECPU Halt Embedded CPU - This bit is the
1428c2ecf20Sopenharmony_ci complement of bit 1 (MDATA2) in the SOR_CFG register.
1438c2ecf20Sopenharmony_ci During a hardware reset, this bit holds
1448c2ecf20Sopenharmony_ci the inverse of MDATA2.
1458c2ecf20Sopenharmony_ci When downloading firmware from the host,
1468c2ecf20Sopenharmony_ci set this bit (pull down MDATA2).
1478c2ecf20Sopenharmony_ci The host clears this bit after downloading the firmware into
1488c2ecf20Sopenharmony_ci zero-wait-state SSRAM.
1498c2ecf20Sopenharmony_ci When loading firmware from Flash, clear this bit (pull up MDATA2)
1508c2ecf20Sopenharmony_ci so that the eCPU can run the bootloader code in Flash
1518c2ecf20Sopenharmony_ci HALT_ECPU eCPU State
1528c2ecf20Sopenharmony_ci --------------------
1538c2ecf20Sopenharmony_ci 1 halt eCPU
1548c2ecf20Sopenharmony_ci 0 enable eCPU
1558c2ecf20Sopenharmony_ci ===============================================*/
1568c2ecf20Sopenharmony_ci#define WL12XX_REG_ECPU_CONTROL           (REGISTERS_BASE + 0x0804)
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#define WL12XX_HI_CFG			(REGISTERS_BASE + 0x0808)
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci/*===============================================
1618c2ecf20Sopenharmony_ci EEPROM Burst Read Start  - 32bit RW
1628c2ecf20Sopenharmony_ci ------------------------------------------
1638c2ecf20Sopenharmony_ci [31:1] Reserved
1648c2ecf20Sopenharmony_ci 0  ACX_EE_START -  EEPROM Burst Read Start 0
1658c2ecf20Sopenharmony_ci Setting this bit starts a burst read from
1668c2ecf20Sopenharmony_ci the external EEPROM.
1678c2ecf20Sopenharmony_ci If this bit is set (after reset) before an EEPROM read/write,
1688c2ecf20Sopenharmony_ci the burst read starts at EEPROM address 0.
1698c2ecf20Sopenharmony_ci Otherwise, it starts at the address
1708c2ecf20Sopenharmony_ci following the address of the previous access.
1718c2ecf20Sopenharmony_ci TheWlan hardware hardware clears this bit automatically.
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci Default: 0x00000000
1748c2ecf20Sopenharmony_ci*================================================*/
1758c2ecf20Sopenharmony_ci#define ACX_REG_EE_START               (REGISTERS_BASE + 0x080C)
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci#define WL12XX_OCP_POR_CTR		(REGISTERS_BASE + 0x09B4)
1788c2ecf20Sopenharmony_ci#define WL12XX_OCP_DATA_WRITE		(REGISTERS_BASE + 0x09B8)
1798c2ecf20Sopenharmony_ci#define WL12XX_OCP_DATA_READ		(REGISTERS_BASE + 0x09BC)
1808c2ecf20Sopenharmony_ci#define WL12XX_OCP_CMD			(REGISTERS_BASE + 0x09C0)
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define WL12XX_HOST_WR_ACCESS		(REGISTERS_BASE + 0x09F8)
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci#define WL12XX_CHIP_ID_B		(REGISTERS_BASE + 0x5674)
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci#define WL12XX_ENABLE			(REGISTERS_BASE + 0x5450)
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ci/* Power Management registers */
1898c2ecf20Sopenharmony_ci#define WL12XX_ELP_CFG_MODE		(REGISTERS_BASE + 0x5804)
1908c2ecf20Sopenharmony_ci#define WL12XX_ELP_CMD			(REGISTERS_BASE + 0x5808)
1918c2ecf20Sopenharmony_ci#define WL12XX_PLL_CAL_TIME		(REGISTERS_BASE + 0x5810)
1928c2ecf20Sopenharmony_ci#define WL12XX_CLK_REQ_TIME		(REGISTERS_BASE + 0x5814)
1938c2ecf20Sopenharmony_ci#define WL12XX_CLK_BUF_TIME		(REGISTERS_BASE + 0x5818)
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define WL12XX_CFG_PLL_SYNC_CNT		(REGISTERS_BASE + 0x5820)
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci/* Scratch Pad registers*/
1988c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD0			(REGISTERS_BASE + 0x5608)
1998c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD1			(REGISTERS_BASE + 0x560C)
2008c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD2			(REGISTERS_BASE + 0x5610)
2018c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD3			(REGISTERS_BASE + 0x5614)
2028c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD4			(REGISTERS_BASE + 0x5618)
2038c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD4_SET		(REGISTERS_BASE + 0x561C)
2048c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD4_CLR		(REGISTERS_BASE + 0x5620)
2058c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD5			(REGISTERS_BASE + 0x5624)
2068c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD5_SET		(REGISTERS_BASE + 0x5628)
2078c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD5_CLR		(REGISTERS_BASE + 0x562C)
2088c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD6			(REGISTERS_BASE + 0x5630)
2098c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD7			(REGISTERS_BASE + 0x5634)
2108c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD8			(REGISTERS_BASE + 0x5638)
2118c2ecf20Sopenharmony_ci#define WL12XX_SCR_PAD9			(REGISTERS_BASE + 0x563C)
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci/* Spare registers*/
2148c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A1			(REGISTERS_BASE + 0x0994)
2158c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A2			(REGISTERS_BASE + 0x0998)
2168c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A3			(REGISTERS_BASE + 0x099C)
2178c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A4			(REGISTERS_BASE + 0x09A0)
2188c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A5			(REGISTERS_BASE + 0x09A4)
2198c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A6			(REGISTERS_BASE + 0x09A8)
2208c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A7			(REGISTERS_BASE + 0x09AC)
2218c2ecf20Sopenharmony_ci#define WL12XX_SPARE_A8			(REGISTERS_BASE + 0x09B0)
2228c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B1			(REGISTERS_BASE + 0x5420)
2238c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B2			(REGISTERS_BASE + 0x5424)
2248c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B3			(REGISTERS_BASE + 0x5428)
2258c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B4			(REGISTERS_BASE + 0x542C)
2268c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B5			(REGISTERS_BASE + 0x5430)
2278c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B6			(REGISTERS_BASE + 0x5434)
2288c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B7			(REGISTERS_BASE + 0x5438)
2298c2ecf20Sopenharmony_ci#define WL12XX_SPARE_B8			(REGISTERS_BASE + 0x543C)
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci#define WL12XX_PLL_PARAMETERS		(REGISTERS_BASE + 0x6040)
2328c2ecf20Sopenharmony_ci#define WL12XX_WU_COUNTER_PAUSE		(REGISTERS_BASE + 0x6008)
2338c2ecf20Sopenharmony_ci#define WL12XX_WELP_ARM_COMMAND		(REGISTERS_BASE + 0x6100)
2348c2ecf20Sopenharmony_ci#define WL12XX_DRPW_SCRATCH_START	(DRPW_BASE + 0x002C)
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci#define WL12XX_CMD_MBOX_ADDRESS		0x407B4
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define ACX_REG_EEPROM_START_BIT BIT(1)
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci/* Command/Information Mailbox Pointers */
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci/*===============================================
2438c2ecf20Sopenharmony_ci  Command Mailbox Pointer - 32bit RW
2448c2ecf20Sopenharmony_ci ------------------------------------------
2458c2ecf20Sopenharmony_ci This register holds the start address of
2468c2ecf20Sopenharmony_ci the command mailbox located in the Wlan hardware memory.
2478c2ecf20Sopenharmony_ci The host must read this pointer after a reset to
2488c2ecf20Sopenharmony_ci find the location of the command mailbox.
2498c2ecf20Sopenharmony_ci The Wlan hardware initializes the command mailbox
2508c2ecf20Sopenharmony_ci pointer with the default address of the command mailbox.
2518c2ecf20Sopenharmony_ci The command mailbox pointer is not valid until after
2528c2ecf20Sopenharmony_ci the host receives the Init Complete interrupt from
2538c2ecf20Sopenharmony_ci the Wlan hardware.
2548c2ecf20Sopenharmony_ci ===============================================*/
2558c2ecf20Sopenharmony_ci#define WL12XX_REG_COMMAND_MAILBOX_PTR		(WL12XX_SCR_PAD0)
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci/*===============================================
2588c2ecf20Sopenharmony_ci  Information Mailbox Pointer - 32bit RW
2598c2ecf20Sopenharmony_ci ------------------------------------------
2608c2ecf20Sopenharmony_ci This register holds the start address of
2618c2ecf20Sopenharmony_ci the information mailbox located in the Wlan hardware memory.
2628c2ecf20Sopenharmony_ci The host must read this pointer after a reset to find
2638c2ecf20Sopenharmony_ci the location of the information mailbox.
2648c2ecf20Sopenharmony_ci The Wlan hardware initializes the information mailbox pointer
2658c2ecf20Sopenharmony_ci with the default address of the information mailbox.
2668c2ecf20Sopenharmony_ci The information mailbox pointer is not valid
2678c2ecf20Sopenharmony_ci until after the host receives the Init Complete interrupt from
2688c2ecf20Sopenharmony_ci the Wlan hardware.
2698c2ecf20Sopenharmony_ci ===============================================*/
2708c2ecf20Sopenharmony_ci#define WL12XX_REG_EVENT_MAILBOX_PTR		(WL12XX_SCR_PAD1)
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci/*===============================================
2738c2ecf20Sopenharmony_ci EEPROM Read/Write Request 32bit RW
2748c2ecf20Sopenharmony_ci ------------------------------------------
2758c2ecf20Sopenharmony_ci 1 EE_READ - EEPROM Read Request 1 - Setting this bit
2768c2ecf20Sopenharmony_ci loads a single byte of data into the EE_DATA
2778c2ecf20Sopenharmony_ci register from the EEPROM location specified in
2788c2ecf20Sopenharmony_ci the EE_ADDR register.
2798c2ecf20Sopenharmony_ci The Wlan hardware hardware clears this bit automatically.
2808c2ecf20Sopenharmony_ci EE_DATA is valid when this bit is cleared.
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci 0 EE_WRITE  - EEPROM Write Request  - Setting this bit
2838c2ecf20Sopenharmony_ci writes a single byte of data from the EE_DATA register into the
2848c2ecf20Sopenharmony_ci EEPROM location specified in the EE_ADDR register.
2858c2ecf20Sopenharmony_ci The Wlan hardware hardware clears this bit automatically.
2868c2ecf20Sopenharmony_ci*===============================================*/
2878c2ecf20Sopenharmony_ci#define ACX_EE_CTL_REG                      EE_CTL
2888c2ecf20Sopenharmony_ci#define EE_WRITE                            0x00000001ul
2898c2ecf20Sopenharmony_ci#define EE_READ                             0x00000002ul
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/*===============================================
2928c2ecf20Sopenharmony_ci  EEPROM Address  - 32bit RW
2938c2ecf20Sopenharmony_ci  ------------------------------------------
2948c2ecf20Sopenharmony_ci  This register specifies the address
2958c2ecf20Sopenharmony_ci  within the EEPROM from/to which to read/write data.
2968c2ecf20Sopenharmony_ci  ===============================================*/
2978c2ecf20Sopenharmony_ci#define ACX_EE_ADDR_REG                     EE_ADDR
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci/*===============================================
3008c2ecf20Sopenharmony_ci  EEPROM Data  - 32bit RW
3018c2ecf20Sopenharmony_ci  ------------------------------------------
3028c2ecf20Sopenharmony_ci  This register either holds the read 8 bits of
3038c2ecf20Sopenharmony_ci  data from the EEPROM or the write data
3048c2ecf20Sopenharmony_ci  to be written to the EEPROM.
3058c2ecf20Sopenharmony_ci  ===============================================*/
3068c2ecf20Sopenharmony_ci#define ACX_EE_DATA_REG                     EE_DATA
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci/*===============================================
3098c2ecf20Sopenharmony_ci  EEPROM Base Address  - 32bit RW
3108c2ecf20Sopenharmony_ci  ------------------------------------------
3118c2ecf20Sopenharmony_ci  This register holds the upper nine bits
3128c2ecf20Sopenharmony_ci  [23:15] of the 24-bit Wlan hardware memory
3138c2ecf20Sopenharmony_ci  address for burst reads from EEPROM accesses.
3148c2ecf20Sopenharmony_ci  The EEPROM provides the lower 15 bits of this address.
3158c2ecf20Sopenharmony_ci  The MSB of the address from the EEPROM is ignored.
3168c2ecf20Sopenharmony_ci  ===============================================*/
3178c2ecf20Sopenharmony_ci#define ACX_EE_CFG                          EE_CFG
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci/*===============================================
3208c2ecf20Sopenharmony_ci  GPIO Output Values  -32bit, RW
3218c2ecf20Sopenharmony_ci  ------------------------------------------
3228c2ecf20Sopenharmony_ci  [31:16]  Reserved
3238c2ecf20Sopenharmony_ci  [15: 0]  Specify the output values (at the output driver inputs) for
3248c2ecf20Sopenharmony_ci  GPIO[15:0], respectively.
3258c2ecf20Sopenharmony_ci  ===============================================*/
3268c2ecf20Sopenharmony_ci#define ACX_GPIO_OUT_REG            GPIO_OUT
3278c2ecf20Sopenharmony_ci#define ACX_MAX_GPIO_LINES          15
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci/*===============================================
3308c2ecf20Sopenharmony_ci  Contention window  -32bit, RW
3318c2ecf20Sopenharmony_ci  ------------------------------------------
3328c2ecf20Sopenharmony_ci  [31:26]  Reserved
3338c2ecf20Sopenharmony_ci  [25:16]  Max (0x3ff)
3348c2ecf20Sopenharmony_ci  [15:07]  Reserved
3358c2ecf20Sopenharmony_ci  [06:00]  Current contention window value - default is 0x1F
3368c2ecf20Sopenharmony_ci  ===============================================*/
3378c2ecf20Sopenharmony_ci#define ACX_CONT_WIND_CFG_REG    CONT_WIND_CFG
3388c2ecf20Sopenharmony_ci#define ACX_CONT_WIND_MIN_MASK   0x0000007f
3398c2ecf20Sopenharmony_ci#define ACX_CONT_WIND_MAX        0x03ff0000
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci#define REF_FREQ_19_2                       0
3428c2ecf20Sopenharmony_ci#define REF_FREQ_26_0                       1
3438c2ecf20Sopenharmony_ci#define REF_FREQ_38_4                       2
3448c2ecf20Sopenharmony_ci#define REF_FREQ_40_0                       3
3458c2ecf20Sopenharmony_ci#define REF_FREQ_33_6                       4
3468c2ecf20Sopenharmony_ci#define REF_FREQ_NUM                        5
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci#define LUT_PARAM_INTEGER_DIVIDER           0
3498c2ecf20Sopenharmony_ci#define LUT_PARAM_FRACTIONAL_DIVIDER        1
3508c2ecf20Sopenharmony_ci#define LUT_PARAM_ATTN_BB                   2
3518c2ecf20Sopenharmony_ci#define LUT_PARAM_ALPHA_BB                  3
3528c2ecf20Sopenharmony_ci#define LUT_PARAM_STOP_TIME_BB              4
3538c2ecf20Sopenharmony_ci#define LUT_PARAM_BB_PLL_LOOP_FILTER        5
3548c2ecf20Sopenharmony_ci#define LUT_PARAM_NUM                       6
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci#define WL12XX_EEPROMLESS_IND		(WL12XX_SCR_PAD4)
3578c2ecf20Sopenharmony_ci#define USE_EEPROM                          0
3588c2ecf20Sopenharmony_ci#define NVS_DATA_BUNDARY_ALIGNMENT          4
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci/* Firmware image header size */
3618c2ecf20Sopenharmony_ci#define FW_HDR_SIZE 8
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci/******************************************************************************
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_ci    CHANNELS, BAND & REG DOMAINS definitions
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci******************************************************************************/
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_ci#define SHORT_PREAMBLE_BIT   BIT(0) /* CCK or Barker depending on the rate */
3708c2ecf20Sopenharmony_ci#define OFDM_RATE_BIT        BIT(6)
3718c2ecf20Sopenharmony_ci#define PBCC_RATE_BIT        BIT(7)
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_cienum {
3748c2ecf20Sopenharmony_ci	CCK_LONG = 0,
3758c2ecf20Sopenharmony_ci	CCK_SHORT = SHORT_PREAMBLE_BIT,
3768c2ecf20Sopenharmony_ci	PBCC_LONG = PBCC_RATE_BIT,
3778c2ecf20Sopenharmony_ci	PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
3788c2ecf20Sopenharmony_ci	OFDM = OFDM_RATE_BIT
3798c2ecf20Sopenharmony_ci};
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_ci/******************************************************************************
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ciTransmit-Descriptor RATE-SET field definitions...
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ciDefine a new "Rate-Set" for TX path that incorporates the
3868c2ecf20Sopenharmony_ciRate & Modulation info into a single 16-bit field.
3878c2ecf20Sopenharmony_ci
3888c2ecf20Sopenharmony_ciTxdRateSet_t:
3898c2ecf20Sopenharmony_cib15   - Indicates Preamble type (1=SHORT, 0=LONG).
3908c2ecf20Sopenharmony_ci	Notes:
3918c2ecf20Sopenharmony_ci	Must be LONG (0) for 1Mbps rate.
3928c2ecf20Sopenharmony_ci	Does not apply (set to 0) for RevG-OFDM rates.
3938c2ecf20Sopenharmony_cib14   - Indicates PBCC encoding (1=PBCC, 0=not).
3948c2ecf20Sopenharmony_ci	Notes:
3958c2ecf20Sopenharmony_ci	Does not apply (set to 0) for rates 1 and 2 Mbps.
3968c2ecf20Sopenharmony_ci	Does not apply (set to 0) for RevG-OFDM rates.
3978c2ecf20Sopenharmony_cib13    - Unused (set to 0).
3988c2ecf20Sopenharmony_cib12-b0 - Supported Rate indicator bits as defined below.
3998c2ecf20Sopenharmony_ci
4008c2ecf20Sopenharmony_ci******************************************************************************/
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci#define OCP_CMD_LOOP		32
4038c2ecf20Sopenharmony_ci#define OCP_CMD_WRITE		0x1
4048c2ecf20Sopenharmony_ci#define OCP_CMD_READ		0x2
4058c2ecf20Sopenharmony_ci#define OCP_READY_MASK		BIT(18)
4068c2ecf20Sopenharmony_ci#define OCP_STATUS_MASK		(BIT(16) | BIT(17))
4078c2ecf20Sopenharmony_ci#define OCP_STATUS_NO_RESP	0x00000
4088c2ecf20Sopenharmony_ci#define OCP_STATUS_OK		0x10000
4098c2ecf20Sopenharmony_ci#define OCP_STATUS_REQ_FAILED	0x20000
4108c2ecf20Sopenharmony_ci#define OCP_STATUS_RESP_ERROR	0x30000
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_ci#define OCP_REG_POLARITY     0x0064
4138c2ecf20Sopenharmony_ci#define OCP_REG_CLK_TYPE     0x0448
4148c2ecf20Sopenharmony_ci#define OCP_REG_CLK_POLARITY 0x0cb2
4158c2ecf20Sopenharmony_ci#define OCP_REG_CLK_PULL     0x0cb4
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_ci#define POLARITY_LOW         BIT(1)
4188c2ecf20Sopenharmony_ci#define NO_PULL              (BIT(14) | BIT(15))
4198c2ecf20Sopenharmony_ci
4208c2ecf20Sopenharmony_ci#define FREF_CLK_TYPE_BITS     0xfffffe7f
4218c2ecf20Sopenharmony_ci#define CLK_REQ_PRCM           0x100
4228c2ecf20Sopenharmony_ci#define FREF_CLK_POLARITY_BITS 0xfffff8ff
4238c2ecf20Sopenharmony_ci#define CLK_REQ_OUTN_SEL       0x700
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ci#define WU_COUNTER_PAUSE_VAL 0x3FF
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ci/* PLL configuration algorithm for wl128x */
4288c2ecf20Sopenharmony_ci#define SYS_CLK_CFG_REG              0x2200
4298c2ecf20Sopenharmony_ci/* Bit[0]   -  0-TCXO,  1-FREF */
4308c2ecf20Sopenharmony_ci#define MCS_PLL_CLK_SEL_FREF         BIT(0)
4318c2ecf20Sopenharmony_ci/* Bit[3:2] - 01-TCXO, 10-FREF */
4328c2ecf20Sopenharmony_ci#define WL_CLK_REQ_TYPE_FREF         BIT(3)
4338c2ecf20Sopenharmony_ci#define WL_CLK_REQ_TYPE_PG2          (BIT(3) | BIT(2))
4348c2ecf20Sopenharmony_ci/* Bit[4]   -  0-TCXO,  1-FREF */
4358c2ecf20Sopenharmony_ci#define PRCM_CM_EN_MUX_WLAN_FREF     BIT(4)
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci#define TCXO_ILOAD_INT_REG           0x2264
4388c2ecf20Sopenharmony_ci#define TCXO_CLK_DETECT_REG          0x2266
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci#define TCXO_DET_FAILED              BIT(4)
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ci#define FREF_ILOAD_INT_REG           0x2084
4438c2ecf20Sopenharmony_ci#define FREF_CLK_DETECT_REG          0x2086
4448c2ecf20Sopenharmony_ci#define FREF_CLK_DETECT_FAIL         BIT(4)
4458c2ecf20Sopenharmony_ci
4468c2ecf20Sopenharmony_ci/* Use this reg for masking during driver access */
4478c2ecf20Sopenharmony_ci#define WL_SPARE_REG                 0x2320
4488c2ecf20Sopenharmony_ci#define WL_SPARE_VAL                 BIT(2)
4498c2ecf20Sopenharmony_ci/* Bit[6:5:3] -  mask wl write SYS_CLK_CFG[8:5:2:4] */
4508c2ecf20Sopenharmony_ci#define WL_SPARE_MASK_8526           (BIT(6) | BIT(5) | BIT(3))
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_ci#define PLL_LOCK_COUNTERS_REG        0xD8C
4538c2ecf20Sopenharmony_ci#define PLL_LOCK_COUNTERS_COEX       0x0F
4548c2ecf20Sopenharmony_ci#define PLL_LOCK_COUNTERS_MCS        0xF0
4558c2ecf20Sopenharmony_ci#define MCS_PLL_OVERRIDE_REG         0xD90
4568c2ecf20Sopenharmony_ci#define MCS_PLL_CONFIG_REG           0xD92
4578c2ecf20Sopenharmony_ci#define MCS_SEL_IN_FREQ_MASK         0x0070
4588c2ecf20Sopenharmony_ci#define MCS_SEL_IN_FREQ_SHIFT        4
4598c2ecf20Sopenharmony_ci#define MCS_PLL_CONFIG_REG_VAL       0x73
4608c2ecf20Sopenharmony_ci#define MCS_PLL_ENABLE_HP            (BIT(0) | BIT(1))
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_ci#define MCS_PLL_M_REG                0xD94
4638c2ecf20Sopenharmony_ci#define MCS_PLL_N_REG                0xD96
4648c2ecf20Sopenharmony_ci#define MCS_PLL_M_REG_VAL            0xC8
4658c2ecf20Sopenharmony_ci#define MCS_PLL_N_REG_VAL            0x07
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ci#define SDIO_IO_DS                   0xd14
4688c2ecf20Sopenharmony_ci
4698c2ecf20Sopenharmony_ci/* SDIO/wSPI DS configuration values */
4708c2ecf20Sopenharmony_cienum {
4718c2ecf20Sopenharmony_ci	HCI_IO_DS_8MA = 0,
4728c2ecf20Sopenharmony_ci	HCI_IO_DS_4MA = 1, /* default */
4738c2ecf20Sopenharmony_ci	HCI_IO_DS_6MA = 2,
4748c2ecf20Sopenharmony_ci	HCI_IO_DS_2MA = 3,
4758c2ecf20Sopenharmony_ci};
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci/* end PLL configuration algorithm for wl128x */
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci/*
4808c2ecf20Sopenharmony_ci * Host Command Interrupt. Setting this bit masks
4818c2ecf20Sopenharmony_ci * the interrupt that the host issues to inform
4828c2ecf20Sopenharmony_ci * the FW that it has sent a command
4838c2ecf20Sopenharmony_ci * to the Wlan hardware Command Mailbox.
4848c2ecf20Sopenharmony_ci */
4858c2ecf20Sopenharmony_ci#define WL12XX_INTR_TRIG_CMD		BIT(0)
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci/*
4888c2ecf20Sopenharmony_ci * Host Event Acknowlegde Interrupt. The host
4898c2ecf20Sopenharmony_ci * sets this bit to acknowledge that it received
4908c2ecf20Sopenharmony_ci * the unsolicited information from the event
4918c2ecf20Sopenharmony_ci * mailbox.
4928c2ecf20Sopenharmony_ci */
4938c2ecf20Sopenharmony_ci#define WL12XX_INTR_TRIG_EVENT_ACK	BIT(1)
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci/*===============================================
4968c2ecf20Sopenharmony_ci  HI_CFG Interface Configuration Register Values
4978c2ecf20Sopenharmony_ci  ------------------------------------------
4988c2ecf20Sopenharmony_ci  ===============================================*/
4998c2ecf20Sopenharmony_ci#define HI_CFG_UART_ENABLE          0x00000004
5008c2ecf20Sopenharmony_ci#define HI_CFG_RST232_ENABLE        0x00000008
5018c2ecf20Sopenharmony_ci#define HI_CFG_CLOCK_REQ_SELECT     0x00000010
5028c2ecf20Sopenharmony_ci#define HI_CFG_HOST_INT_ENABLE      0x00000020
5038c2ecf20Sopenharmony_ci#define HI_CFG_VLYNQ_OUTPUT_ENABLE  0x00000040
5048c2ecf20Sopenharmony_ci#define HI_CFG_HOST_INT_ACTIVE_LOW  0x00000080
5058c2ecf20Sopenharmony_ci#define HI_CFG_UART_TX_OUT_GPIO_15  0x00000100
5068c2ecf20Sopenharmony_ci#define HI_CFG_UART_TX_OUT_GPIO_14  0x00000200
5078c2ecf20Sopenharmony_ci#define HI_CFG_UART_TX_OUT_GPIO_7   0x00000400
5088c2ecf20Sopenharmony_ci
5098c2ecf20Sopenharmony_ci#define HI_CFG_DEF_VAL              \
5108c2ecf20Sopenharmony_ci	(HI_CFG_UART_ENABLE |        \
5118c2ecf20Sopenharmony_ci	HI_CFG_RST232_ENABLE |      \
5128c2ecf20Sopenharmony_ci	HI_CFG_CLOCK_REQ_SELECT |   \
5138c2ecf20Sopenharmony_ci	HI_CFG_HOST_INT_ENABLE)
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ci#define WL127X_REG_FUSE_DATA_2_1	0x050a
5168c2ecf20Sopenharmony_ci#define WL128X_REG_FUSE_DATA_2_1	0x2152
5178c2ecf20Sopenharmony_ci#define PG_VER_MASK			0x3c
5188c2ecf20Sopenharmony_ci#define PG_VER_OFFSET			2
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_ci#define WL127X_PG_MAJOR_VER_MASK	0x3
5218c2ecf20Sopenharmony_ci#define WL127X_PG_MAJOR_VER_OFFSET	0x0
5228c2ecf20Sopenharmony_ci#define WL127X_PG_MINOR_VER_MASK	0xc
5238c2ecf20Sopenharmony_ci#define WL127X_PG_MINOR_VER_OFFSET	0x2
5248c2ecf20Sopenharmony_ci
5258c2ecf20Sopenharmony_ci#define WL128X_PG_MAJOR_VER_MASK	0xc
5268c2ecf20Sopenharmony_ci#define WL128X_PG_MAJOR_VER_OFFSET	0x2
5278c2ecf20Sopenharmony_ci#define WL128X_PG_MINOR_VER_MASK	0x3
5288c2ecf20Sopenharmony_ci#define WL128X_PG_MINOR_VER_OFFSET	0x0
5298c2ecf20Sopenharmony_ci
5308c2ecf20Sopenharmony_ci#define WL127X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL127X_PG_MAJOR_VER_MASK) >> \
5318c2ecf20Sopenharmony_ci				     WL127X_PG_MAJOR_VER_OFFSET)
5328c2ecf20Sopenharmony_ci#define WL127X_PG_GET_MINOR(pg_ver) ((pg_ver & WL127X_PG_MINOR_VER_MASK) >> \
5338c2ecf20Sopenharmony_ci				     WL127X_PG_MINOR_VER_OFFSET)
5348c2ecf20Sopenharmony_ci#define WL128X_PG_GET_MAJOR(pg_ver) ((pg_ver & WL128X_PG_MAJOR_VER_MASK) >> \
5358c2ecf20Sopenharmony_ci				     WL128X_PG_MAJOR_VER_OFFSET)
5368c2ecf20Sopenharmony_ci#define WL128X_PG_GET_MINOR(pg_ver) ((pg_ver & WL128X_PG_MINOR_VER_MASK) >> \
5378c2ecf20Sopenharmony_ci				     WL128X_PG_MINOR_VER_OFFSET)
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci#define WL12XX_REG_FUSE_BD_ADDR_1	0x00310eb4
5408c2ecf20Sopenharmony_ci#define WL12XX_REG_FUSE_BD_ADDR_2	0x00310eb8
5418c2ecf20Sopenharmony_ci
5428c2ecf20Sopenharmony_ci#endif
543