/* SPDX-License-Identifier: GPL-2.0-only */ /* * This file is part of wl12xx * * Copyright (C) 1998-2009 Texas Instruments. All rights reserved. * Copyright (C) 2009 Nokia Corporation * * Contact: Luciano Coelho <[email protected]> */ #ifndef __REG_H__ #define __REG_H__ #include <linux/bitops.h> #define REGISTERS_BASE … #define DRPW_BASE … #define REGISTERS_DOWN_SIZE … #define REGISTERS_WORK_SIZE … #define FW_STATUS_ADDR … /*=============================================== Host Software Reset - 32bit RW ------------------------------------------ [31:1] Reserved 0 SOFT_RESET Soft Reset - When this bit is set, it holds the Wlan hardware in a soft reset state. This reset disables all MAC and baseband processor clocks except the CardBus/PCI interface clock. It also initializes all MAC state machines except the host interface. It does not reload the contents of the EEPROM. When this bit is cleared (not self-clearing), the Wlan hardware exits the software reset state. ===============================================*/ #define WL12XX_SLV_SOFT_RESET … #define WL1271_SLV_REG_DATA … #define WL1271_SLV_REG_ADATA … #define WL1271_SLV_MEM_DATA … #define WL12XX_REG_INTERRUPT_TRIG … #define WL12XX_REG_INTERRUPT_TRIG_H … /*============================================= Host Interrupt Mask Register - 32bit (RW) ------------------------------------------ Setting a bit in this register masks the corresponding interrupt to the host. 0 - RX0 - Rx first dubble buffer Data Interrupt 1 - TXD - Tx Data Interrupt 2 - TXXFR - Tx Transfer Interrupt 3 - RX1 - Rx second dubble buffer Data Interrupt 4 - RXXFR - Rx Transfer Interrupt 5 - EVENT_A - Event Mailbox interrupt 6 - EVENT_B - Event Mailbox interrupt 7 - WNONHST - Wake On Host Interrupt 8 - TRACE_A - Debug Trace interrupt 9 - TRACE_B - Debug Trace interrupt 10 - CDCMP - Command Complete Interrupt 11 - 12 - 13 - 14 - ICOMP - Initialization Complete Interrupt 16 - SG SE - Soft Gemini - Sense enable interrupt 17 - SG SD - Soft Gemini - Sense disable interrupt 18 - - 19 - - 20 - - 21- - Default: 0x0001 *==============================================*/ #define WL12XX_REG_INTERRUPT_MASK … /*============================================= Host Interrupt Mask Set 16bit, (Write only) ------------------------------------------ Setting a bit in this register sets the corresponding bin in ACX_HINT_MASK register without effecting the mask state of other bits (0 = no effect). ==============================================*/ #define ACX_REG_HINT_MASK_SET … /*============================================= Host Interrupt Mask Clear 16bit,(Write only) ------------------------------------------ Setting a bit in this register clears the corresponding bin in ACX_HINT_MASK register without effecting the mask state of other bits (0 = no effect). =============================================*/ #define ACX_REG_HINT_MASK_CLR … /*============================================= Host Interrupt Status Nondestructive Read 16bit,(Read only) ------------------------------------------ The host can read this register to determine which interrupts are active. Reading this register doesn't effect its content. =============================================*/ #define WL12XX_REG_INTERRUPT_NO_CLEAR … /*============================================= Host Interrupt Status Clear on Read Register 16bit,(Read only) ------------------------------------------ The host can read this register to determine which interrupts are active. Reading this register clears it, thus making all interrupts inactive. ==============================================*/ #define ACX_REG_INTERRUPT_CLEAR … /*============================================= Host Interrupt Acknowledge Register 16bit,(Write only) ------------------------------------------ The host can set individual bits in this register to clear (acknowledge) the corresp. interrupt status bits in the HINT_STS_CLR and HINT_STS_ND registers, thus making the assotiated interrupt inactive. (0-no effect) ==============================================*/ #define WL12XX_REG_INTERRUPT_ACK … #define WL12XX_REG_RX_DRIVER_COUNTER … /* Device Configuration registers*/ #define SOR_CFG … /* Embedded ARM CPU Control */ /*=============================================== Halt eCPU - 32bit RW ------------------------------------------ 0 HALT_ECPU Halt Embedded CPU - This bit is the complement of bit 1 (MDATA2) in the SOR_CFG register. During a hardware reset, this bit holds the inverse of MDATA2. When downloading firmware from the host, set this bit (pull down MDATA2). The host clears this bit after downloading the firmware into zero-wait-state SSRAM. When loading firmware from Flash, clear this bit (pull up MDATA2) so that the eCPU can run the bootloader code in Flash HALT_ECPU eCPU State -------------------- 1 halt eCPU 0 enable eCPU ===============================================*/ #define WL12XX_REG_ECPU_CONTROL … #define WL12XX_HI_CFG … /*=============================================== EEPROM Burst Read Start - 32bit RW ------------------------------------------ [31:1] Reserved 0 ACX_EE_START - EEPROM Burst Read Start 0 Setting this bit starts a burst read from the external EEPROM. If this bit is set (after reset) before an EEPROM read/write, the burst read starts at EEPROM address 0. Otherwise, it starts at the address following the address of the previous access. TheWlan hardware hardware clears this bit automatically. Default: 0x00000000 *================================================*/ #define ACX_REG_EE_START … #define WL12XX_OCP_POR_CTR … #define WL12XX_OCP_DATA_WRITE … #define WL12XX_OCP_DATA_READ … #define WL12XX_OCP_CMD … #define WL12XX_HOST_WR_ACCESS … #define WL12XX_CHIP_ID_B … #define WL12XX_ENABLE … /* Power Management registers */ #define WL12XX_ELP_CFG_MODE … #define WL12XX_ELP_CMD … #define WL12XX_PLL_CAL_TIME … #define WL12XX_CLK_REQ_TIME … #define WL12XX_CLK_BUF_TIME … #define WL12XX_CFG_PLL_SYNC_CNT … /* Scratch Pad registers*/ #define WL12XX_SCR_PAD0 … #define WL12XX_SCR_PAD1 … #define WL12XX_SCR_PAD2 … #define WL12XX_SCR_PAD3 … #define WL12XX_SCR_PAD4 … #define WL12XX_SCR_PAD4_SET … #define WL12XX_SCR_PAD4_CLR … #define WL12XX_SCR_PAD5 … #define WL12XX_SCR_PAD5_SET … #define WL12XX_SCR_PAD5_CLR … #define WL12XX_SCR_PAD6 … #define WL12XX_SCR_PAD7 … #define WL12XX_SCR_PAD8 … #define WL12XX_SCR_PAD9 … /* Spare registers*/ #define WL12XX_SPARE_A1 … #define WL12XX_SPARE_A2 … #define WL12XX_SPARE_A3 … #define WL12XX_SPARE_A4 … #define WL12XX_SPARE_A5 … #define WL12XX_SPARE_A6 … #define WL12XX_SPARE_A7 … #define WL12XX_SPARE_A8 … #define WL12XX_SPARE_B1 … #define WL12XX_SPARE_B2 … #define WL12XX_SPARE_B3 … #define WL12XX_SPARE_B4 … #define WL12XX_SPARE_B5 … #define WL12XX_SPARE_B6 … #define WL12XX_SPARE_B7 … #define WL12XX_SPARE_B8 … #define WL12XX_PLL_PARAMETERS … #define WL12XX_WU_COUNTER_PAUSE … #define WL12XX_WELP_ARM_COMMAND … #define WL12XX_DRPW_SCRATCH_START … #define WL12XX_CMD_MBOX_ADDRESS … #define ACX_REG_EEPROM_START_BIT … /* Command/Information Mailbox Pointers */ /*=============================================== Command Mailbox Pointer - 32bit RW ------------------------------------------ This register holds the start address of the command mailbox located in the Wlan hardware memory. The host must read this pointer after a reset to find the location of the command mailbox. The Wlan hardware initializes the command mailbox pointer with the default address of the command mailbox. The command mailbox pointer is not valid until after the host receives the Init Complete interrupt from the Wlan hardware. ===============================================*/ #define WL12XX_REG_COMMAND_MAILBOX_PTR … /*=============================================== Information Mailbox Pointer - 32bit RW ------------------------------------------ This register holds the start address of the information mailbox located in the Wlan hardware memory. The host must read this pointer after a reset to find the location of the information mailbox. The Wlan hardware initializes the information mailbox pointer with the default address of the information mailbox. The information mailbox pointer is not valid until after the host receives the Init Complete interrupt from the Wlan hardware. ===============================================*/ #define WL12XX_REG_EVENT_MAILBOX_PTR … /*=============================================== EEPROM Read/Write Request 32bit RW ------------------------------------------ 1 EE_READ - EEPROM Read Request 1 - Setting this bit loads a single byte of data into the EE_DATA register from the EEPROM location specified in the EE_ADDR register. The Wlan hardware hardware clears this bit automatically. EE_DATA is valid when this bit is cleared. 0 EE_WRITE - EEPROM Write Request - Setting this bit writes a single byte of data from the EE_DATA register into the EEPROM location specified in the EE_ADDR register. The Wlan hardware hardware clears this bit automatically. *===============================================*/ #define ACX_EE_CTL_REG … #define EE_WRITE … #define EE_READ … /*=============================================== EEPROM Address - 32bit RW ------------------------------------------ This register specifies the address within the EEPROM from/to which to read/write data. ===============================================*/ #define ACX_EE_ADDR_REG … /*=============================================== EEPROM Data - 32bit RW ------------------------------------------ This register either holds the read 8 bits of data from the EEPROM or the write data to be written to the EEPROM. ===============================================*/ #define ACX_EE_DATA_REG … /*=============================================== EEPROM Base Address - 32bit RW ------------------------------------------ This register holds the upper nine bits [23:15] of the 24-bit Wlan hardware memory address for burst reads from EEPROM accesses. The EEPROM provides the lower 15 bits of this address. The MSB of the address from the EEPROM is ignored. ===============================================*/ #define ACX_EE_CFG … /*=============================================== GPIO Output Values -32bit, RW ------------------------------------------ [31:16] Reserved [15: 0] Specify the output values (at the output driver inputs) for GPIO[15:0], respectively. ===============================================*/ #define ACX_GPIO_OUT_REG … #define ACX_MAX_GPIO_LINES … /*=============================================== Contention window -32bit, RW ------------------------------------------ [31:26] Reserved [25:16] Max (0x3ff) [15:07] Reserved [06:00] Current contention window value - default is 0x1F ===============================================*/ #define ACX_CONT_WIND_CFG_REG … #define ACX_CONT_WIND_MIN_MASK … #define ACX_CONT_WIND_MAX … #define REF_FREQ_19_2 … #define REF_FREQ_26_0 … #define REF_FREQ_38_4 … #define REF_FREQ_40_0 … #define REF_FREQ_33_6 … #define REF_FREQ_NUM … #define LUT_PARAM_INTEGER_DIVIDER … #define LUT_PARAM_FRACTIONAL_DIVIDER … #define LUT_PARAM_ATTN_BB … #define LUT_PARAM_ALPHA_BB … #define LUT_PARAM_STOP_TIME_BB … #define LUT_PARAM_BB_PLL_LOOP_FILTER … #define LUT_PARAM_NUM … #define WL12XX_EEPROMLESS_IND … #define USE_EEPROM … #define NVS_DATA_BUNDARY_ALIGNMENT … /* Firmware image header size */ #define FW_HDR_SIZE … /****************************************************************************** CHANNELS, BAND & REG DOMAINS definitions ******************************************************************************/ #define SHORT_PREAMBLE_BIT … #define OFDM_RATE_BIT … #define PBCC_RATE_BIT … enum { … }; /****************************************************************************** Transmit-Descriptor RATE-SET field definitions... Define a new "Rate-Set" for TX path that incorporates the Rate & Modulation info into a single 16-bit field. TxdRateSet_t: b15 - Indicates Preamble type (1=SHORT, 0=LONG). Notes: Must be LONG (0) for 1Mbps rate. Does not apply (set to 0) for RevG-OFDM rates. b14 - Indicates PBCC encoding (1=PBCC, 0=not). Notes: Does not apply (set to 0) for rates 1 and 2 Mbps. Does not apply (set to 0) for RevG-OFDM rates. b13 - Unused (set to 0). b12-b0 - Supported Rate indicator bits as defined below. ******************************************************************************/ #define OCP_CMD_LOOP … #define OCP_CMD_WRITE … #define OCP_CMD_READ … #define OCP_READY_MASK … #define OCP_STATUS_MASK … #define OCP_STATUS_NO_RESP … #define OCP_STATUS_OK … #define OCP_STATUS_REQ_FAILED … #define OCP_STATUS_RESP_ERROR … #define OCP_REG_POLARITY … #define OCP_REG_CLK_TYPE … #define OCP_REG_CLK_POLARITY … #define OCP_REG_CLK_PULL … #define POLARITY_LOW … #define NO_PULL … #define FREF_CLK_TYPE_BITS … #define CLK_REQ_PRCM … #define FREF_CLK_POLARITY_BITS … #define CLK_REQ_OUTN_SEL … #define WU_COUNTER_PAUSE_VAL … /* PLL configuration algorithm for wl128x */ #define SYS_CLK_CFG_REG … /* Bit[0] - 0-TCXO, 1-FREF */ #define MCS_PLL_CLK_SEL_FREF … /* Bit[3:2] - 01-TCXO, 10-FREF */ #define WL_CLK_REQ_TYPE_FREF … #define WL_CLK_REQ_TYPE_PG2 … /* Bit[4] - 0-TCXO, 1-FREF */ #define PRCM_CM_EN_MUX_WLAN_FREF … #define TCXO_ILOAD_INT_REG … #define TCXO_CLK_DETECT_REG … #define TCXO_DET_FAILED … #define FREF_ILOAD_INT_REG … #define FREF_CLK_DETECT_REG … #define FREF_CLK_DETECT_FAIL … /* Use this reg for masking during driver access */ #define WL_SPARE_REG … #define WL_SPARE_VAL … /* Bit[6:5:3] - mask wl write SYS_CLK_CFG[8:5:2:4] */ #define WL_SPARE_MASK_8526 … #define PLL_LOCK_COUNTERS_REG … #define PLL_LOCK_COUNTERS_COEX … #define PLL_LOCK_COUNTERS_MCS … #define MCS_PLL_OVERRIDE_REG … #define MCS_PLL_CONFIG_REG … #define MCS_SEL_IN_FREQ_MASK … #define MCS_SEL_IN_FREQ_SHIFT … #define MCS_PLL_CONFIG_REG_VAL … #define MCS_PLL_ENABLE_HP … #define MCS_PLL_M_REG … #define MCS_PLL_N_REG … #define MCS_PLL_M_REG_VAL … #define MCS_PLL_N_REG_VAL … #define SDIO_IO_DS … /* SDIO/wSPI DS configuration values */ enum { … }; /* end PLL configuration algorithm for wl128x */ /* * Host Command Interrupt. Setting this bit masks * the interrupt that the host issues to inform * the FW that it has sent a command * to the Wlan hardware Command Mailbox. */ #define WL12XX_INTR_TRIG_CMD … /* * Host Event Acknowlegde Interrupt. The host * sets this bit to acknowledge that it received * the unsolicited information from the event * mailbox. */ #define WL12XX_INTR_TRIG_EVENT_ACK … /*=============================================== HI_CFG Interface Configuration Register Values ------------------------------------------ ===============================================*/ #define HI_CFG_UART_ENABLE … #define HI_CFG_RST232_ENABLE … #define HI_CFG_CLOCK_REQ_SELECT … #define HI_CFG_HOST_INT_ENABLE … #define HI_CFG_VLYNQ_OUTPUT_ENABLE … #define HI_CFG_HOST_INT_ACTIVE_LOW … #define HI_CFG_UART_TX_OUT_GPIO_15 … #define HI_CFG_UART_TX_OUT_GPIO_14 … #define HI_CFG_UART_TX_OUT_GPIO_7 … #define HI_CFG_DEF_VAL … #define WL127X_REG_FUSE_DATA_2_1 … #define WL128X_REG_FUSE_DATA_2_1 … #define PG_VER_MASK … #define PG_VER_OFFSET … #define WL127X_PG_MAJOR_VER_MASK … #define WL127X_PG_MAJOR_VER_OFFSET … #define WL127X_PG_MINOR_VER_MASK … #define WL127X_PG_MINOR_VER_OFFSET … #define WL128X_PG_MAJOR_VER_MASK … #define WL128X_PG_MAJOR_VER_OFFSET … #define WL128X_PG_MINOR_VER_MASK … #define WL128X_PG_MINOR_VER_OFFSET … #define WL127X_PG_GET_MAJOR(pg_ver) … #define WL127X_PG_GET_MINOR(pg_ver) … #define WL128X_PG_GET_MAJOR(pg_ver) … #define WL128X_PG_GET_MINOR(pg_ver) … #define WL12XX_REG_FUSE_BD_ADDR_1 … #define WL12XX_REG_FUSE_BD_ADDR_2 … #endif