xref: /linux/drivers/net/wireless/intel/iwlwifi/iwl-prph.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3f473a7fdSEmmanuel Grumbach  * Copyright (C) 2005-2014, 2018-2024 Intel Corporation
48e99ea8dSJohannes Berg  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
58e99ea8dSJohannes Berg  * Copyright (C) 2016 Intel Deutschland GmbH
68e99ea8dSJohannes Berg  */
7e705c121SKalle Valo #ifndef	__iwl_prph_h__
8e705c121SKalle Valo #define __iwl_prph_h__
9f3779f47SJohannes Berg #include <linux/bitfield.h>
10e705c121SKalle Valo 
11e705c121SKalle Valo /*
12e705c121SKalle Valo  * Registers in this file are internal, not PCI bus memory mapped.
13e705c121SKalle Valo  * Driver accesses these via HBUS_TARG_PRPH_* registers.
14e705c121SKalle Valo  */
15e705c121SKalle Valo #define PRPH_BASE	(0x00000)
16e705c121SKalle Valo #define PRPH_END	(0xFFFFF)
17e705c121SKalle Valo 
18e705c121SKalle Valo /* APMG (power management) constants */
19e705c121SKalle Valo #define APMG_BASE			(PRPH_BASE + 0x3000)
20e705c121SKalle Valo #define APMG_CLK_CTRL_REG		(APMG_BASE + 0x0000)
21e705c121SKalle Valo #define APMG_CLK_EN_REG			(APMG_BASE + 0x0004)
22e705c121SKalle Valo #define APMG_CLK_DIS_REG		(APMG_BASE + 0x0008)
23e705c121SKalle Valo #define APMG_PS_CTRL_REG		(APMG_BASE + 0x000c)
24e705c121SKalle Valo #define APMG_PCIDEV_STT_REG		(APMG_BASE + 0x0010)
25e705c121SKalle Valo #define APMG_RFKILL_REG			(APMG_BASE + 0x0014)
26e705c121SKalle Valo #define APMG_RTC_INT_STT_REG		(APMG_BASE + 0x001c)
27e705c121SKalle Valo #define APMG_RTC_INT_MSK_REG		(APMG_BASE + 0x0020)
28e705c121SKalle Valo #define APMG_DIGITAL_SVR_REG		(APMG_BASE + 0x0058)
29e705c121SKalle Valo #define APMG_ANALOG_SVR_REG		(APMG_BASE + 0x006C)
30e705c121SKalle Valo 
31e705c121SKalle Valo #define APMS_CLK_VAL_MRB_FUNC_MODE	(0x00000001)
32e705c121SKalle Valo #define APMG_CLK_VAL_DMA_CLK_RQT	(0x00000200)
33e705c121SKalle Valo #define APMG_CLK_VAL_BSM_CLK_RQT	(0x00000800)
34e705c121SKalle Valo 
35e705c121SKalle Valo #define APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS	(0x00400000)
36e705c121SKalle Valo #define APMG_PS_CTRL_VAL_RESET_REQ		(0x04000000)
37e705c121SKalle Valo #define APMG_PS_CTRL_MSK_PWR_SRC		(0x03000000)
38e705c121SKalle Valo #define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN		(0x00000000)
39e705c121SKalle Valo #define APMG_PS_CTRL_VAL_PWR_SRC_VAUX		(0x02000000)
40e705c121SKalle Valo #define APMG_SVR_VOLTAGE_CONFIG_BIT_MSK	(0x000001E0) /* bit 8:5 */
41e705c121SKalle Valo #define APMG_SVR_DIGITAL_VOLTAGE_1_32		(0x00000060)
42e705c121SKalle Valo 
43e705c121SKalle Valo #define APMG_PCIDEV_STT_VAL_PERSIST_DIS	(0x00000200)
44e705c121SKalle Valo #define APMG_PCIDEV_STT_VAL_L1_ACT_DIS	(0x00000800)
45e705c121SKalle Valo #define APMG_PCIDEV_STT_VAL_WAKE_ME	(0x00004000)
46e705c121SKalle Valo 
47e705c121SKalle Valo #define APMG_RTC_INT_STT_RFKILL		(0x10000000)
48e705c121SKalle Valo 
49e705c121SKalle Valo /* Device system time */
50e705c121SKalle Valo #define DEVICE_SYSTEM_TIME_REG 0xA0206C
51e705c121SKalle Valo 
52f4ca70efSGolan Ben-Ami /* Device NMI register and value for 8000 family and lower hw's */
53e705c121SKalle Valo #define DEVICE_SET_NMI_REG 0x00a01c30
54e705c121SKalle Valo #define DEVICE_SET_NMI_VAL_DRV BIT(7)
55f4ca70efSGolan Ben-Ami /* Device NMI register and value for 9000 family and above hw's */
56b9410b18SLiad Kaufman #define UREG_NIC_SET_NMI_DRIVER 0x00a05c10
579e8338adSJohannes Berg #define UREG_NIC_SET_NMI_DRIVER_NMI_FROM_DRIVER BIT(24)
58906d4eb8SJohannes Berg #define UREG_NIC_SET_NMI_DRIVER_RESET_HANDSHAKE (BIT(24) | BIT(25))
59e705c121SKalle Valo 
60e705c121SKalle Valo /* Shared registers (0x0..0x3ff, via target indirect or periphery */
61e705c121SKalle Valo #define SHR_BASE	0x00a10000
62e705c121SKalle Valo 
63e705c121SKalle Valo /* Shared GP1 register */
64e705c121SKalle Valo #define SHR_APMG_GP1_REG		0x01dc
65e705c121SKalle Valo #define SHR_APMG_GP1_REG_PRPH		(SHR_BASE + SHR_APMG_GP1_REG)
66e705c121SKalle Valo #define SHR_APMG_GP1_WF_XTAL_LP_EN	0x00000004
67e705c121SKalle Valo #define SHR_APMG_GP1_CHICKEN_BIT_SELECT	0x80000000
68e705c121SKalle Valo 
69e705c121SKalle Valo /* Shared DL_CFG register */
70e705c121SKalle Valo #define SHR_APMG_DL_CFG_REG			0x01c4
71e705c121SKalle Valo #define SHR_APMG_DL_CFG_REG_PRPH		(SHR_BASE + SHR_APMG_DL_CFG_REG)
72e705c121SKalle Valo #define SHR_APMG_DL_CFG_RTCS_CLK_SELECTOR_MSK	0x000000c0
73e705c121SKalle Valo #define SHR_APMG_DL_CFG_RTCS_CLK_INTERNAL_XTAL	0x00000080
74e705c121SKalle Valo #define SHR_APMG_DL_CFG_DL_CLOCK_POWER_UP	0x00000100
75e705c121SKalle Valo 
76e705c121SKalle Valo /* Shared APMG_XTAL_CFG register */
77e705c121SKalle Valo #define SHR_APMG_XTAL_CFG_REG		0x1c0
78e705c121SKalle Valo #define SHR_APMG_XTAL_CFG_XTAL_ON_REQ	0x80000000
79e705c121SKalle Valo 
80e705c121SKalle Valo /*
81e705c121SKalle Valo  * Device reset for family 8000
82e705c121SKalle Valo  * write to bit 24 in order to reset the CPU
83e705c121SKalle Valo */
84e705c121SKalle Valo #define RELEASE_CPU_RESET		(0x300C)
85e705c121SKalle Valo #define RELEASE_CPU_RESET_BIT		BIT(24)
86e705c121SKalle Valo 
87e705c121SKalle Valo /*****************************************************************************
88e705c121SKalle Valo  *                        7000/3000 series SHR DTS addresses                 *
89e705c121SKalle Valo  *****************************************************************************/
90e705c121SKalle Valo 
91e705c121SKalle Valo #define SHR_MISC_WFM_DTS_EN	(0x00a10024)
92e705c121SKalle Valo #define DTSC_CFG_MODE		(0x00a10604)
93e705c121SKalle Valo #define DTSC_VREF_AVG		(0x00a10648)
94e705c121SKalle Valo #define DTSC_VREF5_AVG		(0x00a1064c)
95e705c121SKalle Valo #define DTSC_CFG_MODE_PERIODIC	(0x2)
96e705c121SKalle Valo #define DTSC_PTAT_AVG		(0x00a10650)
97e705c121SKalle Valo 
98e705c121SKalle Valo 
99*7c8afa63SJohannes Berg /*
100e705c121SKalle Valo  * Tx Scheduler
101e705c121SKalle Valo  *
102e705c121SKalle Valo  * The Tx Scheduler selects the next frame to be transmitted, choosing TFDs
103e705c121SKalle Valo  * (Transmit Frame Descriptors) from up to 16 circular Tx queues resident in
104e705c121SKalle Valo  * host DRAM.  It steers each frame's Tx command (which contains the frame
105e705c121SKalle Valo  * data) into one of up to 7 prioritized Tx DMA FIFO channels within the
106e705c121SKalle Valo  * device.  A queue maps to only one (selectable by driver) Tx DMA channel,
107e705c121SKalle Valo  * but one DMA channel may take input from several queues.
108e705c121SKalle Valo  *
109e705c121SKalle Valo  * Tx DMA FIFOs have dedicated purposes.
110e705c121SKalle Valo  *
111e705c121SKalle Valo  * For 5000 series and up, they are used differently
112e705c121SKalle Valo  * (cf. iwl5000_default_queue_to_tx_fifo in iwl-5000.c):
113e705c121SKalle Valo  *
114e705c121SKalle Valo  * 0 -- EDCA BK (background) frames, lowest priority
115e705c121SKalle Valo  * 1 -- EDCA BE (best effort) frames, normal priority
116e705c121SKalle Valo  * 2 -- EDCA VI (video) frames, higher priority
117e705c121SKalle Valo  * 3 -- EDCA VO (voice) and management frames, highest priority
118e705c121SKalle Valo  * 4 -- unused
119e705c121SKalle Valo  * 5 -- unused
120e705c121SKalle Valo  * 6 -- unused
121e705c121SKalle Valo  * 7 -- Commands
122e705c121SKalle Valo  *
123e705c121SKalle Valo  * Driver should normally map queues 0-6 to Tx DMA/FIFO channels 0-6.
124e705c121SKalle Valo  * In addition, driver can map the remaining queues to Tx DMA/FIFO
125e705c121SKalle Valo  * channels 0-3 to support 11n aggregation via EDCA DMA channels.
126e705c121SKalle Valo  *
127e705c121SKalle Valo  * The driver sets up each queue to work in one of two modes:
128e705c121SKalle Valo  *
129e705c121SKalle Valo  * 1)  Scheduler-Ack, in which the scheduler automatically supports a
130e705c121SKalle Valo  *     block-ack (BA) window of up to 64 TFDs.  In this mode, each queue
131e705c121SKalle Valo  *     contains TFDs for a unique combination of Recipient Address (RA)
132e705c121SKalle Valo  *     and Traffic Identifier (TID), that is, traffic of a given
133e705c121SKalle Valo  *     Quality-Of-Service (QOS) priority, destined for a single station.
134e705c121SKalle Valo  *
135e705c121SKalle Valo  *     In scheduler-ack mode, the scheduler keeps track of the Tx status of
136e705c121SKalle Valo  *     each frame within the BA window, including whether it's been transmitted,
137e705c121SKalle Valo  *     and whether it's been acknowledged by the receiving station.  The device
138e705c121SKalle Valo  *     automatically processes block-acks received from the receiving STA,
139e705c121SKalle Valo  *     and reschedules un-acked frames to be retransmitted (successful
140e705c121SKalle Valo  *     Tx completion may end up being out-of-order).
141e705c121SKalle Valo  *
142e705c121SKalle Valo  *     The driver must maintain the queue's Byte Count table in host DRAM
143e705c121SKalle Valo  *     for this mode.
144e705c121SKalle Valo  *     This mode does not support fragmentation.
145e705c121SKalle Valo  *
146e705c121SKalle Valo  * 2)  FIFO (a.k.a. non-Scheduler-ACK), in which each TFD is processed in order.
147e705c121SKalle Valo  *     The device may automatically retry Tx, but will retry only one frame
148e705c121SKalle Valo  *     at a time, until receiving ACK from receiving station, or reaching
149e705c121SKalle Valo  *     retry limit and giving up.
150e705c121SKalle Valo  *
151e705c121SKalle Valo  *     The command queue (#4/#9) must use this mode!
152e705c121SKalle Valo  *     This mode does not require use of the Byte Count table in host DRAM.
153e705c121SKalle Valo  *
154e705c121SKalle Valo  * Driver controls scheduler operation via 3 means:
155e705c121SKalle Valo  * 1)  Scheduler registers
156e705c121SKalle Valo  * 2)  Shared scheduler data base in internal SRAM
157e705c121SKalle Valo  * 3)  Shared data in host DRAM
158e705c121SKalle Valo  *
159e705c121SKalle Valo  * Initialization:
160e705c121SKalle Valo  *
161e705c121SKalle Valo  * When loading, driver should allocate memory for:
162e705c121SKalle Valo  * 1)  16 TFD circular buffers, each with space for (typically) 256 TFDs.
163e705c121SKalle Valo  * 2)  16 Byte Count circular buffers in 16 KBytes contiguous memory
164e705c121SKalle Valo  *     (1024 bytes for each queue).
165e705c121SKalle Valo  *
166e705c121SKalle Valo  * After receiving "Alive" response from uCode, driver must initialize
167e705c121SKalle Valo  * the scheduler (especially for queue #4/#9, the command queue, otherwise
168e705c121SKalle Valo  * the driver can't issue commands!):
169e705c121SKalle Valo  */
170e705c121SKalle Valo #define SCD_MEM_LOWER_BOUND		(0x0000)
171e705c121SKalle Valo 
172*7c8afa63SJohannes Berg /*
173e705c121SKalle Valo  * Max Tx window size is the max number of contiguous TFDs that the scheduler
174e705c121SKalle Valo  * can keep track of at one time when creating block-ack chains of frames.
175e705c121SKalle Valo  * Note that "64" matches the number of ack bits in a block-ack packet.
176e705c121SKalle Valo  */
177e705c121SKalle Valo #define SCD_WIN_SIZE				64
178e705c121SKalle Valo #define SCD_FRAME_LIMIT				64
179e705c121SKalle Valo 
180e705c121SKalle Valo #define SCD_TXFIFO_POS_TID			(0)
181e705c121SKalle Valo #define SCD_TXFIFO_POS_RA			(4)
182e705c121SKalle Valo #define SCD_QUEUE_RA_TID_MAP_RATID_MSK	(0x01FF)
183e705c121SKalle Valo 
184e705c121SKalle Valo /* agn SCD */
185e705c121SKalle Valo #define SCD_QUEUE_STTS_REG_POS_TXF	(0)
186e705c121SKalle Valo #define SCD_QUEUE_STTS_REG_POS_ACTIVE	(3)
187e705c121SKalle Valo #define SCD_QUEUE_STTS_REG_POS_WSL	(4)
188e705c121SKalle Valo #define SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN (19)
189e705c121SKalle Valo #define SCD_QUEUE_STTS_REG_MSK		(0x017F0000)
190e705c121SKalle Valo 
191f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG1_CREDIT		(0x00FFFF00)
192f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG1_SUPER_CREDIT		(0xFF000000)
193f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG1_VAL(_n, _v)		FIELD_PREP(SCD_QUEUE_CTX_REG1_ ## _n, _v)
194f3779f47SJohannes Berg 
195f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG2_WIN_SIZE		(0x0000007F)
196f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG2_FRAME_LIMIT		(0x007F0000)
197f3779f47SJohannes Berg #define SCD_QUEUE_CTX_REG2_VAL(_n, _v)		FIELD_PREP(SCD_QUEUE_CTX_REG2_ ## _n, _v)
198f3779f47SJohannes Berg 
199e705c121SKalle Valo #define SCD_GP_CTRL_ENABLE_31_QUEUES		BIT(0)
200e705c121SKalle Valo #define SCD_GP_CTRL_AUTO_ACTIVE_MODE		BIT(18)
201e705c121SKalle Valo 
202e705c121SKalle Valo /* Context Data */
203e705c121SKalle Valo #define SCD_CONTEXT_MEM_LOWER_BOUND	(SCD_MEM_LOWER_BOUND + 0x600)
204e705c121SKalle Valo #define SCD_CONTEXT_MEM_UPPER_BOUND	(SCD_MEM_LOWER_BOUND + 0x6A0)
205e705c121SKalle Valo 
206e705c121SKalle Valo /* Tx status */
207e705c121SKalle Valo #define SCD_TX_STTS_MEM_LOWER_BOUND	(SCD_MEM_LOWER_BOUND + 0x6A0)
208e705c121SKalle Valo #define SCD_TX_STTS_MEM_UPPER_BOUND	(SCD_MEM_LOWER_BOUND + 0x7E0)
209e705c121SKalle Valo 
210e705c121SKalle Valo /* Translation Data */
211e705c121SKalle Valo #define SCD_TRANS_TBL_MEM_LOWER_BOUND	(SCD_MEM_LOWER_BOUND + 0x7E0)
212e705c121SKalle Valo #define SCD_TRANS_TBL_MEM_UPPER_BOUND	(SCD_MEM_LOWER_BOUND + 0x808)
213e705c121SKalle Valo 
214e705c121SKalle Valo #define SCD_CONTEXT_QUEUE_OFFSET(x)\
215e705c121SKalle Valo 	(SCD_CONTEXT_MEM_LOWER_BOUND + ((x) * 8))
216e705c121SKalle Valo 
217e705c121SKalle Valo #define SCD_TX_STTS_QUEUE_OFFSET(x)\
218e705c121SKalle Valo 	(SCD_TX_STTS_MEM_LOWER_BOUND + ((x) * 16))
219e705c121SKalle Valo 
220e705c121SKalle Valo #define SCD_TRANS_TBL_OFFSET_QUEUE(x) \
221e705c121SKalle Valo 	((SCD_TRANS_TBL_MEM_LOWER_BOUND + ((x) * 2)) & 0xfffc)
222e705c121SKalle Valo 
223e705c121SKalle Valo #define SCD_BASE			(PRPH_BASE + 0xa02c00)
224e705c121SKalle Valo 
225e705c121SKalle Valo #define SCD_SRAM_BASE_ADDR	(SCD_BASE + 0x0)
226e705c121SKalle Valo #define SCD_DRAM_BASE_ADDR	(SCD_BASE + 0x8)
227e705c121SKalle Valo #define SCD_AIT			(SCD_BASE + 0x0c)
228e705c121SKalle Valo #define SCD_TXFACT		(SCD_BASE + 0x10)
229e705c121SKalle Valo #define SCD_ACTIVE		(SCD_BASE + 0x14)
230e705c121SKalle Valo #define SCD_QUEUECHAIN_SEL	(SCD_BASE + 0xe8)
231e705c121SKalle Valo #define SCD_CHAINEXT_EN		(SCD_BASE + 0x244)
232e705c121SKalle Valo #define SCD_AGGR_SEL		(SCD_BASE + 0x248)
233e705c121SKalle Valo #define SCD_INTERRUPT_MASK	(SCD_BASE + 0x108)
234e705c121SKalle Valo #define SCD_GP_CTRL		(SCD_BASE + 0x1a8)
235e705c121SKalle Valo #define SCD_EN_CTRL		(SCD_BASE + 0x254)
236e705c121SKalle Valo 
237e705c121SKalle Valo /*********************** END TX SCHEDULER *************************************/
238e705c121SKalle Valo 
239e705c121SKalle Valo /* Oscillator clock */
240e705c121SKalle Valo #define OSC_CLK				(0xa04068)
241e705c121SKalle Valo #define OSC_CLK_FORCE_CONTROL		(0x8)
242e705c121SKalle Valo 
243e705c121SKalle Valo #define FH_UCODE_LOAD_STATUS		(0x1AF0)
244d6a2c5c7SSara Sharon 
245d6a2c5c7SSara Sharon /*
246d6a2c5c7SSara Sharon  * Replacing FH_UCODE_LOAD_STATUS
247d6a2c5c7SSara Sharon  * This register is writen by driver and is read by uCode during boot flow.
248d6a2c5c7SSara Sharon  * Note this address is cleared after MAC reset.
249d6a2c5c7SSara Sharon  */
250d6a2c5c7SSara Sharon #define UREG_UCODE_LOAD_STATUS		(0xa05c40)
251eda50cdeSSara Sharon #define UREG_CPU_INIT_RUN		(0xa05c44)
252d6a2c5c7SSara Sharon 
253e705c121SKalle Valo #define LMPM_SECURE_UCODE_LOAD_CPU1_HDR_ADDR	(0x1E78)
254e705c121SKalle Valo #define LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR	(0x1E7C)
255e705c121SKalle Valo 
256e705c121SKalle Valo #define LMPM_SECURE_CPU1_HDR_MEM_SPACE		(0x420000)
257e705c121SKalle Valo #define LMPM_SECURE_CPU2_HDR_MEM_SPACE		(0x420400)
258e705c121SKalle Valo 
259fa1f2b61SSara Sharon #define LMAC2_PRPH_OFFSET		(0x100000)
260fa1f2b61SSara Sharon 
261e705c121SKalle Valo /* Rx FIFO */
262e705c121SKalle Valo #define RXF_SIZE_ADDR			(0xa00c88)
263e705c121SKalle Valo #define RXF_RD_D_SPACE			(0xa00c40)
264e705c121SKalle Valo #define RXF_RD_WR_PTR			(0xa00c50)
265e705c121SKalle Valo #define RXF_RD_RD_PTR			(0xa00c54)
266e705c121SKalle Valo #define RXF_RD_FENCE_PTR		(0xa00c4c)
267e705c121SKalle Valo #define RXF_SET_FENCE_MODE		(0xa00c14)
268e705c121SKalle Valo #define RXF_LD_WR2FENCE		(0xa00c1c)
269e705c121SKalle Valo #define RXF_FIFO_RD_FENCE_INC		(0xa00c68)
270e705c121SKalle Valo #define RXF_SIZE_BYTE_CND_POS		(7)
271e705c121SKalle Valo #define RXF_SIZE_BYTE_CNT_MSK		(0x3ff << RXF_SIZE_BYTE_CND_POS)
272e705c121SKalle Valo #define RXF_DIFF_FROM_PREV		(0x200)
273ebfa7f8aSMordechay Goodstein #define RXF2C_DIFF_FROM_PREV		(0x4e00)
274e705c121SKalle Valo 
275e705c121SKalle Valo #define RXF_LD_FENCE_OFFSET_ADDR	(0xa00c10)
276e705c121SKalle Valo #define RXF_FIFO_RD_FENCE_ADDR		(0xa00c0c)
277e705c121SKalle Valo 
278e705c121SKalle Valo /* Tx FIFO */
279e705c121SKalle Valo #define TXF_FIFO_ITEM_CNT		(0xa00438)
280e705c121SKalle Valo #define TXF_WR_PTR			(0xa00414)
281e705c121SKalle Valo #define TXF_RD_PTR			(0xa00410)
282e705c121SKalle Valo #define TXF_FENCE_PTR			(0xa00418)
283e705c121SKalle Valo #define TXF_LOCK_FENCE			(0xa00424)
284e705c121SKalle Valo #define TXF_LARC_NUM			(0xa0043c)
285e705c121SKalle Valo #define TXF_READ_MODIFY_DATA		(0xa00448)
286e705c121SKalle Valo #define TXF_READ_MODIFY_ADDR		(0xa0044c)
287e705c121SKalle Valo 
2885b086414SGolan Ben-Ami /* UMAC Internal Tx Fifo */
2895b086414SGolan Ben-Ami #define TXF_CPU2_FIFO_ITEM_CNT		(0xA00538)
2905b086414SGolan Ben-Ami #define TXF_CPU2_WR_PTR		(0xA00514)
2915b086414SGolan Ben-Ami #define TXF_CPU2_RD_PTR		(0xA00510)
2925b086414SGolan Ben-Ami #define TXF_CPU2_FENCE_PTR		(0xA00518)
2935b086414SGolan Ben-Ami #define TXF_CPU2_LOCK_FENCE		(0xA00524)
2945b086414SGolan Ben-Ami #define TXF_CPU2_NUM			(0xA0053C)
2955b086414SGolan Ben-Ami #define TXF_CPU2_READ_MODIFY_DATA	(0xA00548)
2965b086414SGolan Ben-Ami #define TXF_CPU2_READ_MODIFY_ADDR	(0xA0054C)
2975b086414SGolan Ben-Ami 
298976f15a8SEmmanuel Grumbach /* Radio registers access */
299976f15a8SEmmanuel Grumbach #define RSP_RADIO_CMD			(0xa02804)
300976f15a8SEmmanuel Grumbach #define RSP_RADIO_RDDAT			(0xa02814)
301976f15a8SEmmanuel Grumbach #define RADIO_RSP_ADDR_POS		(6)
302976f15a8SEmmanuel Grumbach #define RADIO_RSP_RD_CMD		(3)
303976f15a8SEmmanuel Grumbach 
304ed0022daSJohannes Berg /* LTR control (Qu only) */
305ed0022daSJohannes Berg #define HPM_MAC_LTR_CSR			0xa0348c
306ed0022daSJohannes Berg #define HPM_MAC_LRT_ENABLE_ALL		0xf
307ed0022daSJohannes Berg /* also uses CSR_LTR_* for values */
308ed0022daSJohannes Berg #define HPM_UMAC_LTR			0xa03480
309ed0022daSJohannes Berg 
310e705c121SKalle Valo /* FW monitor */
311e705c121SKalle Valo #define MON_BUFF_SAMPLE_CTL		(0xa03c00)
31201f377dcSShahar S Matityahu #define MON_BUFF_BASE_ADDR		(0xa03c1c)
313e705c121SKalle Valo #define MON_BUFF_END_ADDR		(0xa03c40)
314e705c121SKalle Valo #define MON_BUFF_WRPTR			(0xa03c44)
315e705c121SKalle Valo #define MON_BUFF_CYCLE_CNT		(0xa03c48)
3167a14c23dSSara Sharon /* FW monitor family 8000 and on */
31701f377dcSShahar S Matityahu #define MON_BUFF_BASE_ADDR_VER2		(0xa03c1c)
3187a14c23dSSara Sharon #define MON_BUFF_END_ADDR_VER2		(0xa03c20)
3197a14c23dSSara Sharon #define MON_BUFF_WRPTR_VER2		(0xa03c24)
3207a14c23dSSara Sharon #define MON_BUFF_CYCLE_CNT_VER2		(0xa03c28)
3217a14c23dSSara Sharon #define MON_BUFF_SHIFT_VER2		(0x8)
322c88580e1SShahar S Matityahu /* FW monitor familiy AX210 and on */
323c88580e1SShahar S Matityahu #define DBGC_CUR_DBGBUF_BASE_ADDR_LSB		(0xd03c20)
324c88580e1SShahar S Matityahu #define DBGC_CUR_DBGBUF_BASE_ADDR_MSB		(0xd03c24)
325c88580e1SShahar S Matityahu #define DBGC_CUR_DBGBUF_STATUS			(0xd03c1c)
326c88580e1SShahar S Matityahu #define DBGC_DBGBUF_WRAP_AROUND			(0xd03c2c)
327c88580e1SShahar S Matityahu #define DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK	(0x00ffffff)
328593fae3eSShahar S Matityahu #define DBGC_CUR_DBGBUF_STATUS_IDX_MSK		(0x0f000000)
329e705c121SKalle Valo 
330e705c121SKalle Valo #define MON_DMARB_RD_CTL_ADDR		(0xa03c60)
331e705c121SKalle Valo #define MON_DMARB_RD_DATA_ADDR		(0xa03c5c)
332e705c121SKalle Valo 
333e705c121SKalle Valo #define DBGC_IN_SAMPLE			(0xa03c00)
334addce854SEmmanuel Grumbach #define DBGC_OUT_CTRL			(0xa03c0c)
335e705c121SKalle Valo 
336593fae3eSShahar S Matityahu /* M2S registers */
337593fae3eSShahar S Matityahu #define LDBG_M2S_BUF_WPTR			(0xa0476c)
338593fae3eSShahar S Matityahu #define LDBG_M2S_BUF_WRAP_CNT			(0xa04774)
339593fae3eSShahar S Matityahu #define LDBG_M2S_BUF_WPTR_VAL_MSK		(0x000fffff)
340593fae3eSShahar S Matityahu #define LDBG_M2S_BUF_WRAP_CNT_VAL_MSK		(0x000fffff)
341593fae3eSShahar S Matityahu 
342e705c121SKalle Valo /* enable the ID buf for read */
343e705c121SKalle Valo #define WFPM_PS_CTL_CLR			0xA0300C
344e705c121SKalle Valo #define WFMP_MAC_ADDR_0			0xA03080
345e705c121SKalle Valo #define WFMP_MAC_ADDR_1			0xA03084
346e705c121SKalle Valo #define LMPM_PMG_EN			0xA01CEC
347e705c121SKalle Valo #define RADIO_REG_SYS_MANUAL_DFT_0	0xAD4078
348e705c121SKalle Valo #define RFIC_REG_RD			0xAD0470
349e705c121SKalle Valo #define WFPM_CTRL_REG			0xA03030
3501f171f4fSMatti Gottlieb #define WFPM_OTP_CFG1_ADDR		0x00a03098
35165008777SRotem Saado #define WFPM_OTP_CFG1_IS_JACKET_BIT	BIT(5)
35265008777SRotem Saado #define WFPM_OTP_CFG1_IS_CDB_BIT	BIT(4)
35372904029SMukesh Sisodiya #define WFPM_OTP_BZ_BNJ_JACKET_BIT	5
35472904029SMukesh Sisodiya #define WFPM_OTP_BZ_BNJ_CDB_BIT		4
35572904029SMukesh Sisodiya #define WFPM_OTP_CFG1_IS_JACKET(_val)   (((_val) & 0x00000020) >> WFPM_OTP_BZ_BNJ_JACKET_BIT)
35672904029SMukesh Sisodiya #define WFPM_OTP_CFG1_IS_CDB(_val)      (((_val) & 0x00000010) >> WFPM_OTP_BZ_BNJ_CDB_BIT)
35772904029SMukesh Sisodiya 
3581f171f4fSMatti Gottlieb 
35982ea7966SSara Sharon #define WFPM_GP2			0xA030B4
36089639e06SMukesh Sisodiya 
36189639e06SMukesh Sisodiya /* DBGI SRAM Register details */
36289639e06SMukesh Sisodiya #define DBGI_SRAM_TARGET_ACCESS_RDATA_LSB		0x00A2E154
36389639e06SMukesh Sisodiya #define DBGI_SRAM_TARGET_ACCESS_RDATA_MSB		0x00A2E158
36434bc2778SRotem Saado #define DBGI_SRAM_FIFO_POINTERS				0x00A2E148
36534bc2778SRotem Saado #define DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK		0x00000FFF
36689639e06SMukesh Sisodiya 
367e705c121SKalle Valo enum {
368e705c121SKalle Valo 	WFPM_AUX_CTL_AUX_IF_MAC_OWNER_MSK	= 0x80000000,
369e705c121SKalle Valo };
370e705c121SKalle Valo 
371cc5470dfSShahar S Matityahu #define CNVI_AUX_MISC_CHIP			0xA200B0
372814cdd7cSMiri Korenblit #define CNVI_AUX_MISC_CHIP_MAC_STEP(_val)	(((_val) & 0xf000000) >> 24)
373814cdd7cSMiri Korenblit #define CNVI_AUX_MISC_CHIP_PROD_TYPE(_val)	((_val) & 0xfff)
37473c184e1SEmmanuel Grumbach #define CNVI_AUX_MISC_CHIP_PROD_TYPE_GL		0x910
375814cdd7cSMiri Korenblit #define CNVI_AUX_MISC_CHIP_PROD_TYPE_BZ_U	0x930
37673c184e1SEmmanuel Grumbach #define CNVI_AUX_MISC_CHIP_PROD_TYPE_BZ_I	0x900
37773c184e1SEmmanuel Grumbach #define CNVI_AUX_MISC_CHIP_PROD_TYPE_BZ_W	0x901
378814cdd7cSMiri Korenblit 
379cc5470dfSShahar S Matityahu #define CNVR_AUX_MISC_CHIP				0xA2B800
380cc5470dfSShahar S Matityahu #define CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM		0xA29890
381cc5470dfSShahar S Matityahu #define CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR	0xA29938
382b8133439SAvraham Stern #define CNVI_SCU_SEQ_DATA_DW9				0xA27488
383cc5470dfSShahar S Matityahu 
384de0c2cdcSJohannes Berg #define CNVI_PMU_STEP_FLOW				0xA2D588
385de0c2cdcSJohannes Berg #define CNVI_PMU_STEP_FLOW_FORCE_URM			BIT(2)
386de0c2cdcSJohannes Berg 
387e705c121SKalle Valo #define PREG_AUX_BUS_WPROT_0		0xA04CC0
38844f61b5cSShahar S Matityahu 
38944f61b5cSShahar S Matityahu /* device family 9000 WPROT register */
39044f61b5cSShahar S Matityahu #define PREG_PRPH_WPROT_9000		0xA04CE0
39144f61b5cSShahar S Matityahu /* device family 22000 WPROT register */
39244f61b5cSShahar S Matityahu #define PREG_PRPH_WPROT_22000		0xA04D00
39344f61b5cSShahar S Matityahu 
3945226cecbSMordechay Goodstein #define SB_MODIFY_CFG_FLAG		0xA03088
3953277baa9SJohannes Berg #define SB_CFG_RESIDES_IN_ROM		0x80
396e705c121SKalle Valo #define SB_CPU_1_STATUS			0xA01E30
397e705c121SKalle Valo #define SB_CPU_2_STATUS			0xA01E34
398d6be9c1dSSara Sharon #define UMAG_SB_CPU_1_STATUS		0xA038C0
399d6be9c1dSSara Sharon #define UMAG_SB_CPU_2_STATUS		0xA038C4
400f6586b69STzipi Peres #define UMAG_GEN_HW_STATUS		0xA038C8
40120f5aef5SJohannes Berg #define UREG_UMAC_CURRENT_PC		0xa05c18
40220f5aef5SJohannes Berg #define UREG_LMAC1_CURRENT_PC		0xa05c1c
40320f5aef5SJohannes Berg #define UREG_LMAC2_CURRENT_PC		0xa05c20
404f6586b69STzipi Peres 
405a7de31d5SMordechay Goodstein #define WFPM_LMAC1_PD_NOTIFICATION      0xa0338c
406a7de31d5SMordechay Goodstein #define WFPM_ARC1_PD_NOTIFICATION       0xa03044
407f2f17ca0SMordechay Goodstein #define HPM_SECONDARY_DEVICE_STATE      0xa03404
408184f10dbSMordechay Goodstein #define WFPM_MAC_OTP_CFG7_ADDR		0xa03338
409184f10dbSMordechay Goodstein #define WFPM_MAC_OTP_CFG7_DATA		0xa0333c
410f2f17ca0SMordechay Goodstein 
411a7de31d5SMordechay Goodstein 
412f6586b69STzipi Peres /* For UMAG_GEN_HW_STATUS reg check */
413f6586b69STzipi Peres enum {
414f6586b69STzipi Peres 	UMAG_GEN_HW_IS_FPGA = BIT(1),
415f6586b69STzipi Peres };
416e705c121SKalle Valo 
417e705c121SKalle Valo /* FW chicken bits */
418e705c121SKalle Valo #define LMPM_CHICK			0xA01FF8
419e705c121SKalle Valo enum {
420e705c121SKalle Valo 	LMPM_CHICK_EXTENDED_ADDR_SPACE = BIT(0),
421e705c121SKalle Valo };
422e705c121SKalle Valo 
423e705c121SKalle Valo /* FW chicken bits */
424e705c121SKalle Valo #define LMPM_PAGE_PASS_NOTIF			0xA03824
425e705c121SKalle Valo enum {
426e705c121SKalle Valo 	LMPM_PAGE_PASS_NOTIF_POS = BIT(20),
427e705c121SKalle Valo };
428e705c121SKalle Valo 
4291f171f4fSMatti Gottlieb /*
4301f171f4fSMatti Gottlieb  * CRF ID register
4311f171f4fSMatti Gottlieb  *
4321f171f4fSMatti Gottlieb  * type: bits 0-11
4331f171f4fSMatti Gottlieb  * reserved: bits 12-18
4341f171f4fSMatti Gottlieb  * slave_exist: bit 19
4351f171f4fSMatti Gottlieb  * dash: bits 20-23
4367dd7f99bSMukesh Sisodiya  * step: bits 24-27
4377dd7f99bSMukesh Sisodiya  * flavor: bits 28-31
4381f171f4fSMatti Gottlieb  */
4391f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE(val)		(((val) & 0x00000FFF) >> 0)
4401f171f4fSMatti Gottlieb #define REG_CRF_ID_SLAVE(val)		(((val) & 0x00080000) >> 19)
4411f171f4fSMatti Gottlieb #define REG_CRF_ID_DASH(val)		(((val) & 0x00F00000) >> 20)
4427dd7f99bSMukesh Sisodiya #define REG_CRF_ID_STEP(val)		(((val) & 0x0F000000) >> 24)
4437dd7f99bSMukesh Sisodiya #define REG_CRF_ID_FLAVOR(val)		(((val) & 0xF0000000) >> 28)
4441f171f4fSMatti Gottlieb 
4452e5d4a8fSHaim Dreyfuss #define UREG_CHICK		(0xA05C00)
44654f315cbSIdo Yariv #define UREG_CHICK_MSI_ENABLE	BIT(24)
4472e5d4a8fSHaim Dreyfuss #define UREG_CHICK_MSIX_ENABLE	BIT(25)
4488954e1ebSShahar S Matityahu 
4491f171f4fSMatti Gottlieb #define SD_REG_VER		0xa29600
4501f171f4fSMatti Gottlieb #define SD_REG_VER_GEN2		0x00a2b800
4511f171f4fSMatti Gottlieb 
4521f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_JF_1			0x201
4531f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_JF_2			0x202
4541f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_HR_CDB			0x503
4551f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_HR_NONE_CDB		0x504
4561f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_HR_NONE_CDB_1X1	0x501
4571f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_HR_NONE_CDB_CCP	0x532
4581f171f4fSMatti Gottlieb #define REG_CRF_ID_TYPE_GF			0x410
459af82c007SMatti Gottlieb #define REG_CRF_ID_TYPE_FM			0x910
460c513228cSMukesh Sisodiya #define REG_CRF_ID_TYPE_WHP			0xA10
4611f171f4fSMatti Gottlieb 
4628954e1ebSShahar S Matityahu #define HPM_DEBUG			0xA03440
4638954e1ebSShahar S Matityahu #define PERSISTENCE_BIT			BIT(12)
4648954e1ebSShahar S Matityahu #define PREG_WFPM_ACCESS		BIT(12)
465c8177fedSShaul Triebitz 
4669a47cb98SLuca Coelho #define HPM_HIPM_GEN_CFG			0xA03458
4679a47cb98SLuca Coelho #define HPM_HIPM_GEN_CFG_CR_PG_EN		BIT(0)
4689a47cb98SLuca Coelho #define HPM_HIPM_GEN_CFG_CR_SLP_EN		BIT(1)
4699a47cb98SLuca Coelho #define HPM_HIPM_GEN_CFG_CR_FORCE_ACTIVE	BIT(10)
4709a47cb98SLuca Coelho 
471c8177fedSShaul Triebitz #define UREG_DOORBELL_TO_ISR6		0xA05C04
472c8177fedSShaul Triebitz #define UREG_DOORBELL_TO_ISR6_NMI_BIT	BIT(0)
473906d4eb8SJohannes Berg #define UREG_DOORBELL_TO_ISR6_RESET_HANDSHAKE (BIT(0) | BIT(1))
474e5f3f215SHaim Dreyfuss #define UREG_DOORBELL_TO_ISR6_SUSPEND	BIT(18)
475e5f3f215SHaim Dreyfuss #define UREG_DOORBELL_TO_ISR6_RESUME	BIT(19)
47670d3ca86SLuca Coelho #define UREG_DOORBELL_TO_ISR6_PNVM	BIT(20)
477cc5470dfSShahar S Matityahu 
478af08571dSHaim Dreyfuss /*
479af08571dSHaim Dreyfuss  * From BZ family driver triggers this bit for suspend and resume
480af08571dSHaim Dreyfuss  * The driver should update CSR_IPC_SLEEP_CONTROL before triggering
481af08571dSHaim Dreyfuss  * this interrupt with suspend/resume value
482af08571dSHaim Dreyfuss  */
483af08571dSHaim Dreyfuss #define UREG_DOORBELL_TO_ISR6_SLEEP_CTRL	BIT(31)
484af08571dSHaim Dreyfuss 
485aa899e68SJohannes Berg #define CNVI_MBOX_C			0xA3400C
486aa899e68SJohannes Berg 
487cc5470dfSShahar S Matityahu #define FSEQ_ERROR_CODE			0xA340C8
488cc5470dfSShahar S Matityahu #define FSEQ_TOP_INIT_VERSION		0xA34038
489cc5470dfSShahar S Matityahu #define FSEQ_CNVIO_INIT_VERSION		0xA3403C
490cc5470dfSShahar S Matityahu #define FSEQ_OTP_VERSION		0xA340FC
491cc5470dfSShahar S Matityahu #define FSEQ_TOP_CONTENT_VERSION	0xA340F4
492cc5470dfSShahar S Matityahu #define FSEQ_ALIVE_TOKEN		0xA340F0
493cc5470dfSShahar S Matityahu #define FSEQ_CNVI_ID			0xA3408C
494cc5470dfSShahar S Matityahu #define FSEQ_CNVR_ID			0xA34090
495c53c339dSAriel Malamud #define FSEQ_PREV_CNVIO_INIT_VERSION	0xA34084
496c53c339dSAriel Malamud #define FSEQ_WIFI_FSEQ_VERSION		0xA34040
497c53c339dSAriel Malamud #define FSEQ_BT_FSEQ_VERSION		0xA34044
498c53c339dSAriel Malamud #define FSEQ_CLASS_TP_VERSION		0xA34078
499e5f3f215SHaim Dreyfuss 
500e5f3f215SHaim Dreyfuss #define IWL_D3_SLEEP_STATUS_SUSPEND	0xD3
501e5f3f215SHaim Dreyfuss #define IWL_D3_SLEEP_STATUS_RESUME	0xD0
502b34872bcSMordechay Goodstein 
503b34872bcSMordechay Goodstein #define WMAL_INDRCT_RD_CMD1_OPMOD_POS 28
504b34872bcSMordechay Goodstein #define WMAL_INDRCT_RD_CMD1_BYTE_ADDRESS_MSK 0xFFFFF
505b34872bcSMordechay Goodstein #define WMAL_CMD_READ_BURST_ACCESS 2
506b34872bcSMordechay Goodstein #define WMAL_MRSPF_1 0xADFC20
507b34872bcSMordechay Goodstein #define WMAL_INDRCT_RD_CMD1 0xADFD44
508b34872bcSMordechay Goodstein #define WMAL_INDRCT_CMD1 0xADFC14
509b34872bcSMordechay Goodstein #define WMAL_INDRCT_CMD(addr) \
510b34872bcSMordechay Goodstein 	((WMAL_CMD_READ_BURST_ACCESS << WMAL_INDRCT_RD_CMD1_OPMOD_POS) | \
511b34872bcSMordechay Goodstein 	 ((addr) & WMAL_INDRCT_RD_CMD1_BYTE_ADDRESS_MSK))
512b34872bcSMordechay Goodstein 
513b34872bcSMordechay Goodstein #define WFPM_LMAC1_PS_CTL_RW 0xA03380
514b34872bcSMordechay Goodstein #define WFPM_LMAC2_PS_CTL_RW 0xA033C0
515b34872bcSMordechay Goodstein #define WFPM_PS_CTL_RW_PHYRF_PD_FSM_CURSTATE_MSK 0x0000000F
516b34872bcSMordechay Goodstein #define WFPM_PHYRF_STATE_ON 5
517b34872bcSMordechay Goodstein #define HBUS_TIMEOUT 0xA5A5A5A1
518b34872bcSMordechay Goodstein #define WFPM_DPHY_OFF 0xDF10FF
519b34872bcSMordechay Goodstein 
5203ea839c1SLuca Coelho #define REG_OTP_MINOR 0xA0333C
5213ea839c1SLuca Coelho 
522733eb54fSAvraham Stern #define WFPM_LMAC2_PD_NOTIFICATION 0xA033CC
523733eb54fSAvraham Stern #define WFPM_LMAC2_PD_RE_READ BIT(31)
524733eb54fSAvraham Stern 
525a634386cSDaniel Gabay #define DPHYIP_INDIRECT			0xA2D800
526a634386cSDaniel Gabay #define DPHYIP_INDIRECT_RD_MSK		0xFF000000
527a634386cSDaniel Gabay #define DPHYIP_INDIRECT_RD_SHIFT	24
528a634386cSDaniel Gabay 
529e705c121SKalle Valo #endif				/* __iwl_prph_h__ */
530