xref: /openbmc/linux/drivers/net/ipa/reg/ipa_reg-v4.5.c (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
107f120bcSAlex Elder // SPDX-License-Identifier: GPL-2.0
207f120bcSAlex Elder 
307f120bcSAlex Elder /* Copyright (C) 2022 Linaro Ltd. */
407f120bcSAlex Elder 
507f120bcSAlex Elder #include <linux/types.h>
607f120bcSAlex Elder 
707f120bcSAlex Elder #include "../ipa.h"
807f120bcSAlex Elder #include "../ipa_reg.h"
907f120bcSAlex Elder 
10*81772e44SAlex Elder static const u32 reg_comp_cfg_fmask[] = {
1112c7ea7dSAlex Elder 						/* Bit 0 reserved */
1212c7ea7dSAlex Elder 	[GSI_SNOC_BYPASS_DIS]				= BIT(1),
1312c7ea7dSAlex Elder 	[GEN_QMB_0_SNOC_BYPASS_DIS]			= BIT(2),
1412c7ea7dSAlex Elder 	[GEN_QMB_1_SNOC_BYPASS_DIS]			= BIT(3),
1512c7ea7dSAlex Elder 						/* Bit 4 reserved */
1612c7ea7dSAlex Elder 	[IPA_QMB_SELECT_CONS_EN]			= BIT(5),
1712c7ea7dSAlex Elder 	[IPA_QMB_SELECT_PROD_EN]			= BIT(6),
1812c7ea7dSAlex Elder 	[GSI_MULTI_INORDER_RD_DIS]			= BIT(7),
1912c7ea7dSAlex Elder 	[GSI_MULTI_INORDER_WR_DIS]			= BIT(8),
2012c7ea7dSAlex Elder 	[GEN_QMB_0_MULTI_INORDER_RD_DIS]		= BIT(9),
2112c7ea7dSAlex Elder 	[GEN_QMB_1_MULTI_INORDER_RD_DIS]		= BIT(10),
2212c7ea7dSAlex Elder 	[GEN_QMB_0_MULTI_INORDER_WR_DIS]		= BIT(11),
2312c7ea7dSAlex Elder 	[GEN_QMB_1_MULTI_INORDER_WR_DIS]		= BIT(12),
2412c7ea7dSAlex Elder 	[GEN_QMB_0_SNOC_CNOC_LOOP_PROT_DIS]		= BIT(13),
2512c7ea7dSAlex Elder 	[GSI_SNOC_CNOC_LOOP_PROT_DISABLE]		= BIT(14),
2612c7ea7dSAlex Elder 	[GSI_MULTI_AXI_MASTERS_DIS]			= BIT(15),
2712c7ea7dSAlex Elder 	[IPA_QMB_SELECT_GLOBAL_EN]			= BIT(16),
2812c7ea7dSAlex Elder 	[ATOMIC_FETCHER_ARB_LOCK_DIS]			= GENMASK(20, 17),
2912c7ea7dSAlex Elder 	[FULL_FLUSH_WAIT_RS_CLOSURE_EN]			= BIT(21),
3012c7ea7dSAlex Elder 						/* Bits 22-31 reserved */
3112c7ea7dSAlex Elder };
3212c7ea7dSAlex Elder 
33*81772e44SAlex Elder REG_FIELDS(COMP_CFG, comp_cfg, 0x0000003c);
3407f120bcSAlex Elder 
35*81772e44SAlex Elder static const u32 reg_clkon_cfg_fmask[] = {
36479deb32SAlex Elder 	[CLKON_RX]					= BIT(0),
37479deb32SAlex Elder 	[CLKON_PROC]					= BIT(1),
38479deb32SAlex Elder 	[TX_WRAPPER]					= BIT(2),
39479deb32SAlex Elder 	[CLKON_MISC]					= BIT(3),
40479deb32SAlex Elder 	[RAM_ARB]					= BIT(4),
41479deb32SAlex Elder 	[FTCH_HPS]					= BIT(5),
42479deb32SAlex Elder 	[FTCH_DPS]					= BIT(6),
43479deb32SAlex Elder 	[CLKON_HPS]					= BIT(7),
44479deb32SAlex Elder 	[CLKON_DPS]					= BIT(8),
45479deb32SAlex Elder 	[RX_HPS_CMDQS]					= BIT(9),
46479deb32SAlex Elder 	[HPS_DPS_CMDQS]					= BIT(10),
47479deb32SAlex Elder 	[DPS_TX_CMDQS]					= BIT(11),
48479deb32SAlex Elder 	[RSRC_MNGR]					= BIT(12),
49479deb32SAlex Elder 	[CTX_HANDLER]					= BIT(13),
50479deb32SAlex Elder 	[ACK_MNGR]					= BIT(14),
51479deb32SAlex Elder 	[D_DCPH]					= BIT(15),
52479deb32SAlex Elder 	[H_DCPH]					= BIT(16),
53479deb32SAlex Elder 	[CLKON_DCMP]					= BIT(17),
54479deb32SAlex Elder 	[NTF_TX_CMDQS]					= BIT(18),
55479deb32SAlex Elder 	[CLKON_TX_0]					= BIT(19),
56479deb32SAlex Elder 	[CLKON_TX_1]					= BIT(20),
57479deb32SAlex Elder 	[CLKON_FNR]					= BIT(21),
58479deb32SAlex Elder 	[QSB2AXI_CMDQ_L]				= BIT(22),
59479deb32SAlex Elder 	[AGGR_WRAPPER]					= BIT(23),
60479deb32SAlex Elder 	[RAM_SLAVEWAY]					= BIT(24),
61479deb32SAlex Elder 	[CLKON_QMB]					= BIT(25),
62479deb32SAlex Elder 	[WEIGHT_ARB]					= BIT(26),
63479deb32SAlex Elder 	[GSI_IF]					= BIT(27),
64479deb32SAlex Elder 	[CLKON_GLOBAL]					= BIT(28),
65479deb32SAlex Elder 	[GLOBAL_2X_CLK]					= BIT(29),
66479deb32SAlex Elder 	[DPL_FIFO]					= BIT(30),
67479deb32SAlex Elder 						/* Bit 31 reserved */
68479deb32SAlex Elder };
6907f120bcSAlex Elder 
70*81772e44SAlex Elder REG_FIELDS(CLKON_CFG, clkon_cfg, 0x00000044);
71479deb32SAlex Elder 
72*81772e44SAlex Elder static const u32 reg_route_fmask[] = {
73479deb32SAlex Elder 	[ROUTE_DIS]					= BIT(0),
74479deb32SAlex Elder 	[ROUTE_DEF_PIPE]				= GENMASK(5, 1),
75479deb32SAlex Elder 	[ROUTE_DEF_HDR_TABLE]				= BIT(6),
76479deb32SAlex Elder 	[ROUTE_DEF_HDR_OFST]				= GENMASK(16, 7),
77479deb32SAlex Elder 	[ROUTE_FRAG_DEF_PIPE]				= GENMASK(21, 17),
78479deb32SAlex Elder 						/* Bits 22-23 reserved */
79479deb32SAlex Elder 	[ROUTE_DEF_RETAIN_HDR]				= BIT(24),
80479deb32SAlex Elder 						/* Bits 25-31 reserved */
81479deb32SAlex Elder };
82479deb32SAlex Elder 
83*81772e44SAlex Elder REG_FIELDS(ROUTE, route, 0x00000048);
8407f120bcSAlex Elder 
85*81772e44SAlex Elder static const u32 reg_shared_mem_size_fmask[] = {
8662b9c009SAlex Elder 	[MEM_SIZE]					= GENMASK(15, 0),
8762b9c009SAlex Elder 	[MEM_BADDR]					= GENMASK(31, 16),
8862b9c009SAlex Elder };
8907f120bcSAlex Elder 
90*81772e44SAlex Elder REG_FIELDS(SHARED_MEM_SIZE, shared_mem_size, 0x00000054);
9107f120bcSAlex Elder 
92*81772e44SAlex Elder static const u32 reg_qsb_max_writes_fmask[] = {
9362b9c009SAlex Elder 	[GEN_QMB_0_MAX_WRITES]				= GENMASK(3, 0),
9462b9c009SAlex Elder 	[GEN_QMB_1_MAX_WRITES]				= GENMASK(7, 4),
9562b9c009SAlex Elder 						/* Bits 8-31 reserved */
9662b9c009SAlex Elder };
9707f120bcSAlex Elder 
98*81772e44SAlex Elder REG_FIELDS(QSB_MAX_WRITES, qsb_max_writes, 0x00000074);
9907f120bcSAlex Elder 
100*81772e44SAlex Elder static const u32 reg_qsb_max_reads_fmask[] = {
10162b9c009SAlex Elder 	[GEN_QMB_0_MAX_READS]				= GENMASK(3, 0),
10262b9c009SAlex Elder 	[GEN_QMB_1_MAX_READS]				= GENMASK(7, 4),
10362b9c009SAlex Elder 						/* Bits 8-15 reserved */
10462b9c009SAlex Elder 	[GEN_QMB_0_MAX_READS_BEATS]			= GENMASK(23, 16),
10562b9c009SAlex Elder 	[GEN_QMB_1_MAX_READS_BEATS]			= GENMASK(31, 24),
10662b9c009SAlex Elder };
10762b9c009SAlex Elder 
108*81772e44SAlex Elder REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078);
10962b9c009SAlex Elder 
110*81772e44SAlex Elder static const u32 reg_filt_rout_hash_en_fmask[] = {
11162b9c009SAlex Elder 	[IPV6_ROUTER_HASH]				= BIT(0),
11262b9c009SAlex Elder 						/* Bits 1-3 reserved */
11362b9c009SAlex Elder 	[IPV6_FILTER_HASH]				= BIT(4),
11462b9c009SAlex Elder 						/* Bits 5-7 reserved */
11562b9c009SAlex Elder 	[IPV4_ROUTER_HASH]				= BIT(8),
11662b9c009SAlex Elder 						/* Bits 9-11 reserved */
11762b9c009SAlex Elder 	[IPV4_FILTER_HASH]				= BIT(12),
11862b9c009SAlex Elder 						/* Bits 13-31 reserved */
11962b9c009SAlex Elder };
12062b9c009SAlex Elder 
121*81772e44SAlex Elder REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148);
12262b9c009SAlex Elder 
123*81772e44SAlex Elder static const u32 reg_filt_rout_hash_flush_fmask[] = {
12462b9c009SAlex Elder 	[IPV6_ROUTER_HASH]				= BIT(0),
12562b9c009SAlex Elder 						/* Bits 1-3 reserved */
12662b9c009SAlex Elder 	[IPV6_FILTER_HASH]				= BIT(4),
12762b9c009SAlex Elder 						/* Bits 5-7 reserved */
12862b9c009SAlex Elder 	[IPV4_ROUTER_HASH]				= BIT(8),
12962b9c009SAlex Elder 						/* Bits 9-11 reserved */
13062b9c009SAlex Elder 	[IPV4_FILTER_HASH]				= BIT(12),
13162b9c009SAlex Elder 						/* Bits 13-31 reserved */
13262b9c009SAlex Elder };
13362b9c009SAlex Elder 
134*81772e44SAlex Elder REG_FIELDS(FILT_ROUT_HASH_FLUSH, filt_rout_hash_flush, 0x000014c);
13507f120bcSAlex Elder 
13607f120bcSAlex Elder /* Valid bits defined by ipa->available */
137*81772e44SAlex Elder REG_STRIDE(STATE_AGGR_ACTIVE, state_aggr_active, 0x000000b4, 0x0004);
13807f120bcSAlex Elder 
139*81772e44SAlex Elder static const u32 reg_local_pkt_proc_cntxt_fmask[] = {
140b5c35fa4SAlex Elder 	[IPA_BASE_ADDR]					= GENMASK(17, 0),
141b5c35fa4SAlex Elder 						/* Bits 18-31 reserved */
142b5c35fa4SAlex Elder };
143b5c35fa4SAlex Elder 
14407f120bcSAlex Elder /* Offset must be a multiple of 8 */
145*81772e44SAlex Elder REG_FIELDS(LOCAL_PKT_PROC_CNTXT, local_pkt_proc_cntxt, 0x000001e8);
14607f120bcSAlex Elder 
14707f120bcSAlex Elder /* Valid bits defined by ipa->available */
148*81772e44SAlex Elder REG_STRIDE(AGGR_FORCE_CLOSE, aggr_force_close, 0x000001ec, 0x0004);
14907f120bcSAlex Elder 
150*81772e44SAlex Elder static const u32 reg_ipa_tx_cfg_fmask[] = {
151b5c35fa4SAlex Elder 						/* Bits 0-1 reserved */
152b5c35fa4SAlex Elder 	[PREFETCH_ALMOST_EMPTY_SIZE_TX0]		= GENMASK(5, 2),
153b5c35fa4SAlex Elder 	[DMAW_SCND_OUTSD_PRED_THRESHOLD]		= GENMASK(9, 6),
154b5c35fa4SAlex Elder 	[DMAW_SCND_OUTSD_PRED_EN]			= BIT(10),
155b5c35fa4SAlex Elder 	[DMAW_MAX_BEATS_256_DIS]			= BIT(11),
156b5c35fa4SAlex Elder 	[PA_MASK_EN]					= BIT(12),
157b5c35fa4SAlex Elder 	[PREFETCH_ALMOST_EMPTY_SIZE_TX1]		= GENMASK(16, 13),
158b5c35fa4SAlex Elder 	[DUAL_TX_ENABLE]				= BIT(17),
159b5c35fa4SAlex Elder 						/* Bits 18-31 reserved */
160b5c35fa4SAlex Elder };
161b5c35fa4SAlex Elder 
162*81772e44SAlex Elder REG_FIELDS(IPA_TX_CFG, ipa_tx_cfg, 0x000001fc);
16307f120bcSAlex Elder 
164*81772e44SAlex Elder static const u32 reg_flavor_0_fmask[] = {
1659265a4f0SAlex Elder 	[MAX_PIPES]					= GENMASK(3, 0),
1669265a4f0SAlex Elder 						/* Bits 4-7 reserved */
1679265a4f0SAlex Elder 	[MAX_CONS_PIPES]				= GENMASK(12, 8),
1689265a4f0SAlex Elder 						/* Bits 13-15 reserved */
1699265a4f0SAlex Elder 	[MAX_PROD_PIPES]				= GENMASK(20, 16),
1709265a4f0SAlex Elder 						/* Bits 21-23 reserved */
1719265a4f0SAlex Elder 	[PROD_LOWEST]					= GENMASK(27, 24),
1729265a4f0SAlex Elder 						/* Bits 28-31 reserved */
1739265a4f0SAlex Elder };
17407f120bcSAlex Elder 
175*81772e44SAlex Elder REG_FIELDS(FLAVOR_0, flavor_0, 0x00000210);
17607f120bcSAlex Elder 
177*81772e44SAlex Elder static const u32 reg_idle_indication_cfg_fmask[] = {
1789265a4f0SAlex Elder 	[ENTER_IDLE_DEBOUNCE_THRESH]			= GENMASK(15, 0),
1799265a4f0SAlex Elder 	[CONST_NON_IDLE_ENABLE]				= BIT(16),
1809265a4f0SAlex Elder 						/* Bits 17-31 reserved */
1819265a4f0SAlex Elder };
18207f120bcSAlex Elder 
183*81772e44SAlex Elder REG_FIELDS(IDLE_INDICATION_CFG, idle_indication_cfg, 0x00000240);
18407f120bcSAlex Elder 
185*81772e44SAlex Elder static const u32 reg_qtime_timestamp_cfg_fmask[] = {
1869265a4f0SAlex Elder 	[DPL_TIMESTAMP_LSB]				= GENMASK(4, 0),
1879265a4f0SAlex Elder 						/* Bits 5-6 reserved */
1889265a4f0SAlex Elder 	[DPL_TIMESTAMP_SEL]				= BIT(7),
1899265a4f0SAlex Elder 	[TAG_TIMESTAMP_LSB]				= GENMASK(12, 8),
1909265a4f0SAlex Elder 						/* Bits 13-15 reserved */
1919265a4f0SAlex Elder 	[NAT_TIMESTAMP_LSB]				= GENMASK(20, 16),
1929265a4f0SAlex Elder 						/* Bits 21-31 reserved */
1939265a4f0SAlex Elder };
1949265a4f0SAlex Elder 
195*81772e44SAlex Elder REG_FIELDS(QTIME_TIMESTAMP_CFG, qtime_timestamp_cfg, 0x0000024c);
1969265a4f0SAlex Elder 
197*81772e44SAlex Elder static const u32 reg_timers_xo_clk_div_cfg_fmask[] = {
1989265a4f0SAlex Elder 	[DIV_VALUE]					= GENMASK(8, 0),
1999265a4f0SAlex Elder 						/* Bits 9-30 reserved */
2009265a4f0SAlex Elder 	[DIV_ENABLE]					= BIT(31),
2019265a4f0SAlex Elder };
2029265a4f0SAlex Elder 
203*81772e44SAlex Elder REG_FIELDS(TIMERS_XO_CLK_DIV_CFG, timers_xo_clk_div_cfg, 0x00000250);
2049265a4f0SAlex Elder 
205*81772e44SAlex Elder static const u32 reg_timers_pulse_gran_cfg_fmask[] = {
2069265a4f0SAlex Elder 	[PULSE_GRAN_0]					= GENMASK(2, 0),
2079265a4f0SAlex Elder 	[PULSE_GRAN_1]					= GENMASK(5, 3),
2089265a4f0SAlex Elder 	[PULSE_GRAN_2]					= GENMASK(8, 6),
2099265a4f0SAlex Elder };
2109265a4f0SAlex Elder 
211*81772e44SAlex Elder REG_FIELDS(TIMERS_PULSE_GRAN_CFG, timers_pulse_gran_cfg, 0x00000254);
21207f120bcSAlex Elder 
213*81772e44SAlex Elder static const u32 reg_src_rsrc_grp_01_rsrc_type_fmask[] = {
2141c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2151c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2161c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2171c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2181c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2191c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2201c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2211c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2221c418c4aSAlex Elder };
2231c418c4aSAlex Elder 
224*81772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type,
22507f120bcSAlex Elder 		  0x00000400, 0x0020);
22607f120bcSAlex Elder 
227*81772e44SAlex Elder static const u32 reg_src_rsrc_grp_23_rsrc_type_fmask[] = {
2281c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2291c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2301c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2311c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2321c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2331c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2341c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2351c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2361c418c4aSAlex Elder };
2371c418c4aSAlex Elder 
238*81772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type,
23907f120bcSAlex Elder 		  0x00000404, 0x0020);
24007f120bcSAlex Elder 
241*81772e44SAlex Elder static const u32 reg_src_rsrc_grp_45_rsrc_type_fmask[] = {
2421c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2431c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2441c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2451c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2461c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2471c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2481c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2491c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2501c418c4aSAlex Elder };
2511c418c4aSAlex Elder 
252*81772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_45_RSRC_TYPE, src_rsrc_grp_45_rsrc_type,
25307f120bcSAlex Elder 		  0x00000408, 0x0020);
25407f120bcSAlex Elder 
255*81772e44SAlex Elder static const u32 reg_dst_rsrc_grp_01_rsrc_type_fmask[] = {
2561c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2571c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2581c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2591c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2601c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2611c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2621c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2631c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2641c418c4aSAlex Elder };
2651c418c4aSAlex Elder 
266*81772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type,
26707f120bcSAlex Elder 		  0x00000500, 0x0020);
26807f120bcSAlex Elder 
269*81772e44SAlex Elder static const u32 reg_dst_rsrc_grp_23_rsrc_type_fmask[] = {
2701c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2711c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2721c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2731c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2741c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2751c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2761c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2771c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2781c418c4aSAlex Elder };
2791c418c4aSAlex Elder 
280*81772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type,
28107f120bcSAlex Elder 		  0x00000504, 0x0020);
28207f120bcSAlex Elder 
283*81772e44SAlex Elder static const u32 reg_dst_rsrc_grp_45_rsrc_type_fmask[] = {
2841c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2851c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2861c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2871c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2881c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2891c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2901c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2911c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2921c418c4aSAlex Elder };
2931c418c4aSAlex Elder 
294*81772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_45_RSRC_TYPE, dst_rsrc_grp_45_rsrc_type,
29507f120bcSAlex Elder 		  0x00000508, 0x0020);
29607f120bcSAlex Elder 
297*81772e44SAlex Elder static const u32 reg_endp_init_cfg_fmask[] = {
2984468a344SAlex Elder 	[FRAG_OFFLOAD_EN]				= BIT(0),
2994468a344SAlex Elder 	[CS_OFFLOAD_EN]					= GENMASK(2, 1),
3004468a344SAlex Elder 	[CS_METADATA_HDR_OFFSET]			= GENMASK(6, 3),
3014468a344SAlex Elder 						/* Bit 7 reserved */
3024468a344SAlex Elder 	[CS_GEN_QMB_MASTER_SEL]				= BIT(8),
3034468a344SAlex Elder 						/* Bits 9-31 reserved */
3044468a344SAlex Elder };
30507f120bcSAlex Elder 
306*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_CFG, endp_init_cfg, 0x00000808, 0x0070);
30707f120bcSAlex Elder 
308*81772e44SAlex Elder static const u32 reg_endp_init_nat_fmask[] = {
3094468a344SAlex Elder 	[NAT_EN]					= GENMASK(1, 0),
3104468a344SAlex Elder 						/* Bits 2-31 reserved */
3114468a344SAlex Elder };
31207f120bcSAlex Elder 
313*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_NAT, endp_init_nat, 0x0000080c, 0x0070);
3144468a344SAlex Elder 
315*81772e44SAlex Elder static const u32 reg_endp_init_hdr_fmask[] = {
3164468a344SAlex Elder 	[HDR_LEN]					= GENMASK(5, 0),
3174468a344SAlex Elder 	[HDR_OFST_METADATA_VALID]			= BIT(6),
3184468a344SAlex Elder 	[HDR_OFST_METADATA]				= GENMASK(12, 7),
3194468a344SAlex Elder 	[HDR_ADDITIONAL_CONST_LEN]			= GENMASK(18, 13),
3204468a344SAlex Elder 	[HDR_OFST_PKT_SIZE_VALID]			= BIT(19),
3214468a344SAlex Elder 	[HDR_OFST_PKT_SIZE]				= GENMASK(25, 20),
3224468a344SAlex Elder 	[HDR_A5_MUX]					= BIT(26),
3234468a344SAlex Elder 	[HDR_LEN_INC_DEAGG_HDR]				= BIT(27),
3244468a344SAlex Elder 	[HDR_LEN_MSB]					= GENMASK(29, 28),
3254468a344SAlex Elder 	[HDR_OFST_METADATA_MSB]				= GENMASK(31, 30),
3264468a344SAlex Elder };
3274468a344SAlex Elder 
328*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR, endp_init_hdr, 0x00000810, 0x0070);
3294468a344SAlex Elder 
330*81772e44SAlex Elder static const u32 reg_endp_init_hdr_ext_fmask[] = {
3314468a344SAlex Elder 	[HDR_ENDIANNESS]				= BIT(0),
3324468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_VALID]			= BIT(1),
3334468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD]				= BIT(2),
3344468a344SAlex Elder 	[HDR_PAYLOAD_LEN_INC_PADDING]			= BIT(3),
3354468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_OFFSET]			= GENMASK(9, 4),
3364468a344SAlex Elder 	[HDR_PAD_TO_ALIGNMENT]				= GENMASK(13, 10),
3374468a344SAlex Elder 						/* Bits 14-15 reserved */
3384468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_OFFSET_MSB]		= GENMASK(17, 16),
3394468a344SAlex Elder 	[HDR_OFST_PKT_SIZE_MSB]				= GENMASK(19, 18),
3404468a344SAlex Elder 	[HDR_ADDITIONAL_CONST_LEN_MSB]			= GENMASK(21, 20),
3414468a344SAlex Elder 						/* Bits 22-31 reserved */
3424468a344SAlex Elder };
3434468a344SAlex Elder 
344*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR_EXT, endp_init_hdr_ext, 0x00000814, 0x0070);
34507f120bcSAlex Elder 
346*81772e44SAlex Elder REG_STRIDE(ENDP_INIT_HDR_METADATA_MASK, endp_init_hdr_metadata_mask,
34707f120bcSAlex Elder 	   0x00000818, 0x0070);
34807f120bcSAlex Elder 
349*81772e44SAlex Elder static const u32 reg_endp_init_mode_fmask[] = {
350216b409dSAlex Elder 	[ENDP_MODE]					= GENMASK(2, 0),
351216b409dSAlex Elder 	[DCPH_ENABLE]					= BIT(3),
352216b409dSAlex Elder 	[DEST_PIPE_INDEX]				= GENMASK(8, 4),
353216b409dSAlex Elder 						/* Bits 9-11 reserved */
354216b409dSAlex Elder 	[BYTE_THRESHOLD]				= GENMASK(27, 12),
355216b409dSAlex Elder 	[PIPE_REPLICATION_EN]				= BIT(28),
356216b409dSAlex Elder 	[PAD_EN]					= BIT(29),
357216b409dSAlex Elder 						/* Bits 30-31 reserved */
358216b409dSAlex Elder };
35907f120bcSAlex Elder 
360*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_MODE, endp_init_mode, 0x00000820, 0x0070);
36107f120bcSAlex Elder 
362*81772e44SAlex Elder static const u32 reg_endp_init_aggr_fmask[] = {
363216b409dSAlex Elder 	[AGGR_EN]					= GENMASK(1, 0),
364216b409dSAlex Elder 	[AGGR_TYPE]					= GENMASK(4, 2),
365216b409dSAlex Elder 	[BYTE_LIMIT]					= GENMASK(10, 5),
366216b409dSAlex Elder 						/* Bit 11 reserved */
367216b409dSAlex Elder 	[TIME_LIMIT]					= GENMASK(16, 12),
368216b409dSAlex Elder 	[PKT_LIMIT]					= GENMASK(22, 17),
369216b409dSAlex Elder 	[SW_EOF_ACTIVE]					= BIT(23),
370216b409dSAlex Elder 	[FORCE_CLOSE]					= BIT(24),
371216b409dSAlex Elder 						/* Bit 25 reserved */
372216b409dSAlex Elder 	[HARD_BYTE_LIMIT_EN]				= BIT(26),
373216b409dSAlex Elder 	[AGGR_GRAN_SEL]					= BIT(27),
374216b409dSAlex Elder 						/* Bits 28-31 reserved */
375216b409dSAlex Elder };
376216b409dSAlex Elder 
377*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_AGGR, endp_init_aggr, 0x00000824, 0x0070);
378216b409dSAlex Elder 
379*81772e44SAlex Elder static const u32 reg_endp_init_hol_block_en_fmask[] = {
380216b409dSAlex Elder 	[HOL_BLOCK_EN]					= BIT(0),
381216b409dSAlex Elder 						/* Bits 1-31 reserved */
382216b409dSAlex Elder };
383216b409dSAlex Elder 
384*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_EN, endp_init_hol_block_en,
38507f120bcSAlex Elder 		  0x0000082c, 0x0070);
38607f120bcSAlex Elder 
387*81772e44SAlex Elder static const u32 reg_endp_init_hol_block_timer_fmask[] = {
388216b409dSAlex Elder 	[TIMER_LIMIT]					= GENMASK(4, 0),
389216b409dSAlex Elder 						/* Bits 5-7 reserved */
390216b409dSAlex Elder 	[TIMER_GRAN_SEL]				= BIT(8),
391216b409dSAlex Elder 						/* Bits 9-31 reserved */
392216b409dSAlex Elder };
393216b409dSAlex Elder 
394*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_TIMER, endp_init_hol_block_timer,
39507f120bcSAlex Elder 		  0x00000830, 0x0070);
39607f120bcSAlex Elder 
397*81772e44SAlex Elder static const u32 reg_endp_init_deaggr_fmask[] = {
398181ca020SAlex Elder 	[DEAGGR_HDR_LEN]				= GENMASK(5, 0),
399181ca020SAlex Elder 	[SYSPIPE_ERR_DETECTION]				= BIT(6),
400181ca020SAlex Elder 	[PACKET_OFFSET_VALID]				= BIT(7),
401181ca020SAlex Elder 	[PACKET_OFFSET_LOCATION]			= GENMASK(13, 8),
402181ca020SAlex Elder 	[IGNORE_MIN_PKT_ERR]				= BIT(14),
403181ca020SAlex Elder 						/* Bit 15 reserved */
404181ca020SAlex Elder 	[MAX_PACKET_LEN]				= GENMASK(31, 16),
405181ca020SAlex Elder };
40607f120bcSAlex Elder 
407*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_DEAGGR, endp_init_deaggr, 0x00000834, 0x0070);
40807f120bcSAlex Elder 
409*81772e44SAlex Elder static const u32 reg_endp_init_rsrc_grp_fmask[] = {
410181ca020SAlex Elder 	[ENDP_RSRC_GRP]					= GENMASK(2, 0),
411181ca020SAlex Elder 						/* Bits 3-31 reserved */
412181ca020SAlex Elder };
41307f120bcSAlex Elder 
414*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_RSRC_GRP, endp_init_rsrc_grp, 0x00000838, 0x0070);
41507f120bcSAlex Elder 
416*81772e44SAlex Elder static const u32 reg_endp_init_seq_fmask[] = {
417181ca020SAlex Elder 	[SEQ_TYPE]					= GENMASK(7, 0),
418181ca020SAlex Elder 						/* Bits 8-31 reserved */
419181ca020SAlex Elder };
420181ca020SAlex Elder 
421*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_SEQ, endp_init_seq, 0x0000083c, 0x0070);
422181ca020SAlex Elder 
423*81772e44SAlex Elder static const u32 reg_endp_status_fmask[] = {
424181ca020SAlex Elder 	[STATUS_EN]					= BIT(0),
425181ca020SAlex Elder 	[STATUS_ENDP]					= GENMASK(5, 1),
426181ca020SAlex Elder 						/* Bits 6-8 reserved */
427181ca020SAlex Elder 	[STATUS_PKT_SUPPRESS]				= BIT(9),
428181ca020SAlex Elder 						/* Bits 10-31 reserved */
429181ca020SAlex Elder };
430181ca020SAlex Elder 
431*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_STATUS, endp_status, 0x00000840, 0x0070);
432181ca020SAlex Elder 
433*81772e44SAlex Elder static const u32 reg_endp_filter_router_hsh_cfg_fmask[] = {
434181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_ID]			= BIT(0),
435181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_IP]			= BIT(1),
436181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_IP]			= BIT(2),
437181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_PORT]			= BIT(3),
438181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_PORT]			= BIT(4),
439181ca020SAlex Elder 	[FILTER_HASH_MSK_PROTOCOL]			= BIT(5),
440181ca020SAlex Elder 	[FILTER_HASH_MSK_METADATA]			= BIT(6),
441181ca020SAlex Elder 	[FILTER_HASH_MSK_ALL]				= GENMASK(6, 0),
442181ca020SAlex Elder 						/* Bits 7-15 reserved */
443181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_ID]			= BIT(16),
444181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_IP]			= BIT(17),
445181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_IP]			= BIT(18),
446181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_PORT]			= BIT(19),
447181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_PORT]			= BIT(20),
448181ca020SAlex Elder 	[ROUTER_HASH_MSK_PROTOCOL]			= BIT(21),
449181ca020SAlex Elder 	[ROUTER_HASH_MSK_METADATA]			= BIT(22),
450181ca020SAlex Elder 	[ROUTER_HASH_MSK_ALL]				= GENMASK(22, 16),
451181ca020SAlex Elder 						/* Bits 23-31 reserved */
452181ca020SAlex Elder };
453181ca020SAlex Elder 
454*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_FILTER_ROUTER_HSH_CFG, endp_filter_router_hsh_cfg,
45507f120bcSAlex Elder 		  0x0000085c, 0x0070);
45607f120bcSAlex Elder 
45707f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
458*81772e44SAlex Elder REG(IPA_IRQ_STTS, ipa_irq_stts, 0x00003008 + 0x1000 * GSI_EE_AP);
45907f120bcSAlex Elder 
46007f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
461*81772e44SAlex Elder REG(IPA_IRQ_EN, ipa_irq_en, 0x0000300c + 0x1000 * GSI_EE_AP);
46207f120bcSAlex Elder 
46307f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
464*81772e44SAlex Elder REG(IPA_IRQ_CLR, ipa_irq_clr, 0x00003010 + 0x1000 * GSI_EE_AP);
46507f120bcSAlex Elder 
466*81772e44SAlex Elder static const u32 reg_ipa_irq_uc_fmask[] = {
467181ca020SAlex Elder 	[UC_INTR]					= BIT(0),
468181ca020SAlex Elder 						/* Bits 1-31 reserved */
469181ca020SAlex Elder };
470181ca020SAlex Elder 
471*81772e44SAlex Elder REG_FIELDS(IPA_IRQ_UC, ipa_irq_uc, 0x0000301c + 0x1000 * GSI_EE_AP);
47207f120bcSAlex Elder 
47307f120bcSAlex Elder /* Valid bits defined by ipa->available */
474*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_INFO, irq_suspend_info,
475f298ba78SAlex Elder 	   0x00003030 + 0x1000 * GSI_EE_AP, 0x0004);
47607f120bcSAlex Elder 
47707f120bcSAlex Elder /* Valid bits defined by ipa->available */
478*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_EN, irq_suspend_en,
479f298ba78SAlex Elder 	   0x00003034 + 0x1000 * GSI_EE_AP, 0x0004);
48007f120bcSAlex Elder 
48107f120bcSAlex Elder /* Valid bits defined by ipa->available */
482*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_CLR, irq_suspend_clr,
483f298ba78SAlex Elder 	   0x00003038 + 0x1000 * GSI_EE_AP, 0x0004);
48407f120bcSAlex Elder 
485*81772e44SAlex Elder static const struct reg *reg_array[] = {
486*81772e44SAlex Elder 	[COMP_CFG]			= &reg_comp_cfg,
487*81772e44SAlex Elder 	[CLKON_CFG]			= &reg_clkon_cfg,
488*81772e44SAlex Elder 	[ROUTE]				= &reg_route,
489*81772e44SAlex Elder 	[SHARED_MEM_SIZE]		= &reg_shared_mem_size,
490*81772e44SAlex Elder 	[QSB_MAX_WRITES]		= &reg_qsb_max_writes,
491*81772e44SAlex Elder 	[QSB_MAX_READS]			= &reg_qsb_max_reads,
492*81772e44SAlex Elder 	[FILT_ROUT_HASH_EN]		= &reg_filt_rout_hash_en,
493*81772e44SAlex Elder 	[FILT_ROUT_HASH_FLUSH]		= &reg_filt_rout_hash_flush,
494*81772e44SAlex Elder 	[STATE_AGGR_ACTIVE]		= &reg_state_aggr_active,
495*81772e44SAlex Elder 	[LOCAL_PKT_PROC_CNTXT]		= &reg_local_pkt_proc_cntxt,
496*81772e44SAlex Elder 	[AGGR_FORCE_CLOSE]		= &reg_aggr_force_close,
497*81772e44SAlex Elder 	[IPA_TX_CFG]			= &reg_ipa_tx_cfg,
498*81772e44SAlex Elder 	[FLAVOR_0]			= &reg_flavor_0,
499*81772e44SAlex Elder 	[IDLE_INDICATION_CFG]		= &reg_idle_indication_cfg,
500*81772e44SAlex Elder 	[QTIME_TIMESTAMP_CFG]		= &reg_qtime_timestamp_cfg,
501*81772e44SAlex Elder 	[TIMERS_XO_CLK_DIV_CFG]		= &reg_timers_xo_clk_div_cfg,
502*81772e44SAlex Elder 	[TIMERS_PULSE_GRAN_CFG]		= &reg_timers_pulse_gran_cfg,
503*81772e44SAlex Elder 	[SRC_RSRC_GRP_01_RSRC_TYPE]	= &reg_src_rsrc_grp_01_rsrc_type,
504*81772e44SAlex Elder 	[SRC_RSRC_GRP_23_RSRC_TYPE]	= &reg_src_rsrc_grp_23_rsrc_type,
505*81772e44SAlex Elder 	[SRC_RSRC_GRP_45_RSRC_TYPE]	= &reg_src_rsrc_grp_45_rsrc_type,
506*81772e44SAlex Elder 	[DST_RSRC_GRP_01_RSRC_TYPE]	= &reg_dst_rsrc_grp_01_rsrc_type,
507*81772e44SAlex Elder 	[DST_RSRC_GRP_23_RSRC_TYPE]	= &reg_dst_rsrc_grp_23_rsrc_type,
508*81772e44SAlex Elder 	[DST_RSRC_GRP_45_RSRC_TYPE]	= &reg_dst_rsrc_grp_45_rsrc_type,
509*81772e44SAlex Elder 	[ENDP_INIT_CFG]			= &reg_endp_init_cfg,
510*81772e44SAlex Elder 	[ENDP_INIT_NAT]			= &reg_endp_init_nat,
511*81772e44SAlex Elder 	[ENDP_INIT_HDR]			= &reg_endp_init_hdr,
512*81772e44SAlex Elder 	[ENDP_INIT_HDR_EXT]		= &reg_endp_init_hdr_ext,
513*81772e44SAlex Elder 	[ENDP_INIT_HDR_METADATA_MASK]	= &reg_endp_init_hdr_metadata_mask,
514*81772e44SAlex Elder 	[ENDP_INIT_MODE]		= &reg_endp_init_mode,
515*81772e44SAlex Elder 	[ENDP_INIT_AGGR]		= &reg_endp_init_aggr,
516*81772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_EN]	= &reg_endp_init_hol_block_en,
517*81772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_TIMER]	= &reg_endp_init_hol_block_timer,
518*81772e44SAlex Elder 	[ENDP_INIT_DEAGGR]		= &reg_endp_init_deaggr,
519*81772e44SAlex Elder 	[ENDP_INIT_RSRC_GRP]		= &reg_endp_init_rsrc_grp,
520*81772e44SAlex Elder 	[ENDP_INIT_SEQ]			= &reg_endp_init_seq,
521*81772e44SAlex Elder 	[ENDP_STATUS]			= &reg_endp_status,
522*81772e44SAlex Elder 	[ENDP_FILTER_ROUTER_HSH_CFG]	= &reg_endp_filter_router_hsh_cfg,
523*81772e44SAlex Elder 	[IPA_IRQ_STTS]			= &reg_ipa_irq_stts,
524*81772e44SAlex Elder 	[IPA_IRQ_EN]			= &reg_ipa_irq_en,
525*81772e44SAlex Elder 	[IPA_IRQ_CLR]			= &reg_ipa_irq_clr,
526*81772e44SAlex Elder 	[IPA_IRQ_UC]			= &reg_ipa_irq_uc,
527*81772e44SAlex Elder 	[IRQ_SUSPEND_INFO]		= &reg_irq_suspend_info,
528*81772e44SAlex Elder 	[IRQ_SUSPEND_EN]		= &reg_irq_suspend_en,
529*81772e44SAlex Elder 	[IRQ_SUSPEND_CLR]		= &reg_irq_suspend_clr,
53007f120bcSAlex Elder };
53107f120bcSAlex Elder 
532*81772e44SAlex Elder const struct regs ipa_regs_v4_5 = {
533*81772e44SAlex Elder 	.reg_count	= ARRAY_SIZE(reg_array),
534*81772e44SAlex Elder 	.reg		= reg_array,
53507f120bcSAlex Elder };
536