18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3a451b823SMukesh Sisodiya  * Copyright (C) 2018-2021 Intel Corporation
48e99ea8dSJohannes Berg  */
5bd294466SSara Sharon #ifndef __iwl_fw_dbg_tlv_h__
6bd294466SSara Sharon #define __iwl_fw_dbg_tlv_h__
7bd294466SSara Sharon 
8bd294466SSara Sharon #include <linux/bitops.h>
9bd294466SSara Sharon 
10b87384afSShahar S Matityahu #define IWL_FW_INI_MAX_REGION_ID		64
11b87384afSShahar S Matityahu #define IWL_FW_INI_MAX_NAME			32
12677d25b2SShahar S Matityahu #define IWL_FW_INI_MAX_CFG_NAME			64
13cf29c5b6SShahar S Matityahu #define IWL_FW_INI_DOMAIN_ALWAYS_ON		0
14a451b823SMukesh Sisodiya #define IWL_FW_INI_REGION_V2_MASK		0x0000FFFF
15fe63f21bSShahar S Matityahu 
16fe63f21bSShahar S Matityahu /**
17fe63f21bSShahar S Matityahu  * struct iwl_fw_ini_hcmd
18bd294466SSara Sharon  *
19bd294466SSara Sharon  * @id: the debug configuration command type for instance: 0xf6 / 0xf5 / DHC
20bd294466SSara Sharon  * @group: the desired cmd group
21fe63f21bSShahar S Matityahu  * @reserved: to align to FW struct
22fe63f21bSShahar S Matityahu  * @data: all of the relevant command data to be sent
23bd294466SSara Sharon  */
24bd294466SSara Sharon struct iwl_fw_ini_hcmd {
25bd294466SSara Sharon 	u8 id;
26bd294466SSara Sharon 	u8 group;
27fe63f21bSShahar S Matityahu 	__le16 reserved;
28bd294466SSara Sharon 	u8 data[0];
29fe63f21bSShahar S Matityahu } __packed; /* FW_DEBUG_TLV_HCMD_DATA_API_S_VER_1 */
30bd294466SSara Sharon 
31bd294466SSara Sharon /**
32a9248de4SShahar S Matityahu  * struct iwl_fw_ini_header - Common Header for all ini debug TLV's structures
33fe63f21bSShahar S Matityahu  *
34a9248de4SShahar S Matityahu  * @version: TLV version
35a9248de4SShahar S Matityahu  * @domain: domain of the TLV. One of &enum iwl_fw_ini_dbg_domain
36bd294466SSara Sharon  */
37a9248de4SShahar S Matityahu struct iwl_fw_ini_header {
38a9248de4SShahar S Matityahu 	__le32 version;
39fe63f21bSShahar S Matityahu 	__le32 domain;
40394f4192SJohannes Berg 	/* followed by the data */
41a9248de4SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_HEADER_S_VER_1 */
42bd294466SSara Sharon 
43bd294466SSara Sharon /**
44c9fe75e9SShahar S Matityahu  * struct iwl_fw_ini_region_dev_addr - Configuration to read device addresses
45fe63f21bSShahar S Matityahu  *
46c9fe75e9SShahar S Matityahu  * @size: size of each memory chunk
47c9fe75e9SShahar S Matityahu  * @offset: offset to add to the base address of each chunk
48c9fe75e9SShahar S Matityahu  */
49c9fe75e9SShahar S Matityahu struct iwl_fw_ini_region_dev_addr {
50c9fe75e9SShahar S Matityahu 	__le32 size;
51c9fe75e9SShahar S Matityahu 	__le32 offset;
52c9fe75e9SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_DEVICE_ADDR_API_S_VER_1 */
53c9fe75e9SShahar S Matityahu 
54c9fe75e9SShahar S Matityahu /**
55c9fe75e9SShahar S Matityahu  * struct iwl_fw_ini_region_fifos - Configuration to read Tx/Rx fifos
56c9fe75e9SShahar S Matityahu  *
57c9fe75e9SShahar S Matityahu  * @fid: fifos ids array. Used to determine what fifos to collect
58c9fe75e9SShahar S Matityahu  * @hdr_only: if non zero, collect only the registers
59c9fe75e9SShahar S Matityahu  * @offset: offset to add to the registers addresses
60c9fe75e9SShahar S Matityahu  */
61c9fe75e9SShahar S Matityahu struct iwl_fw_ini_region_fifos {
62c9fe75e9SShahar S Matityahu 	__le32 fid[2];
63c9fe75e9SShahar S Matityahu 	__le32 hdr_only;
64c9fe75e9SShahar S Matityahu 	__le32 offset;
65c9fe75e9SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_REGION_FIFOS_API_S_VER_1 */
66c9fe75e9SShahar S Matityahu 
67c9fe75e9SShahar S Matityahu /**
68c9fe75e9SShahar S Matityahu  * struct iwl_fw_ini_region_err_table - error table region data
69c9fe75e9SShahar S Matityahu  *
70c9fe75e9SShahar S Matityahu  * Configuration to read Umac/Lmac error table
71c9fe75e9SShahar S Matityahu  *
72c9fe75e9SShahar S Matityahu  * @version: version of the error table
73c9fe75e9SShahar S Matityahu  * @base_addr: base address of the error table
74c9fe75e9SShahar S Matityahu  * @size: size of the error table
75c9fe75e9SShahar S Matityahu  * @offset: offset to add to &base_addr
76c9fe75e9SShahar S Matityahu  */
77c9fe75e9SShahar S Matityahu struct iwl_fw_ini_region_err_table {
78c9fe75e9SShahar S Matityahu 	__le32 version;
79c9fe75e9SShahar S Matityahu 	__le32 base_addr;
80c9fe75e9SShahar S Matityahu 	__le32 size;
81c9fe75e9SShahar S Matityahu 	__le32 offset;
82c9fe75e9SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_REGION_ERROR_TABLE_API_S_VER_1 */
83c9fe75e9SShahar S Matityahu 
84c9fe75e9SShahar S Matityahu /**
85ba8f6f4aSMordechay Goodstein  * struct iwl_fw_ini_region_special_device_memory - special device memory
86ba8f6f4aSMordechay Goodstein  *
87ba8f6f4aSMordechay Goodstein  * Configuration to read a special memory
88ba8f6f4aSMordechay Goodstein  *
89ba8f6f4aSMordechay Goodstein  * @type: type of the special memory
90ba8f6f4aSMordechay Goodstein  * @version: version of the special memory
91ba8f6f4aSMordechay Goodstein  * @base_addr: base address of the error table
92ba8f6f4aSMordechay Goodstein  * @size: size of the error table
93ba8f6f4aSMordechay Goodstein  * @offset: offset to add to &base_addr
94ba8f6f4aSMordechay Goodstein  */
95ba8f6f4aSMordechay Goodstein struct iwl_fw_ini_region_special_device_memory {
96ba8f6f4aSMordechay Goodstein 	__le16 type;
97ba8f6f4aSMordechay Goodstein 	__le16 version;
98ba8f6f4aSMordechay Goodstein 	__le32 base_addr;
99ba8f6f4aSMordechay Goodstein 	__le32 size;
100ba8f6f4aSMordechay Goodstein 	__le32 offset;
101ba8f6f4aSMordechay Goodstein } __packed; /* FW_TLV_DEBUG_REGION_SPECIAL_DEVICE_ADDR_API_S_VER_1 */
102ba8f6f4aSMordechay Goodstein 
103ba8f6f4aSMordechay Goodstein /**
104c9fe75e9SShahar S Matityahu  * struct iwl_fw_ini_region_internal_buffer - internal buffer region data
105c9fe75e9SShahar S Matityahu  *
106c9fe75e9SShahar S Matityahu  * Configuration to read internal monitor buffer
107c9fe75e9SShahar S Matityahu  *
108c9fe75e9SShahar S Matityahu  * @alloc_id: allocation id one of &enum iwl_fw_ini_allocation_id
109c9fe75e9SShahar S Matityahu  * @base_addr: internal buffer base address
110c9fe75e9SShahar S Matityahu  * @size: size internal buffer size
111c9fe75e9SShahar S Matityahu  */
112c9fe75e9SShahar S Matityahu struct iwl_fw_ini_region_internal_buffer {
113c9fe75e9SShahar S Matityahu 	__le32 alloc_id;
114c9fe75e9SShahar S Matityahu 	__le32 base_addr;
115c9fe75e9SShahar S Matityahu 	__le32 size;
116c9fe75e9SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_REGION_INTERNAL_BUFFER_API_S_VER_1 */
117c9fe75e9SShahar S Matityahu 
118c9fe75e9SShahar S Matityahu /**
119c9fe75e9SShahar S Matityahu  * struct iwl_fw_ini_region_tlv - region TLV
120c9fe75e9SShahar S Matityahu  *
121c9fe75e9SShahar S Matityahu  * Configures parameters for region data collection
122c9fe75e9SShahar S Matityahu  *
123c9fe75e9SShahar S Matityahu  * @hdr: debug header
124c9fe75e9SShahar S Matityahu  * @id: region id. Max id is &IWL_FW_INI_MAX_REGION_ID
125c9fe75e9SShahar S Matityahu  * @type: region type. One of &enum iwl_fw_ini_region_type
126c9fe75e9SShahar S Matityahu  * @name: region name
127c9fe75e9SShahar S Matityahu  * @dev_addr: device address configuration. Used by
128c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_DEVICE_MEMORY, &IWL_FW_INI_REGION_PERIPHERY_MAC,
129c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_PERIPHERY_PHY, &IWL_FW_INI_REGION_PERIPHERY_AUX,
130c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_PAGING, &IWL_FW_INI_REGION_CSR,
131c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_DRAM_IMR and &IWL_FW_INI_REGION_PCI_IOSF_CONFIG
132*89639e06SMukesh Sisodiya  *	&IWL_FW_INI_REGION_DBGI_SRAM, &FW_TLV_DEBUG_REGION_TYPE_DBGI_SRAM,
133c9fe75e9SShahar S Matityahu  * @fifos: fifos configuration. Used by &IWL_FW_INI_REGION_TXF and
134c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_RXF
135c9fe75e9SShahar S Matityahu  * @err_table: error table configuration. Used by
136c9fe75e9SShahar S Matityahu  *	IWL_FW_INI_REGION_LMAC_ERROR_TABLE and
137c9fe75e9SShahar S Matityahu  *	IWL_FW_INI_REGION_UMAC_ERROR_TABLE
138c9fe75e9SShahar S Matityahu  * @internal_buffer: internal monitor buffer configuration. Used by
139c9fe75e9SShahar S Matityahu  *	&IWL_FW_INI_REGION_INTERNAL_BUFFER
140c9fe75e9SShahar S Matityahu  * @dram_alloc_id: dram allocation id. One of &enum iwl_fw_ini_allocation_id.
141c9fe75e9SShahar S Matityahu  *	Used by &IWL_FW_INI_REGION_DRAM_BUFFER
142c9fe75e9SShahar S Matityahu  * @tlv_mask: tlv collection mask. Used by &IWL_FW_INI_REGION_TLV
143c9fe75e9SShahar S Matityahu  * @addrs: array of addresses attached to the end of the region tlv
144bd294466SSara Sharon  */
145bd294466SSara Sharon struct iwl_fw_ini_region_tlv {
146c9fe75e9SShahar S Matityahu 	struct iwl_fw_ini_header hdr;
147c9fe75e9SShahar S Matityahu 	__le32 id;
148c9fe75e9SShahar S Matityahu 	__le32 type;
149c9fe75e9SShahar S Matityahu 	u8 name[IWL_FW_INI_MAX_NAME];
150c9fe75e9SShahar S Matityahu 	union {
151c9fe75e9SShahar S Matityahu 		struct iwl_fw_ini_region_dev_addr dev_addr;
152c9fe75e9SShahar S Matityahu 		struct iwl_fw_ini_region_fifos fifos;
153c9fe75e9SShahar S Matityahu 		struct iwl_fw_ini_region_err_table err_table;
154c9fe75e9SShahar S Matityahu 		struct iwl_fw_ini_region_internal_buffer internal_buffer;
155ba8f6f4aSMordechay Goodstein 		struct iwl_fw_ini_region_special_device_memory special_mem;
156c9fe75e9SShahar S Matityahu 		__le32 dram_alloc_id;
157c9fe75e9SShahar S Matityahu 		__le32 tlv_mask;
158c9fe75e9SShahar S Matityahu 	}; /* FW_TLV_DEBUG_REGION_CONF_PARAMS_API_U_VER_1 */
159c9fe75e9SShahar S Matityahu 	__le32 addrs[];
160c9fe75e9SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_REGION_API_S_VER_1 */
161bd294466SSara Sharon 
162bd294466SSara Sharon /**
163677d25b2SShahar S Matityahu  * struct iwl_fw_ini_debug_info_tlv
164677d25b2SShahar S Matityahu  *
165677d25b2SShahar S Matityahu  * debug configuration name for a specific image
166677d25b2SShahar S Matityahu  *
167677d25b2SShahar S Matityahu  * @hdr: debug header
168677d25b2SShahar S Matityahu  * @image_type: image type
169677d25b2SShahar S Matityahu  * @debug_cfg_name: debug configuration name
170677d25b2SShahar S Matityahu  */
171677d25b2SShahar S Matityahu struct iwl_fw_ini_debug_info_tlv {
172677d25b2SShahar S Matityahu 	struct iwl_fw_ini_header hdr;
173677d25b2SShahar S Matityahu 	__le32 image_type;
174677d25b2SShahar S Matityahu 	u8 debug_cfg_name[IWL_FW_INI_MAX_CFG_NAME];
175677d25b2SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_INFO_API_S_VER_1 */
176677d25b2SShahar S Matityahu 
177677d25b2SShahar S Matityahu /**
178593fae3eSShahar S Matityahu  * struct iwl_fw_ini_allocation_tlv - Allocates DRAM buffers
179593fae3eSShahar S Matityahu  *
180593fae3eSShahar S Matityahu  * @hdr: debug header
181593fae3eSShahar S Matityahu  * @alloc_id: allocation id. One of &enum iwl_fw_ini_allocation_id
182593fae3eSShahar S Matityahu  * @buf_location: buffer location. One of &enum iwl_fw_ini_buffer_location
183593fae3eSShahar S Matityahu  * @req_size: requested buffer size
184593fae3eSShahar S Matityahu  * @max_frags_num: maximum number of fragments
185593fae3eSShahar S Matityahu  * @min_size: minimum buffer size
186593fae3eSShahar S Matityahu  */
187593fae3eSShahar S Matityahu struct iwl_fw_ini_allocation_tlv {
188593fae3eSShahar S Matityahu 	struct iwl_fw_ini_header hdr;
189593fae3eSShahar S Matityahu 	__le32 alloc_id;
190593fae3eSShahar S Matityahu 	__le32 buf_location;
191593fae3eSShahar S Matityahu 	__le32 req_size;
192593fae3eSShahar S Matityahu 	__le32 max_frags_num;
193593fae3eSShahar S Matityahu 	__le32 min_size;
194593fae3eSShahar S Matityahu } __packed; /* FW_TLV_DEBUG_BUFFER_ALLOCATION_API_S_VER_1 */
195593fae3eSShahar S Matityahu 
196593fae3eSShahar S Matityahu /**
1973b589d56SShahar S Matityahu  * struct iwl_fw_ini_trigger_tlv - trigger TLV
198bd294466SSara Sharon  *
1993b589d56SShahar S Matityahu  * Trigger that upon firing, determines what regions to collect
2003b589d56SShahar S Matityahu  *
2013b589d56SShahar S Matityahu  * @hdr: debug header
2023b589d56SShahar S Matityahu  * @time_point: time point. One of &enum iwl_fw_ini_time_point
2033b589d56SShahar S Matityahu  * @trigger_reason: trigger reason
2043b589d56SShahar S Matityahu  * @apply_policy: uses &enum iwl_fw_ini_trigger_apply_policy
2053b589d56SShahar S Matityahu  * @dump_delay: delay from trigger fire to dump, in usec
2063b589d56SShahar S Matityahu  * @occurrences: max trigger fire occurrences allowed
2073b589d56SShahar S Matityahu  * @reserved: unused
2083b589d56SShahar S Matityahu  * @ignore_consec: ignore consecutive triggers, in usec
2093b589d56SShahar S Matityahu  * @reset_fw: if non zero, will reset and reload the FW
2103b589d56SShahar S Matityahu  * @multi_dut: initiate debug dump data on several DUTs
2113b589d56SShahar S Matityahu  * @regions_mask: mask of regions to collect
2123b589d56SShahar S Matityahu  * @data: trigger data
213bd294466SSara Sharon  */
214bd294466SSara Sharon struct iwl_fw_ini_trigger_tlv {
2153b589d56SShahar S Matityahu 	struct iwl_fw_ini_header hdr;
2163b589d56SShahar S Matityahu 	__le32 time_point;
2173b589d56SShahar S Matityahu 	__le32 trigger_reason;
2183b589d56SShahar S Matityahu 	__le32 apply_policy;
2193b589d56SShahar S Matityahu 	__le32 dump_delay;
2203b589d56SShahar S Matityahu 	__le32 occurrences;
2213b589d56SShahar S Matityahu 	__le32 reserved;
2223b589d56SShahar S Matityahu 	__le32 ignore_consec;
2233b589d56SShahar S Matityahu 	__le32 reset_fw;
2243b589d56SShahar S Matityahu 	__le32 multi_dut;
2253b589d56SShahar S Matityahu 	__le64 regions_mask;
2263b589d56SShahar S Matityahu 	__le32 data[];
2273b589d56SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_TRIGGER_API_S_VER_1 */
228bd294466SSara Sharon 
229bd294466SSara Sharon /**
230a9248de4SShahar S Matityahu  * struct iwl_fw_ini_hcmd_tlv - Generic Host command pass through TLV
231a9248de4SShahar S Matityahu  *
232a9248de4SShahar S Matityahu  * @hdr: debug header
233a9248de4SShahar S Matityahu  * @time_point: time point. One of &enum iwl_fw_ini_time_point
234a9248de4SShahar S Matityahu  * @period_msec: interval at which the hcmd will be sent to the FW.
235a9248de4SShahar S Matityahu  *	Measured in msec (0 = one time command)
236a9248de4SShahar S Matityahu  * @hcmd: a variable length host-command to be sent to apply the configuration
237a9248de4SShahar S Matityahu  */
238a9248de4SShahar S Matityahu struct iwl_fw_ini_hcmd_tlv {
239a9248de4SShahar S Matityahu 	struct iwl_fw_ini_header hdr;
240a9248de4SShahar S Matityahu 	__le32 time_point;
241a9248de4SShahar S Matityahu 	__le32 period_msec;
242a9248de4SShahar S Matityahu 	struct iwl_fw_ini_hcmd hcmd;
243a9248de4SShahar S Matityahu } __packed; /* FW_TLV_DEBUG_HCMD_API_S_VER_1 */
244a9248de4SShahar S Matityahu 
245a9248de4SShahar S Matityahu /**
246bd294466SSara Sharon  * enum iwl_fw_ini_allocation_id
247fe63f21bSShahar S Matityahu  *
248bd294466SSara Sharon  * @IWL_FW_INI_ALLOCATION_INVALID: invalid
249bd294466SSara Sharon  * @IWL_FW_INI_ALLOCATION_ID_DBGC1: allocation meant for DBGC1 configuration
250bd294466SSara Sharon  * @IWL_FW_INI_ALLOCATION_ID_DBGC2: allocation meant for DBGC2 configuration
251bd294466SSara Sharon  * @IWL_FW_INI_ALLOCATION_ID_DBGC3: allocation meant for DBGC3 configuration
252ccdc3d6dSShahar S Matityahu  * @IWL_FW_INI_ALLOCATION_NUM: number of allocation ids
253bd294466SSara Sharon */
254bd294466SSara Sharon enum iwl_fw_ini_allocation_id {
255bd294466SSara Sharon 	IWL_FW_INI_ALLOCATION_INVALID,
256bd294466SSara Sharon 	IWL_FW_INI_ALLOCATION_ID_DBGC1,
257bd294466SSara Sharon 	IWL_FW_INI_ALLOCATION_ID_DBGC2,
258bd294466SSara Sharon 	IWL_FW_INI_ALLOCATION_ID_DBGC3,
259ccdc3d6dSShahar S Matityahu 	IWL_FW_INI_ALLOCATION_NUM,
260d7febc2eSShahar S Matityahu }; /* FW_DEBUG_TLV_ALLOCATION_ID_E_VER_1 */
261bd294466SSara Sharon 
262bd294466SSara Sharon /**
263bd294466SSara Sharon  * enum iwl_fw_ini_buffer_location
264fe63f21bSShahar S Matityahu  *
265bd294466SSara Sharon  * @IWL_FW_INI_LOCATION_INVALID: invalid
266bd294466SSara Sharon  * @IWL_FW_INI_LOCATION_SRAM_PATH: SRAM location
267bd294466SSara Sharon  * @IWL_FW_INI_LOCATION_DRAM_PATH: DRAM location
268fe63f21bSShahar S Matityahu  * @IWL_FW_INI_LOCATION_NPK_PATH: NPK location
269bd294466SSara Sharon  */
270bd294466SSara Sharon enum iwl_fw_ini_buffer_location {
27156ea8e3bSShahar S Matityahu 	IWL_FW_INI_LOCATION_INVALID,
272bd294466SSara Sharon 	IWL_FW_INI_LOCATION_SRAM_PATH,
273bd294466SSara Sharon 	IWL_FW_INI_LOCATION_DRAM_PATH,
274fe63f21bSShahar S Matityahu 	IWL_FW_INI_LOCATION_NPK_PATH,
2750c9e025eSMordechay Goodstein 	IWL_FW_INI_LOCATION_NUM,
276d7febc2eSShahar S Matityahu }; /* FW_DEBUG_TLV_BUFFER_LOCATION_E_VER_1 */
277bd294466SSara Sharon 
278bd294466SSara Sharon /**
279bd294466SSara Sharon  * enum iwl_fw_ini_region_type
280fe63f21bSShahar S Matityahu  *
281bd294466SSara Sharon  * @IWL_FW_INI_REGION_INVALID: invalid
282c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_TLV: uCode and debug TLVs
283c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_INTERNAL_BUFFER: monitor SMEM buffer
284c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_DRAM_BUFFER: monitor DRAM buffer
285c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_TXF: TX fifos
286c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_RXF: RX fifo
287c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_LMAC_ERROR_TABLE: lmac error table
288c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_UMAC_ERROR_TABLE: umac error table
289c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_RSP_OR_NOTIF: FW response or notification data
290bd294466SSara Sharon  * @IWL_FW_INI_REGION_DEVICE_MEMORY: device internal memory
291bd294466SSara Sharon  * @IWL_FW_INI_REGION_PERIPHERY_MAC: periphery registers of MAC
292bd294466SSara Sharon  * @IWL_FW_INI_REGION_PERIPHERY_PHY: periphery registers of PHY
293bd294466SSara Sharon  * @IWL_FW_INI_REGION_PERIPHERY_AUX: periphery registers of AUX
294bd294466SSara Sharon  * @IWL_FW_INI_REGION_PAGING: paging memory
295bd294466SSara Sharon  * @IWL_FW_INI_REGION_CSR: CSR registers
296c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_DRAM_IMR: IMR memory
297c9fe75e9SShahar S Matityahu  * @IWL_FW_INI_REGION_PCI_IOSF_CONFIG: PCI/IOSF config
29816b2afe0SMordechay Goodstein  * @IWL_FW_INI_REGION_SPECIAL_DEVICE_MEMORY: special device memory
299*89639e06SMukesh Sisodiya  * @IWL_FW_INI_REGION_DBGI_SRAM: periphery registers of DBGI SRAM
300bd294466SSara Sharon  * @IWL_FW_INI_REGION_NUM: number of region types
301bd294466SSara Sharon  */
302bd294466SSara Sharon enum iwl_fw_ini_region_type {
303bd294466SSara Sharon 	IWL_FW_INI_REGION_INVALID,
304c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_TLV,
305c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_INTERNAL_BUFFER,
306c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_DRAM_BUFFER,
307c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_TXF,
308c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_RXF,
309c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_LMAC_ERROR_TABLE,
310c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_UMAC_ERROR_TABLE,
311c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_RSP_OR_NOTIF,
312bd294466SSara Sharon 	IWL_FW_INI_REGION_DEVICE_MEMORY,
313bd294466SSara Sharon 	IWL_FW_INI_REGION_PERIPHERY_MAC,
314bd294466SSara Sharon 	IWL_FW_INI_REGION_PERIPHERY_PHY,
315bd294466SSara Sharon 	IWL_FW_INI_REGION_PERIPHERY_AUX,
316bd294466SSara Sharon 	IWL_FW_INI_REGION_PAGING,
317bd294466SSara Sharon 	IWL_FW_INI_REGION_CSR,
318c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_DRAM_IMR,
319c9fe75e9SShahar S Matityahu 	IWL_FW_INI_REGION_PCI_IOSF_CONFIG,
320ba8f6f4aSMordechay Goodstein 	IWL_FW_INI_REGION_SPECIAL_DEVICE_MEMORY,
321*89639e06SMukesh Sisodiya 	IWL_FW_INI_REGION_DBGI_SRAM,
322bd294466SSara Sharon 	IWL_FW_INI_REGION_NUM
323c9fe75e9SShahar S Matityahu }; /* FW_TLV_DEBUG_REGION_TYPE_API_E */
324bd294466SSara Sharon 
325b108d8c7SShahar S Matityahu /**
326b108d8c7SShahar S Matityahu  * enum iwl_fw_ini_time_point
327b108d8c7SShahar S Matityahu  *
328b108d8c7SShahar S Matityahu  * Hard coded time points in which the driver can send hcmd or perform dump
329b108d8c7SShahar S Matityahu  * collection
330b108d8c7SShahar S Matityahu  *
331b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_EARLY: pre loading the FW
332b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_AFTER_ALIVE: first cmd from host after alive notif
333b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_POST_INIT: last cmd in series of init sequence
334b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_FW_ASSERT: FW assert
335b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_FW_HW_ERROR: FW HW error
336b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_FW_TFD_Q_HANG: TFD queue hang
3374bf3d7cfSMordechay Goodstein  * @IWL_FW_INI_TIME_POINT_FW_DHC_NOTIFICATION: DHC cmd response and notif
338b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_FW_RSP_OR_NOTIF: FW response or notification.
339b108d8c7SShahar S Matityahu  *	data field holds id and group
340b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_USER_TRIGGER: user trigger time point
341b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_PERIODIC: periodic timepoint that fires in constant
342b108d8c7SShahar S Matityahu  *	intervals. data field holds the interval time in msec
3434c447cfaSLuca Coelho  * @IWL_FW_INI_TIME_POINT_RESERVED: reserved
344b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_ASSERT: Unused
345b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_ALIVE_TIMEOUT: alive timeout
346b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_DEVICE_ENABLE: device enable
347b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_DEVICE_DISABLE: device disable
348b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_D3_START: D3 start
349b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HOST_D3_END: D3 end
350b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_MISSED_BEACONS: missed beacons
351b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_ASSOC_FAILED: association failure
352b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_TX_FAILED: Tx frame failed
353b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_TX_WFD_ACTION_FRAME_FAILED: wifi direct action
354b108d8c7SShahar S Matityahu  *	frame failed
355b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_TX_LATENCY_THRESHOLD: Tx latency threshold
356b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_HANG_OCCURRED: hang occurred
357b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_EAPOL_FAILED: EAPOL failed
358b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_FAKE_TX: fake Tx
359b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_DEASSOC: de association
360b108d8c7SShahar S Matityahu  * @IWL_FW_INI_TIME_POINT_NUM: number of time points
361b108d8c7SShahar S Matityahu  */
362b108d8c7SShahar S Matityahu enum iwl_fw_ini_time_point {
363b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_INVALID,
364b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_EARLY,
365b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_AFTER_ALIVE,
366b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_POST_INIT,
367b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_FW_ASSERT,
368b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_FW_HW_ERROR,
369b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_FW_TFD_Q_HANG,
3704bf3d7cfSMordechay Goodstein 	IWL_FW_INI_TIME_POINT_FW_DHC_NOTIFICATION,
371b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_FW_RSP_OR_NOTIF,
372b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_USER_TRIGGER,
373b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_PERIODIC,
3744c447cfaSLuca Coelho 	IWL_FW_INI_TIME_POINT_RESERVED,
375b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_ASSERT,
376b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_ALIVE_TIMEOUT,
377b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_DEVICE_ENABLE,
378b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_DEVICE_DISABLE,
379b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_D3_START,
380b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HOST_D3_END,
381b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_MISSED_BEACONS,
382b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_ASSOC_FAILED,
383b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_TX_FAILED,
384b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_TX_WFD_ACTION_FRAME_FAILED,
385b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_TX_LATENCY_THRESHOLD,
386b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_HANG_OCCURRED,
387b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_EAPOL_FAILED,
388b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_FAKE_TX,
389b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_DEASSOC,
390b108d8c7SShahar S Matityahu 	IWL_FW_INI_TIME_POINT_NUM,
391b108d8c7SShahar S Matityahu }; /* FW_TLV_DEBUG_TIME_POINT_API_E */
392b108d8c7SShahar S Matityahu 
393cf29c5b6SShahar S Matityahu /**
394cf29c5b6SShahar S Matityahu  * enum iwl_fw_ini_trigger_apply_policy - Determines how to apply triggers
395cf29c5b6SShahar S Matityahu  *
396cf29c5b6SShahar S Matityahu  * @IWL_FW_INI_APPLY_POLICY_MATCH_TIME_POINT: match by time point
397cf29c5b6SShahar S Matityahu  * @IWL_FW_INI_APPLY_POLICY_MATCH_DATA: match by trigger data
398cf29c5b6SShahar S Matityahu  * @IWL_FW_INI_APPLY_POLICY_OVERRIDE_REGIONS: override regions mask.
399cf29c5b6SShahar S Matityahu  *	Append otherwise
400cf29c5b6SShahar S Matityahu  * @IWL_FW_INI_APPLY_POLICY_OVERRIDE_CFG: override trigger configuration
401cf29c5b6SShahar S Matityahu  * @IWL_FW_INI_APPLY_POLICY_OVERRIDE_DATA: override trigger data.
402cf29c5b6SShahar S Matityahu  *	Append otherwise
403cf29c5b6SShahar S Matityahu  */
404cf29c5b6SShahar S Matityahu enum iwl_fw_ini_trigger_apply_policy {
405cf29c5b6SShahar S Matityahu 	IWL_FW_INI_APPLY_POLICY_MATCH_TIME_POINT	= BIT(0),
406cf29c5b6SShahar S Matityahu 	IWL_FW_INI_APPLY_POLICY_MATCH_DATA		= BIT(1),
407cf29c5b6SShahar S Matityahu 	IWL_FW_INI_APPLY_POLICY_OVERRIDE_REGIONS	= BIT(8),
408cf29c5b6SShahar S Matityahu 	IWL_FW_INI_APPLY_POLICY_OVERRIDE_CFG		= BIT(9),
409cf29c5b6SShahar S Matityahu 	IWL_FW_INI_APPLY_POLICY_OVERRIDE_DATA		= BIT(10),
410cf29c5b6SShahar S Matityahu };
411bd294466SSara Sharon #endif
412