xref: /linux/drivers/net/ipa/reg/ipa_reg-v3.1.c (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
107f120bcSAlex Elder // SPDX-License-Identifier: GPL-2.0
207f120bcSAlex Elder 
3ff39eefdSAlex Elder /* Copyright (C) 2022-2024 Linaro Ltd. */
407f120bcSAlex Elder 
5ff39eefdSAlex Elder #include <linux/array_size.h>
6ff39eefdSAlex Elder #include <linux/bits.h>
707f120bcSAlex Elder #include <linux/types.h>
807f120bcSAlex Elder 
907f120bcSAlex Elder #include "../ipa_reg.h"
10*f60e5fb6SAlex Elder #include "../ipa_version.h"
1107f120bcSAlex Elder 
1281772e44SAlex Elder static const u32 reg_comp_cfg_fmask[] = {
1312c7ea7dSAlex Elder 	[COMP_CFG_ENABLE]				= BIT(0),
1412c7ea7dSAlex Elder 	[GSI_SNOC_BYPASS_DIS]				= BIT(1),
1512c7ea7dSAlex Elder 	[GEN_QMB_0_SNOC_BYPASS_DIS]			= BIT(2),
1612c7ea7dSAlex Elder 	[GEN_QMB_1_SNOC_BYPASS_DIS]			= BIT(3),
1712c7ea7dSAlex Elder 	[IPA_DCMP_FAST_CLK_EN]				= BIT(4),
1812c7ea7dSAlex Elder 						/* Bits 5-31 reserved */
1912c7ea7dSAlex Elder };
2012c7ea7dSAlex Elder 
2181772e44SAlex Elder REG_FIELDS(COMP_CFG, comp_cfg, 0x0000003c);
2207f120bcSAlex Elder 
2381772e44SAlex Elder static const u32 reg_clkon_cfg_fmask[] = {
24479deb32SAlex Elder 	[CLKON_RX]					= BIT(0),
25479deb32SAlex Elder 	[CLKON_PROC]					= BIT(1),
26479deb32SAlex Elder 	[TX_WRAPPER]					= BIT(2),
27479deb32SAlex Elder 	[CLKON_MISC]					= BIT(3),
28479deb32SAlex Elder 	[RAM_ARB]					= BIT(4),
29479deb32SAlex Elder 	[FTCH_HPS]					= BIT(5),
30479deb32SAlex Elder 	[FTCH_DPS]					= BIT(6),
31479deb32SAlex Elder 	[CLKON_HPS]					= BIT(7),
32479deb32SAlex Elder 	[CLKON_DPS]					= BIT(8),
33479deb32SAlex Elder 	[RX_HPS_CMDQS]					= BIT(9),
34479deb32SAlex Elder 	[HPS_DPS_CMDQS]					= BIT(10),
35479deb32SAlex Elder 	[DPS_TX_CMDQS]					= BIT(11),
36479deb32SAlex Elder 	[RSRC_MNGR]					= BIT(12),
37479deb32SAlex Elder 	[CTX_HANDLER]					= BIT(13),
38479deb32SAlex Elder 	[ACK_MNGR]					= BIT(14),
39479deb32SAlex Elder 	[D_DCPH]					= BIT(15),
40479deb32SAlex Elder 	[H_DCPH]					= BIT(16),
41479deb32SAlex Elder 						/* Bits 17-31 reserved */
42479deb32SAlex Elder };
4307f120bcSAlex Elder 
4481772e44SAlex Elder REG_FIELDS(CLKON_CFG, clkon_cfg, 0x00000044);
45479deb32SAlex Elder 
4681772e44SAlex Elder static const u32 reg_route_fmask[] = {
47479deb32SAlex Elder 	[ROUTE_DIS]					= BIT(0),
48479deb32SAlex Elder 	[ROUTE_DEF_PIPE]				= GENMASK(5, 1),
49479deb32SAlex Elder 	[ROUTE_DEF_HDR_TABLE]				= BIT(6),
50479deb32SAlex Elder 	[ROUTE_DEF_HDR_OFST]				= GENMASK(16, 7),
51479deb32SAlex Elder 	[ROUTE_FRAG_DEF_PIPE]				= GENMASK(21, 17),
52479deb32SAlex Elder 						/* Bits 22-23 reserved */
53479deb32SAlex Elder 	[ROUTE_DEF_RETAIN_HDR]				= BIT(24),
54479deb32SAlex Elder 						/* Bits 25-31 reserved */
55479deb32SAlex Elder };
56479deb32SAlex Elder 
5781772e44SAlex Elder REG_FIELDS(ROUTE, route, 0x00000048);
5807f120bcSAlex Elder 
5981772e44SAlex Elder static const u32 reg_shared_mem_size_fmask[] = {
6062b9c009SAlex Elder 	[MEM_SIZE]					= GENMASK(15, 0),
6162b9c009SAlex Elder 	[MEM_BADDR]					= GENMASK(31, 16),
6262b9c009SAlex Elder };
6307f120bcSAlex Elder 
6481772e44SAlex Elder REG_FIELDS(SHARED_MEM_SIZE, shared_mem_size, 0x00000054);
6507f120bcSAlex Elder 
6681772e44SAlex Elder static const u32 reg_qsb_max_writes_fmask[] = {
6762b9c009SAlex Elder 	[GEN_QMB_0_MAX_WRITES]				= GENMASK(3, 0),
6862b9c009SAlex Elder 	[GEN_QMB_1_MAX_WRITES]				= GENMASK(7, 4),
6962b9c009SAlex Elder 						/* Bits 8-31 reserved */
7062b9c009SAlex Elder };
7107f120bcSAlex Elder 
7281772e44SAlex Elder REG_FIELDS(QSB_MAX_WRITES, qsb_max_writes, 0x00000074);
7307f120bcSAlex Elder 
7481772e44SAlex Elder static const u32 reg_qsb_max_reads_fmask[] = {
7562b9c009SAlex Elder 	[GEN_QMB_0_MAX_READS]				= GENMASK(3, 0),
7662b9c009SAlex Elder 	[GEN_QMB_1_MAX_READS]				= GENMASK(7, 4),
7762b9c009SAlex Elder };
7862b9c009SAlex Elder 
7981772e44SAlex Elder REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078);
8062b9c009SAlex Elder 
8181772e44SAlex Elder static const u32 reg_filt_rout_hash_flush_fmask[] = {
8262b9c009SAlex Elder 	[IPV6_ROUTER_HASH]				= BIT(0),
8362b9c009SAlex Elder 						/* Bits 1-3 reserved */
8462b9c009SAlex Elder 	[IPV6_FILTER_HASH]				= BIT(4),
8562b9c009SAlex Elder 						/* Bits 5-7 reserved */
8662b9c009SAlex Elder 	[IPV4_ROUTER_HASH]				= BIT(8),
8762b9c009SAlex Elder 						/* Bits 9-11 reserved */
8862b9c009SAlex Elder 	[IPV4_FILTER_HASH]				= BIT(12),
8962b9c009SAlex Elder 						/* Bits 13-31 reserved */
9062b9c009SAlex Elder };
9162b9c009SAlex Elder 
9281772e44SAlex Elder REG_FIELDS(FILT_ROUT_HASH_FLUSH, filt_rout_hash_flush, 0x0000090);
9307f120bcSAlex Elder 
9407f120bcSAlex Elder /* Valid bits defined by ipa->available */
9581772e44SAlex Elder REG_STRIDE(STATE_AGGR_ACTIVE, state_aggr_active, 0x0000010c, 0x0004);
9607f120bcSAlex Elder 
9781772e44SAlex Elder REG(IPA_BCR, ipa_bcr, 0x000001d0);
9807f120bcSAlex Elder 
9981772e44SAlex Elder static const u32 reg_local_pkt_proc_cntxt_fmask[] = {
100b5c35fa4SAlex Elder 	[IPA_BASE_ADDR]					= GENMASK(16, 0),
101b5c35fa4SAlex Elder 						/* Bits 17-31 reserved */
102b5c35fa4SAlex Elder };
103b5c35fa4SAlex Elder 
10407f120bcSAlex Elder /* Offset must be a multiple of 8 */
10581772e44SAlex Elder REG_FIELDS(LOCAL_PKT_PROC_CNTXT, local_pkt_proc_cntxt, 0x000001e8);
10607f120bcSAlex Elder 
10707f120bcSAlex Elder /* Valid bits defined by ipa->available */
10881772e44SAlex Elder REG_STRIDE(AGGR_FORCE_CLOSE, aggr_force_close, 0x000001ec, 0x0004);
10907f120bcSAlex Elder 
11081772e44SAlex Elder static const u32 reg_counter_cfg_fmask[] = {
111b5c35fa4SAlex Elder 	[EOT_COAL_GRANULARITY]				= GENMASK(3, 0),
112b5c35fa4SAlex Elder 	[AGGR_GRANULARITY]				= GENMASK(8, 4),
113b5c35fa4SAlex Elder 						/* Bits 5-31 reserved */
114b5c35fa4SAlex Elder };
115b5c35fa4SAlex Elder 
11681772e44SAlex Elder REG_FIELDS(COUNTER_CFG, counter_cfg, 0x000001f0);
11707f120bcSAlex Elder 
11881772e44SAlex Elder static const u32 reg_src_rsrc_grp_01_rsrc_type_fmask[] = {
11905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
12005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
12105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
12205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1231c418c4aSAlex Elder };
1241c418c4aSAlex Elder 
12581772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type,
12607f120bcSAlex Elder 		  0x00000400, 0x0020);
12707f120bcSAlex Elder 
12881772e44SAlex Elder static const u32 reg_src_rsrc_grp_23_rsrc_type_fmask[] = {
12905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
13005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
13105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
13205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1331c418c4aSAlex Elder };
1341c418c4aSAlex Elder 
13581772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type,
13607f120bcSAlex Elder 		  0x00000404, 0x0020);
13707f120bcSAlex Elder 
13881772e44SAlex Elder static const u32 reg_src_rsrc_grp_45_rsrc_type_fmask[] = {
13905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
14005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
14105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
14205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1431c418c4aSAlex Elder };
1441c418c4aSAlex Elder 
14581772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_45_RSRC_TYPE, src_rsrc_grp_45_rsrc_type,
14607f120bcSAlex Elder 		  0x00000408, 0x0020);
14707f120bcSAlex Elder 
14881772e44SAlex Elder static const u32 reg_src_rsrc_grp_67_rsrc_type_fmask[] = {
14905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
15005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
15105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
15205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1531c418c4aSAlex Elder };
1541c418c4aSAlex Elder 
15581772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_67_RSRC_TYPE, src_rsrc_grp_67_rsrc_type,
15607f120bcSAlex Elder 		  0x0000040c, 0x0020);
15707f120bcSAlex Elder 
15881772e44SAlex Elder static const u32 reg_dst_rsrc_grp_01_rsrc_type_fmask[] = {
15905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
16005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
16105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
16205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1631c418c4aSAlex Elder };
1641c418c4aSAlex Elder 
16581772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type,
16607f120bcSAlex Elder 		  0x00000500, 0x0020);
16707f120bcSAlex Elder 
16881772e44SAlex Elder static const u32 reg_dst_rsrc_grp_23_rsrc_type_fmask[] = {
16905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
17005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
17105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
17205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1731c418c4aSAlex Elder };
1741c418c4aSAlex Elder 
17581772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type,
17607f120bcSAlex Elder 		  0x00000504, 0x0020);
17707f120bcSAlex Elder 
17881772e44SAlex Elder static const u32 reg_dst_rsrc_grp_45_rsrc_type_fmask[] = {
17905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
18005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
18105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
18205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1831c418c4aSAlex Elder };
1841c418c4aSAlex Elder 
18581772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_45_RSRC_TYPE, dst_rsrc_grp_45_rsrc_type,
18607f120bcSAlex Elder 		  0x00000508, 0x0020);
18707f120bcSAlex Elder 
18881772e44SAlex Elder static const u32 reg_dst_rsrc_grp_67_rsrc_type_fmask[] = {
18905a31b94SCaleb Connolly 	[X_MIN_LIM]					= GENMASK(7, 0),
19005a31b94SCaleb Connolly 	[X_MAX_LIM]					= GENMASK(15, 8),
19105a31b94SCaleb Connolly 	[Y_MIN_LIM]					= GENMASK(23, 16),
19205a31b94SCaleb Connolly 	[Y_MAX_LIM]					= GENMASK(31, 24),
1931c418c4aSAlex Elder };
1941c418c4aSAlex Elder 
19581772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_67_RSRC_TYPE, dst_rsrc_grp_67_rsrc_type,
19607f120bcSAlex Elder 		  0x0000050c, 0x0020);
19707f120bcSAlex Elder 
19881772e44SAlex Elder static const u32 reg_endp_init_ctrl_fmask[] = {
1994468a344SAlex Elder 	[ENDP_SUSPEND]					= BIT(0),
2004468a344SAlex Elder 	[ENDP_DELAY]					= BIT(1),
2014468a344SAlex Elder 						/* Bits 2-31 reserved */
2024468a344SAlex Elder };
20307f120bcSAlex Elder 
20481772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_CTRL, endp_init_ctrl, 0x00000800, 0x0070);
20507f120bcSAlex Elder 
20681772e44SAlex Elder static const u32 reg_endp_init_cfg_fmask[] = {
2074468a344SAlex Elder 	[FRAG_OFFLOAD_EN]				= BIT(0),
2084468a344SAlex Elder 	[CS_OFFLOAD_EN]					= GENMASK(2, 1),
2094468a344SAlex Elder 	[CS_METADATA_HDR_OFFSET]			= GENMASK(6, 3),
2104468a344SAlex Elder 						/* Bit 7 reserved */
2114468a344SAlex Elder 	[CS_GEN_QMB_MASTER_SEL]				= BIT(8),
2124468a344SAlex Elder 						/* Bits 9-31 reserved */
2134468a344SAlex Elder };
21407f120bcSAlex Elder 
21581772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_CFG, endp_init_cfg, 0x00000808, 0x0070);
21607f120bcSAlex Elder 
21781772e44SAlex Elder static const u32 reg_endp_init_nat_fmask[] = {
2184468a344SAlex Elder 	[NAT_EN]					= GENMASK(1, 0),
2194468a344SAlex Elder 						/* Bits 2-31 reserved */
2204468a344SAlex Elder };
2214468a344SAlex Elder 
22281772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_NAT, endp_init_nat, 0x0000080c, 0x0070);
2234468a344SAlex Elder 
22481772e44SAlex Elder static const u32 reg_endp_init_hdr_fmask[] = {
2254468a344SAlex Elder 	[HDR_LEN]					= GENMASK(5, 0),
2264468a344SAlex Elder 	[HDR_OFST_METADATA_VALID]			= BIT(6),
2274468a344SAlex Elder 	[HDR_OFST_METADATA]				= GENMASK(12, 7),
2284468a344SAlex Elder 	[HDR_ADDITIONAL_CONST_LEN]			= GENMASK(18, 13),
2294468a344SAlex Elder 	[HDR_OFST_PKT_SIZE_VALID]			= BIT(19),
2304468a344SAlex Elder 	[HDR_OFST_PKT_SIZE]				= GENMASK(25, 20),
2314468a344SAlex Elder 	[HDR_A5_MUX]					= BIT(26),
2324468a344SAlex Elder 	[HDR_LEN_INC_DEAGG_HDR]				= BIT(27),
2334468a344SAlex Elder 	[HDR_METADATA_REG_VALID]			= BIT(28),
2344468a344SAlex Elder 						/* Bits 29-31 reserved */
2354468a344SAlex Elder };
2364468a344SAlex Elder 
23781772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR, endp_init_hdr, 0x00000810, 0x0070);
2384468a344SAlex Elder 
23981772e44SAlex Elder static const u32 reg_endp_init_hdr_ext_fmask[] = {
2404468a344SAlex Elder 	[HDR_ENDIANNESS]				= BIT(0),
2414468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_VALID]			= BIT(1),
2424468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD]				= BIT(2),
2434468a344SAlex Elder 	[HDR_PAYLOAD_LEN_INC_PADDING]			= BIT(3),
2444468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_OFFSET]			= GENMASK(9, 4),
2454468a344SAlex Elder 	[HDR_PAD_TO_ALIGNMENT]				= GENMASK(13, 10),
2464468a344SAlex Elder 						/* Bits 14-31 reserved */
2474468a344SAlex Elder };
2484468a344SAlex Elder 
24981772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR_EXT, endp_init_hdr_ext, 0x00000814, 0x0070);
25007f120bcSAlex Elder 
25181772e44SAlex Elder REG_STRIDE(ENDP_INIT_HDR_METADATA_MASK, endp_init_hdr_metadata_mask,
25207f120bcSAlex Elder 	   0x00000818, 0x0070);
25307f120bcSAlex Elder 
25481772e44SAlex Elder static const u32 reg_endp_init_mode_fmask[] = {
255216b409dSAlex Elder 	[ENDP_MODE]					= GENMASK(2, 0),
256216b409dSAlex Elder 						/* Bit 3 reserved */
257216b409dSAlex Elder 	[DEST_PIPE_INDEX]				= GENMASK(8, 4),
258216b409dSAlex Elder 						/* Bits 9-11 reserved */
259216b409dSAlex Elder 	[BYTE_THRESHOLD]				= GENMASK(27, 12),
260216b409dSAlex Elder 	[PIPE_REPLICATION_EN]				= BIT(28),
261216b409dSAlex Elder 	[PAD_EN]					= BIT(29),
262216b409dSAlex Elder 	[HDR_FTCH_DISABLE]				= BIT(30),
263216b409dSAlex Elder 						/* Bit 31 reserved */
264216b409dSAlex Elder };
26507f120bcSAlex Elder 
26681772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_MODE, endp_init_mode, 0x00000820, 0x0070);
26707f120bcSAlex Elder 
26881772e44SAlex Elder static const u32 reg_endp_init_aggr_fmask[] = {
269216b409dSAlex Elder 	[AGGR_EN]					= GENMASK(1, 0),
270216b409dSAlex Elder 	[AGGR_TYPE]					= GENMASK(4, 2),
271216b409dSAlex Elder 	[BYTE_LIMIT]					= GENMASK(9, 5),
272216b409dSAlex Elder 	[TIME_LIMIT]					= GENMASK(14, 10),
273216b409dSAlex Elder 	[PKT_LIMIT]					= GENMASK(20, 15),
274216b409dSAlex Elder 	[SW_EOF_ACTIVE]					= BIT(21),
275216b409dSAlex Elder 	[FORCE_CLOSE]					= BIT(22),
276216b409dSAlex Elder 						/* Bit 23 reserved */
277216b409dSAlex Elder 	[HARD_BYTE_LIMIT_EN]				= BIT(24),
278216b409dSAlex Elder 						/* Bits 25-31 reserved */
279216b409dSAlex Elder };
280216b409dSAlex Elder 
28181772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_AGGR, endp_init_aggr, 0x00000824, 0x0070);
282216b409dSAlex Elder 
28381772e44SAlex Elder static const u32 reg_endp_init_hol_block_en_fmask[] = {
284216b409dSAlex Elder 	[HOL_BLOCK_EN]					= BIT(0),
285216b409dSAlex Elder 						/* Bits 1-31 reserved */
286216b409dSAlex Elder };
287216b409dSAlex Elder 
28881772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_EN, endp_init_hol_block_en,
28907f120bcSAlex Elder 		  0x0000082c, 0x0070);
29007f120bcSAlex Elder 
291216b409dSAlex Elder /* Entire register is a tick count */
29281772e44SAlex Elder static const u32 reg_endp_init_hol_block_timer_fmask[] = {
293216b409dSAlex Elder 	[TIMER_BASE_VALUE]				= GENMASK(31, 0),
294216b409dSAlex Elder };
295216b409dSAlex Elder 
29681772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_TIMER, endp_init_hol_block_timer,
29707f120bcSAlex Elder 		  0x00000830, 0x0070);
29807f120bcSAlex Elder 
29981772e44SAlex Elder static const u32 reg_endp_init_deaggr_fmask[] = {
300181ca020SAlex Elder 	[DEAGGR_HDR_LEN]				= GENMASK(5, 0),
301181ca020SAlex Elder 	[SYSPIPE_ERR_DETECTION]				= BIT(6),
302181ca020SAlex Elder 	[PACKET_OFFSET_VALID]				= BIT(7),
303181ca020SAlex Elder 	[PACKET_OFFSET_LOCATION]			= GENMASK(13, 8),
304181ca020SAlex Elder 	[IGNORE_MIN_PKT_ERR]				= BIT(14),
305181ca020SAlex Elder 						/* Bit 15 reserved */
306181ca020SAlex Elder 	[MAX_PACKET_LEN]				= GENMASK(31, 16),
307181ca020SAlex Elder };
30807f120bcSAlex Elder 
30981772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_DEAGGR, endp_init_deaggr, 0x00000834, 0x0070);
31007f120bcSAlex Elder 
31181772e44SAlex Elder static const u32 reg_endp_init_rsrc_grp_fmask[] = {
312181ca020SAlex Elder 	[ENDP_RSRC_GRP]					= GENMASK(2, 0),
313181ca020SAlex Elder 						/* Bits 3-31 reserved */
314181ca020SAlex Elder };
31507f120bcSAlex Elder 
31681772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_RSRC_GRP, endp_init_rsrc_grp, 0x00000838, 0x0070);
31707f120bcSAlex Elder 
31881772e44SAlex Elder static const u32 reg_endp_init_seq_fmask[] = {
319181ca020SAlex Elder 	[SEQ_TYPE]					= GENMASK(7, 0),
320181ca020SAlex Elder 	[SEQ_REP_TYPE]					= GENMASK(15, 8),
321181ca020SAlex Elder 						/* Bits 16-31 reserved */
322181ca020SAlex Elder };
323181ca020SAlex Elder 
32481772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_SEQ, endp_init_seq, 0x0000083c, 0x0070);
325181ca020SAlex Elder 
32681772e44SAlex Elder static const u32 reg_endp_status_fmask[] = {
327181ca020SAlex Elder 	[STATUS_EN]					= BIT(0),
328181ca020SAlex Elder 	[STATUS_ENDP]					= GENMASK(5, 1),
329181ca020SAlex Elder 						/* Bits 6-7 reserved */
330181ca020SAlex Elder 	[STATUS_LOCATION]				= BIT(8),
331181ca020SAlex Elder 						/* Bits 9-31 reserved */
332181ca020SAlex Elder };
333181ca020SAlex Elder 
33481772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_STATUS, endp_status, 0x00000840, 0x0070);
335181ca020SAlex Elder 
33681772e44SAlex Elder static const u32 reg_endp_filter_router_hsh_cfg_fmask[] = {
337181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_ID]			= BIT(0),
338181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_IP]			= BIT(1),
339181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_IP]			= BIT(2),
340181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_PORT]			= BIT(3),
341181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_PORT]			= BIT(4),
342181ca020SAlex Elder 	[FILTER_HASH_MSK_PROTOCOL]			= BIT(5),
343181ca020SAlex Elder 	[FILTER_HASH_MSK_METADATA]			= BIT(6),
344181ca020SAlex Elder 	[FILTER_HASH_MSK_ALL]				= GENMASK(6, 0),
345181ca020SAlex Elder 						/* Bits 7-15 reserved */
346181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_ID]			= BIT(16),
347181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_IP]			= BIT(17),
348181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_IP]			= BIT(18),
349181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_PORT]			= BIT(19),
350181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_PORT]			= BIT(20),
351181ca020SAlex Elder 	[ROUTER_HASH_MSK_PROTOCOL]			= BIT(21),
352181ca020SAlex Elder 	[ROUTER_HASH_MSK_METADATA]			= BIT(22),
353181ca020SAlex Elder 	[ROUTER_HASH_MSK_ALL]				= GENMASK(22, 16),
354181ca020SAlex Elder 						/* Bits 23-31 reserved */
355181ca020SAlex Elder };
356181ca020SAlex Elder 
35781772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_FILTER_ROUTER_HSH_CFG, endp_filter_router_hsh_cfg,
35807f120bcSAlex Elder 		  0x0000085c, 0x0070);
35907f120bcSAlex Elder 
36007f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
36181772e44SAlex Elder REG(IPA_IRQ_STTS, ipa_irq_stts, 0x00003008 + 0x1000 * GSI_EE_AP);
36207f120bcSAlex Elder 
36307f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
36481772e44SAlex Elder REG(IPA_IRQ_EN, ipa_irq_en, 0x0000300c + 0x1000 * GSI_EE_AP);
36507f120bcSAlex Elder 
36607f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
36781772e44SAlex Elder REG(IPA_IRQ_CLR, ipa_irq_clr, 0x00003010 + 0x1000 * GSI_EE_AP);
36807f120bcSAlex Elder 
36981772e44SAlex Elder static const u32 reg_ipa_irq_uc_fmask[] = {
370181ca020SAlex Elder 	[UC_INTR]					= BIT(0),
371181ca020SAlex Elder 						/* Bits 1-31 reserved */
372181ca020SAlex Elder };
373181ca020SAlex Elder 
37481772e44SAlex Elder REG_FIELDS(IPA_IRQ_UC, ipa_irq_uc, 0x0000301c + 0x1000 * GSI_EE_AP);
37507f120bcSAlex Elder 
37607f120bcSAlex Elder /* Valid bits defined by ipa->available */
37781772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_INFO, irq_suspend_info,
378f298ba78SAlex Elder 	   0x00003030 + 0x1000 * GSI_EE_AP, 0x0004);
37907f120bcSAlex Elder 
38007f120bcSAlex Elder /* Valid bits defined by ipa->available */
38181772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_EN, irq_suspend_en,
382f298ba78SAlex Elder 	   0x00003034 + 0x1000 * GSI_EE_AP, 0x0004);
38307f120bcSAlex Elder 
38407f120bcSAlex Elder /* Valid bits defined by ipa->available */
38581772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_CLR, irq_suspend_clr,
386f298ba78SAlex Elder 	   0x00003038 + 0x1000 * GSI_EE_AP, 0x0004);
38707f120bcSAlex Elder 
38881772e44SAlex Elder static const struct reg *reg_array[] = {
38981772e44SAlex Elder 	[COMP_CFG]			= &reg_comp_cfg,
39081772e44SAlex Elder 	[CLKON_CFG]			= &reg_clkon_cfg,
39181772e44SAlex Elder 	[ROUTE]				= &reg_route,
39281772e44SAlex Elder 	[SHARED_MEM_SIZE]		= &reg_shared_mem_size,
39381772e44SAlex Elder 	[QSB_MAX_WRITES]		= &reg_qsb_max_writes,
39481772e44SAlex Elder 	[QSB_MAX_READS]			= &reg_qsb_max_reads,
39581772e44SAlex Elder 	[FILT_ROUT_HASH_FLUSH]		= &reg_filt_rout_hash_flush,
39681772e44SAlex Elder 	[STATE_AGGR_ACTIVE]		= &reg_state_aggr_active,
39781772e44SAlex Elder 	[IPA_BCR]			= &reg_ipa_bcr,
39881772e44SAlex Elder 	[LOCAL_PKT_PROC_CNTXT]		= &reg_local_pkt_proc_cntxt,
39981772e44SAlex Elder 	[AGGR_FORCE_CLOSE]		= &reg_aggr_force_close,
40081772e44SAlex Elder 	[COUNTER_CFG]			= &reg_counter_cfg,
40181772e44SAlex Elder 	[SRC_RSRC_GRP_01_RSRC_TYPE]	= &reg_src_rsrc_grp_01_rsrc_type,
40281772e44SAlex Elder 	[SRC_RSRC_GRP_23_RSRC_TYPE]	= &reg_src_rsrc_grp_23_rsrc_type,
40381772e44SAlex Elder 	[SRC_RSRC_GRP_45_RSRC_TYPE]	= &reg_src_rsrc_grp_45_rsrc_type,
40481772e44SAlex Elder 	[SRC_RSRC_GRP_67_RSRC_TYPE]	= &reg_src_rsrc_grp_67_rsrc_type,
40581772e44SAlex Elder 	[DST_RSRC_GRP_01_RSRC_TYPE]	= &reg_dst_rsrc_grp_01_rsrc_type,
40681772e44SAlex Elder 	[DST_RSRC_GRP_23_RSRC_TYPE]	= &reg_dst_rsrc_grp_23_rsrc_type,
40781772e44SAlex Elder 	[DST_RSRC_GRP_45_RSRC_TYPE]	= &reg_dst_rsrc_grp_45_rsrc_type,
40881772e44SAlex Elder 	[DST_RSRC_GRP_67_RSRC_TYPE]	= &reg_dst_rsrc_grp_67_rsrc_type,
40981772e44SAlex Elder 	[ENDP_INIT_CTRL]		= &reg_endp_init_ctrl,
41081772e44SAlex Elder 	[ENDP_INIT_CFG]			= &reg_endp_init_cfg,
41181772e44SAlex Elder 	[ENDP_INIT_NAT]			= &reg_endp_init_nat,
41281772e44SAlex Elder 	[ENDP_INIT_HDR]			= &reg_endp_init_hdr,
41381772e44SAlex Elder 	[ENDP_INIT_HDR_EXT]		= &reg_endp_init_hdr_ext,
41481772e44SAlex Elder 	[ENDP_INIT_HDR_METADATA_MASK]	= &reg_endp_init_hdr_metadata_mask,
41581772e44SAlex Elder 	[ENDP_INIT_MODE]		= &reg_endp_init_mode,
41681772e44SAlex Elder 	[ENDP_INIT_AGGR]		= &reg_endp_init_aggr,
41781772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_EN]	= &reg_endp_init_hol_block_en,
41881772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_TIMER]	= &reg_endp_init_hol_block_timer,
41981772e44SAlex Elder 	[ENDP_INIT_DEAGGR]		= &reg_endp_init_deaggr,
42081772e44SAlex Elder 	[ENDP_INIT_RSRC_GRP]		= &reg_endp_init_rsrc_grp,
42181772e44SAlex Elder 	[ENDP_INIT_SEQ]			= &reg_endp_init_seq,
42281772e44SAlex Elder 	[ENDP_STATUS]			= &reg_endp_status,
42381772e44SAlex Elder 	[ENDP_FILTER_ROUTER_HSH_CFG]	= &reg_endp_filter_router_hsh_cfg,
42481772e44SAlex Elder 	[IPA_IRQ_STTS]			= &reg_ipa_irq_stts,
42581772e44SAlex Elder 	[IPA_IRQ_EN]			= &reg_ipa_irq_en,
42681772e44SAlex Elder 	[IPA_IRQ_CLR]			= &reg_ipa_irq_clr,
42781772e44SAlex Elder 	[IPA_IRQ_UC]			= &reg_ipa_irq_uc,
42881772e44SAlex Elder 	[IRQ_SUSPEND_INFO]		= &reg_irq_suspend_info,
42981772e44SAlex Elder 	[IRQ_SUSPEND_EN]		= &reg_irq_suspend_en,
43081772e44SAlex Elder 	[IRQ_SUSPEND_CLR]		= &reg_irq_suspend_clr,
43107f120bcSAlex Elder };
43207f120bcSAlex Elder 
43381772e44SAlex Elder const struct regs ipa_regs_v3_1 = {
43481772e44SAlex Elder 	.reg_count	= ARRAY_SIZE(reg_array),
43581772e44SAlex Elder 	.reg		= reg_array,
43607f120bcSAlex Elder };
437