xref: /openbmc/linux/drivers/net/ipa/reg/ipa_reg-v4.11.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 	[RAM_ARB_PRI_CLIENT_SAMP_FIX_DIS]		= BIT(0),
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 	[FULL_FLUSH_WAIT_RS_CLOSURE_EN]			= BIT(17),
2912c7ea7dSAlex Elder 						/* Bit 18 reserved */
3012c7ea7dSAlex Elder 	[QMB_RAM_RD_CACHE_DISABLE]			= BIT(19),
3112c7ea7dSAlex Elder 	[GENQMB_AOOOWR]					= BIT(20),
3212c7ea7dSAlex Elder 	[IF_OUT_OF_BUF_STOP_RESET_MASK_EN]		= BIT(21),
3312c7ea7dSAlex Elder 	[ATOMIC_FETCHER_ARB_LOCK_DIS]			= GENMASK(23, 22),
3412c7ea7dSAlex Elder 						/* Bits 24-29 reserved */
3512c7ea7dSAlex Elder 	[GEN_QMB_1_DYNAMIC_ASIZE]			= BIT(30),
3612c7ea7dSAlex Elder 	[GEN_QMB_0_DYNAMIC_ASIZE]			= BIT(31),
3712c7ea7dSAlex Elder };
3812c7ea7dSAlex Elder 
39*81772e44SAlex Elder REG_FIELDS(COMP_CFG, comp_cfg, 0x0000003c);
4007f120bcSAlex Elder 
41*81772e44SAlex Elder static const u32 reg_clkon_cfg_fmask[] = {
42479deb32SAlex Elder 	[CLKON_RX]					= BIT(0),
43479deb32SAlex Elder 	[CLKON_PROC]					= BIT(1),
44479deb32SAlex Elder 	[TX_WRAPPER]					= BIT(2),
45479deb32SAlex Elder 	[CLKON_MISC]					= BIT(3),
46479deb32SAlex Elder 	[RAM_ARB]					= BIT(4),
47479deb32SAlex Elder 	[FTCH_HPS]					= BIT(5),
48479deb32SAlex Elder 	[FTCH_DPS]					= BIT(6),
49479deb32SAlex Elder 	[CLKON_HPS]					= BIT(7),
50479deb32SAlex Elder 	[CLKON_DPS]					= BIT(8),
51479deb32SAlex Elder 	[RX_HPS_CMDQS]					= BIT(9),
52479deb32SAlex Elder 	[HPS_DPS_CMDQS]					= BIT(10),
53479deb32SAlex Elder 	[DPS_TX_CMDQS]					= BIT(11),
54479deb32SAlex Elder 	[RSRC_MNGR]					= BIT(12),
55479deb32SAlex Elder 	[CTX_HANDLER]					= BIT(13),
56479deb32SAlex Elder 	[ACK_MNGR]					= BIT(14),
57479deb32SAlex Elder 	[D_DCPH]					= BIT(15),
58479deb32SAlex Elder 	[H_DCPH]					= BIT(16),
59479deb32SAlex Elder 						/* Bit 17 reserved */
60479deb32SAlex Elder 	[NTF_TX_CMDQS]					= BIT(18),
61479deb32SAlex Elder 	[CLKON_TX_0]					= BIT(19),
62479deb32SAlex Elder 	[CLKON_TX_1]					= BIT(20),
63479deb32SAlex Elder 	[CLKON_FNR]					= BIT(21),
64479deb32SAlex Elder 	[QSB2AXI_CMDQ_L]				= BIT(22),
65479deb32SAlex Elder 	[AGGR_WRAPPER]					= BIT(23),
66479deb32SAlex Elder 	[RAM_SLAVEWAY]					= BIT(24),
67479deb32SAlex Elder 	[CLKON_QMB]					= BIT(25),
68479deb32SAlex Elder 	[WEIGHT_ARB]					= BIT(26),
69479deb32SAlex Elder 	[GSI_IF]					= BIT(27),
70479deb32SAlex Elder 	[CLKON_GLOBAL]					= BIT(28),
71479deb32SAlex Elder 	[GLOBAL_2X_CLK]					= BIT(29),
72479deb32SAlex Elder 	[DPL_FIFO]					= BIT(30),
73479deb32SAlex Elder 	[DRBIP]						= BIT(31),
74479deb32SAlex Elder };
7507f120bcSAlex Elder 
76*81772e44SAlex Elder REG_FIELDS(CLKON_CFG, clkon_cfg, 0x00000044);
77479deb32SAlex Elder 
78*81772e44SAlex Elder static const u32 reg_route_fmask[] = {
79479deb32SAlex Elder 	[ROUTE_DIS]					= BIT(0),
80479deb32SAlex Elder 	[ROUTE_DEF_PIPE]				= GENMASK(5, 1),
81479deb32SAlex Elder 	[ROUTE_DEF_HDR_TABLE]				= BIT(6),
82479deb32SAlex Elder 	[ROUTE_DEF_HDR_OFST]				= GENMASK(16, 7),
83479deb32SAlex Elder 	[ROUTE_FRAG_DEF_PIPE]				= GENMASK(21, 17),
84479deb32SAlex Elder 						/* Bits 22-23 reserved */
85479deb32SAlex Elder 	[ROUTE_DEF_RETAIN_HDR]				= BIT(24),
86479deb32SAlex Elder 						/* Bits 25-31 reserved */
87479deb32SAlex Elder };
88479deb32SAlex Elder 
89*81772e44SAlex Elder REG_FIELDS(ROUTE, route, 0x00000048);
9007f120bcSAlex Elder 
91*81772e44SAlex Elder static const u32 reg_shared_mem_size_fmask[] = {
9262b9c009SAlex Elder 	[MEM_SIZE]					= GENMASK(15, 0),
9362b9c009SAlex Elder 	[MEM_BADDR]					= GENMASK(31, 16),
9462b9c009SAlex Elder };
9507f120bcSAlex Elder 
96*81772e44SAlex Elder REG_FIELDS(SHARED_MEM_SIZE, shared_mem_size, 0x00000054);
9707f120bcSAlex Elder 
98*81772e44SAlex Elder static const u32 reg_qsb_max_writes_fmask[] = {
9962b9c009SAlex Elder 	[GEN_QMB_0_MAX_WRITES]				= GENMASK(3, 0),
10062b9c009SAlex Elder 	[GEN_QMB_1_MAX_WRITES]				= GENMASK(7, 4),
10162b9c009SAlex Elder 						/* Bits 8-31 reserved */
10262b9c009SAlex Elder };
10307f120bcSAlex Elder 
104*81772e44SAlex Elder REG_FIELDS(QSB_MAX_WRITES, qsb_max_writes, 0x00000074);
10507f120bcSAlex Elder 
106*81772e44SAlex Elder static const u32 reg_qsb_max_reads_fmask[] = {
10762b9c009SAlex Elder 	[GEN_QMB_0_MAX_READS]				= GENMASK(3, 0),
10862b9c009SAlex Elder 	[GEN_QMB_1_MAX_READS]				= GENMASK(7, 4),
10962b9c009SAlex Elder 						/* Bits 8-15 reserved */
11062b9c009SAlex Elder 	[GEN_QMB_0_MAX_READS_BEATS]			= GENMASK(23, 16),
11162b9c009SAlex Elder 	[GEN_QMB_1_MAX_READS_BEATS]			= GENMASK(31, 24),
11262b9c009SAlex Elder };
11362b9c009SAlex Elder 
114*81772e44SAlex Elder REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078);
11562b9c009SAlex Elder 
116*81772e44SAlex Elder static const u32 reg_filt_rout_hash_en_fmask[] = {
11762b9c009SAlex Elder 	[IPV6_ROUTER_HASH]				= BIT(0),
11862b9c009SAlex Elder 						/* Bits 1-3 reserved */
11962b9c009SAlex Elder 	[IPV6_FILTER_HASH]				= BIT(4),
12062b9c009SAlex Elder 						/* Bits 5-7 reserved */
12162b9c009SAlex Elder 	[IPV4_ROUTER_HASH]				= BIT(8),
12262b9c009SAlex Elder 						/* Bits 9-11 reserved */
12362b9c009SAlex Elder 	[IPV4_FILTER_HASH]				= BIT(12),
12462b9c009SAlex Elder 						/* Bits 13-31 reserved */
12562b9c009SAlex Elder };
12662b9c009SAlex Elder 
127*81772e44SAlex Elder REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148);
12862b9c009SAlex Elder 
129*81772e44SAlex Elder static const u32 reg_filt_rout_hash_flush_fmask[] = {
13062b9c009SAlex Elder 	[IPV6_ROUTER_HASH]				= BIT(0),
13162b9c009SAlex Elder 						/* Bits 1-3 reserved */
13262b9c009SAlex Elder 	[IPV6_FILTER_HASH]				= BIT(4),
13362b9c009SAlex Elder 						/* Bits 5-7 reserved */
13462b9c009SAlex Elder 	[IPV4_ROUTER_HASH]				= BIT(8),
13562b9c009SAlex Elder 						/* Bits 9-11 reserved */
13662b9c009SAlex Elder 	[IPV4_FILTER_HASH]				= BIT(12),
13762b9c009SAlex Elder 						/* Bits 13-31 reserved */
13862b9c009SAlex Elder };
13962b9c009SAlex Elder 
140*81772e44SAlex Elder REG_FIELDS(FILT_ROUT_HASH_FLUSH, filt_rout_hash_flush, 0x000014c);
14107f120bcSAlex Elder 
14207f120bcSAlex Elder /* Valid bits defined by ipa->available */
143*81772e44SAlex Elder REG_STRIDE(STATE_AGGR_ACTIVE, state_aggr_active, 0x000000b4, 0x0004);
14407f120bcSAlex Elder 
145*81772e44SAlex Elder static const u32 reg_local_pkt_proc_cntxt_fmask[] = {
146b5c35fa4SAlex Elder 	[IPA_BASE_ADDR]					= GENMASK(17, 0),
147b5c35fa4SAlex Elder 						/* Bits 18-31 reserved */
148b5c35fa4SAlex Elder };
149b5c35fa4SAlex Elder 
15007f120bcSAlex Elder /* Offset must be a multiple of 8 */
151*81772e44SAlex Elder REG_FIELDS(LOCAL_PKT_PROC_CNTXT, local_pkt_proc_cntxt, 0x000001e8);
15207f120bcSAlex Elder 
15307f120bcSAlex Elder /* Valid bits defined by ipa->available */
154*81772e44SAlex Elder REG_STRIDE(AGGR_FORCE_CLOSE, aggr_force_close, 0x000001ec, 0x0004);
15507f120bcSAlex Elder 
156*81772e44SAlex Elder static const u32 reg_ipa_tx_cfg_fmask[] = {
157b5c35fa4SAlex Elder 						/* Bits 0-1 reserved */
158b5c35fa4SAlex Elder 	[PREFETCH_ALMOST_EMPTY_SIZE_TX0]		= GENMASK(5, 2),
159b5c35fa4SAlex Elder 	[DMAW_SCND_OUTSD_PRED_THRESHOLD]		= GENMASK(9, 6),
160b5c35fa4SAlex Elder 	[DMAW_SCND_OUTSD_PRED_EN]			= BIT(10),
161b5c35fa4SAlex Elder 	[DMAW_MAX_BEATS_256_DIS]			= BIT(11),
162b5c35fa4SAlex Elder 	[PA_MASK_EN]					= BIT(12),
163b5c35fa4SAlex Elder 	[PREFETCH_ALMOST_EMPTY_SIZE_TX1]		= GENMASK(16, 13),
164b5c35fa4SAlex Elder 	[DUAL_TX_ENABLE]				= BIT(17),
165b5c35fa4SAlex Elder 	[SSPND_PA_NO_START_STATE]			= BIT(18),
166b5c35fa4SAlex Elder 						/* Bits 19-31 reserved */
167b5c35fa4SAlex Elder };
168b5c35fa4SAlex Elder 
169*81772e44SAlex Elder REG_FIELDS(IPA_TX_CFG, ipa_tx_cfg, 0x000001fc);
17007f120bcSAlex Elder 
171*81772e44SAlex Elder static const u32 reg_flavor_0_fmask[] = {
1729265a4f0SAlex Elder 	[MAX_PIPES]					= GENMASK(4, 0),
1739265a4f0SAlex Elder 						/* Bits 5-7 reserved */
1749265a4f0SAlex Elder 	[MAX_CONS_PIPES]				= GENMASK(12, 8),
1759265a4f0SAlex Elder 						/* Bits 13-15 reserved */
1769265a4f0SAlex Elder 	[MAX_PROD_PIPES]				= GENMASK(20, 16),
1779265a4f0SAlex Elder 						/* Bits 21-23 reserved */
1789265a4f0SAlex Elder 	[PROD_LOWEST]					= GENMASK(27, 24),
1799265a4f0SAlex Elder 						/* Bits 28-31 reserved */
1809265a4f0SAlex Elder };
18107f120bcSAlex Elder 
182*81772e44SAlex Elder REG_FIELDS(FLAVOR_0, flavor_0, 0x00000210);
18307f120bcSAlex Elder 
184*81772e44SAlex Elder static const u32 reg_idle_indication_cfg_fmask[] = {
1859265a4f0SAlex Elder 	[ENTER_IDLE_DEBOUNCE_THRESH]			= GENMASK(15, 0),
1869265a4f0SAlex Elder 	[CONST_NON_IDLE_ENABLE]				= BIT(16),
1879265a4f0SAlex Elder 						/* Bits 17-31 reserved */
1889265a4f0SAlex Elder };
18907f120bcSAlex Elder 
190*81772e44SAlex Elder REG_FIELDS(IDLE_INDICATION_CFG, idle_indication_cfg, 0x00000240);
19107f120bcSAlex Elder 
192*81772e44SAlex Elder static const u32 reg_qtime_timestamp_cfg_fmask[] = {
1939265a4f0SAlex Elder 	[DPL_TIMESTAMP_LSB]				= GENMASK(4, 0),
1949265a4f0SAlex Elder 						/* Bits 5-6 reserved */
1959265a4f0SAlex Elder 	[DPL_TIMESTAMP_SEL]				= BIT(7),
1969265a4f0SAlex Elder 	[TAG_TIMESTAMP_LSB]				= GENMASK(12, 8),
1979265a4f0SAlex Elder 						/* Bits 13-15 reserved */
1989265a4f0SAlex Elder 	[NAT_TIMESTAMP_LSB]				= GENMASK(20, 16),
1999265a4f0SAlex Elder 						/* Bits 21-31 reserved */
2009265a4f0SAlex Elder };
2019265a4f0SAlex Elder 
202*81772e44SAlex Elder REG_FIELDS(QTIME_TIMESTAMP_CFG, qtime_timestamp_cfg, 0x0000024c);
2039265a4f0SAlex Elder 
204*81772e44SAlex Elder static const u32 reg_timers_xo_clk_div_cfg_fmask[] = {
2059265a4f0SAlex Elder 	[DIV_VALUE]					= GENMASK(8, 0),
2069265a4f0SAlex Elder 						/* Bits 9-30 reserved */
2079265a4f0SAlex Elder 	[DIV_ENABLE]					= BIT(31),
2089265a4f0SAlex Elder };
2099265a4f0SAlex Elder 
210*81772e44SAlex Elder REG_FIELDS(TIMERS_XO_CLK_DIV_CFG, timers_xo_clk_div_cfg, 0x00000250);
2119265a4f0SAlex Elder 
212*81772e44SAlex Elder static const u32 reg_timers_pulse_gran_cfg_fmask[] = {
2139265a4f0SAlex Elder 	[PULSE_GRAN_0]					= GENMASK(2, 0),
2149265a4f0SAlex Elder 	[PULSE_GRAN_1]					= GENMASK(5, 3),
2159265a4f0SAlex Elder 	[PULSE_GRAN_2]					= GENMASK(8, 6),
2169265a4f0SAlex Elder 						/* Bits 9-31 reserved */
2179265a4f0SAlex Elder };
2189265a4f0SAlex Elder 
219*81772e44SAlex Elder REG_FIELDS(TIMERS_PULSE_GRAN_CFG, timers_pulse_gran_cfg, 0x00000254);
22007f120bcSAlex Elder 
221*81772e44SAlex Elder static const u32 reg_src_rsrc_grp_01_rsrc_type_fmask[] = {
2221c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2231c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2241c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2251c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2261c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2271c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2281c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2291c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2301c418c4aSAlex Elder };
2311c418c4aSAlex Elder 
232*81772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type,
23307f120bcSAlex Elder 		  0x00000400, 0x0020);
23407f120bcSAlex Elder 
235*81772e44SAlex Elder static const u32 reg_src_rsrc_grp_23_rsrc_type_fmask[] = {
2361c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2371c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2381c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2391c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2401c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2411c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2421c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2431c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2441c418c4aSAlex Elder };
2451c418c4aSAlex Elder 
246*81772e44SAlex Elder REG_STRIDE_FIELDS(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type,
24707f120bcSAlex Elder 		  0x00000404, 0x0020);
24807f120bcSAlex Elder 
249*81772e44SAlex Elder static const u32 reg_dst_rsrc_grp_01_rsrc_type_fmask[] = {
2501c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2511c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2521c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2531c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2541c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2551c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2561c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2571c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2581c418c4aSAlex Elder };
2591c418c4aSAlex Elder 
260*81772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type,
26107f120bcSAlex Elder 		  0x00000500, 0x0020);
26207f120bcSAlex Elder 
263*81772e44SAlex Elder static const u32 reg_dst_rsrc_grp_23_rsrc_type_fmask[] = {
2641c418c4aSAlex Elder 	[X_MIN_LIM]					= GENMASK(5, 0),
2651c418c4aSAlex Elder 						/* Bits 6-7 reserved */
2661c418c4aSAlex Elder 	[X_MAX_LIM]					= GENMASK(13, 8),
2671c418c4aSAlex Elder 						/* Bits 14-15 reserved */
2681c418c4aSAlex Elder 	[Y_MIN_LIM]					= GENMASK(21, 16),
2691c418c4aSAlex Elder 						/* Bits 22-23 reserved */
2701c418c4aSAlex Elder 	[Y_MAX_LIM]					= GENMASK(29, 24),
2711c418c4aSAlex Elder 						/* Bits 30-31 reserved */
2721c418c4aSAlex Elder };
2731c418c4aSAlex Elder 
274*81772e44SAlex Elder REG_STRIDE_FIELDS(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type,
27507f120bcSAlex Elder 		  0x00000504, 0x0020);
27607f120bcSAlex Elder 
277*81772e44SAlex Elder static const u32 reg_endp_init_cfg_fmask[] = {
2784468a344SAlex Elder 	[FRAG_OFFLOAD_EN]				= BIT(0),
2794468a344SAlex Elder 	[CS_OFFLOAD_EN]					= GENMASK(2, 1),
2804468a344SAlex Elder 	[CS_METADATA_HDR_OFFSET]			= GENMASK(6, 3),
2814468a344SAlex Elder 						/* Bit 7 reserved */
2824468a344SAlex Elder 	[CS_GEN_QMB_MASTER_SEL]				= BIT(8),
2834468a344SAlex Elder 						/* Bits 9-31 reserved */
2844468a344SAlex Elder };
28507f120bcSAlex Elder 
286*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_CFG, endp_init_cfg, 0x00000808, 0x0070);
28707f120bcSAlex Elder 
288*81772e44SAlex Elder static const u32 reg_endp_init_nat_fmask[] = {
2894468a344SAlex Elder 	[NAT_EN]					= GENMASK(1, 0),
2904468a344SAlex Elder 						/* Bits 2-31 reserved */
2914468a344SAlex Elder };
29207f120bcSAlex Elder 
293*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_NAT, endp_init_nat, 0x0000080c, 0x0070);
2944468a344SAlex Elder 
295*81772e44SAlex Elder static const u32 reg_endp_init_hdr_fmask[] = {
2964468a344SAlex Elder 	[HDR_LEN]					= GENMASK(5, 0),
2974468a344SAlex Elder 	[HDR_OFST_METADATA_VALID]			= BIT(6),
2984468a344SAlex Elder 	[HDR_OFST_METADATA]				= GENMASK(12, 7),
2994468a344SAlex Elder 	[HDR_ADDITIONAL_CONST_LEN]			= GENMASK(18, 13),
3004468a344SAlex Elder 	[HDR_OFST_PKT_SIZE_VALID]			= BIT(19),
3014468a344SAlex Elder 	[HDR_OFST_PKT_SIZE]				= GENMASK(25, 20),
3024468a344SAlex Elder 						/* Bit 26 reserved */
3034468a344SAlex Elder 	[HDR_LEN_INC_DEAGG_HDR]				= BIT(27),
3044468a344SAlex Elder 	[HDR_LEN_MSB]					= GENMASK(29, 28),
3054468a344SAlex Elder 	[HDR_OFST_METADATA_MSB]				= GENMASK(31, 30),
3064468a344SAlex Elder };
3074468a344SAlex Elder 
308*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR, endp_init_hdr, 0x00000810, 0x0070);
3094468a344SAlex Elder 
310*81772e44SAlex Elder static const u32 reg_endp_init_hdr_ext_fmask[] = {
3114468a344SAlex Elder 	[HDR_ENDIANNESS]				= BIT(0),
3124468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_VALID]			= BIT(1),
3134468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD]				= BIT(2),
3144468a344SAlex Elder 	[HDR_PAYLOAD_LEN_INC_PADDING]			= BIT(3),
3154468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_OFFSET]			= GENMASK(9, 4),
3164468a344SAlex Elder 	[HDR_PAD_TO_ALIGNMENT]				= GENMASK(13, 10),
3174468a344SAlex Elder 						/* Bits 14-15 reserved */
3184468a344SAlex Elder 	[HDR_TOTAL_LEN_OR_PAD_OFFSET_MSB]		= GENMASK(17, 16),
3194468a344SAlex Elder 	[HDR_OFST_PKT_SIZE_MSB]				= GENMASK(19, 18),
3204468a344SAlex Elder 	[HDR_ADDITIONAL_CONST_LEN_MSB]			= GENMASK(21, 20),
3214468a344SAlex Elder 						/* Bits 22-31 reserved */
3224468a344SAlex Elder };
3234468a344SAlex Elder 
324*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HDR_EXT, endp_init_hdr_ext, 0x00000814, 0x0070);
32507f120bcSAlex Elder 
326*81772e44SAlex Elder REG_STRIDE(ENDP_INIT_HDR_METADATA_MASK, endp_init_hdr_metadata_mask,
32707f120bcSAlex Elder 	   0x00000818, 0x0070);
32807f120bcSAlex Elder 
329*81772e44SAlex Elder static const u32 reg_endp_init_mode_fmask[] = {
330216b409dSAlex Elder 	[ENDP_MODE]					= GENMASK(2, 0),
331216b409dSAlex Elder 	[DCPH_ENABLE]					= BIT(3),
332216b409dSAlex Elder 	[DEST_PIPE_INDEX]				= GENMASK(8, 4),
333216b409dSAlex Elder 						/* Bits 9-11 reserved */
334216b409dSAlex Elder 	[BYTE_THRESHOLD]				= GENMASK(27, 12),
335216b409dSAlex Elder 	[PIPE_REPLICATION_EN]				= BIT(28),
336216b409dSAlex Elder 	[PAD_EN]					= BIT(29),
337216b409dSAlex Elder 	[DRBIP_ACL_ENABLE]				= BIT(30),
338216b409dSAlex Elder 						/* Bit 31 reserved */
339216b409dSAlex Elder };
34007f120bcSAlex Elder 
341*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_MODE, endp_init_mode, 0x00000820, 0x0070);
34207f120bcSAlex Elder 
343*81772e44SAlex Elder static const u32 reg_endp_init_aggr_fmask[] = {
344216b409dSAlex Elder 	[AGGR_EN]					= GENMASK(1, 0),
345216b409dSAlex Elder 	[AGGR_TYPE]					= GENMASK(4, 2),
346216b409dSAlex Elder 	[BYTE_LIMIT]					= GENMASK(10, 5),
347216b409dSAlex Elder 						/* Bit 11 reserved */
348216b409dSAlex Elder 	[TIME_LIMIT]					= GENMASK(16, 12),
349216b409dSAlex Elder 	[PKT_LIMIT]					= GENMASK(22, 17),
350216b409dSAlex Elder 	[SW_EOF_ACTIVE]					= BIT(23),
351216b409dSAlex Elder 	[FORCE_CLOSE]					= BIT(24),
352216b409dSAlex Elder 						/* Bit 25 reserved */
353216b409dSAlex Elder 	[HARD_BYTE_LIMIT_EN]				= BIT(26),
354216b409dSAlex Elder 	[AGGR_GRAN_SEL]					= BIT(27),
355216b409dSAlex Elder 						/* Bits 28-31 reserved */
356216b409dSAlex Elder };
357216b409dSAlex Elder 
358*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_AGGR, endp_init_aggr, 0x00000824, 0x0070);
359216b409dSAlex Elder 
360*81772e44SAlex Elder static const u32 reg_endp_init_hol_block_en_fmask[] = {
361216b409dSAlex Elder 	[HOL_BLOCK_EN]					= BIT(0),
362216b409dSAlex Elder 						/* Bits 1-31 reserved */
363216b409dSAlex Elder };
364216b409dSAlex Elder 
365*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_EN, endp_init_hol_block_en,
36607f120bcSAlex Elder 		  0x0000082c, 0x0070);
36707f120bcSAlex Elder 
368*81772e44SAlex Elder static const u32 reg_endp_init_hol_block_timer_fmask[] = {
369216b409dSAlex Elder 	[TIMER_LIMIT]					= GENMASK(4, 0),
370216b409dSAlex Elder 						/* Bits 5-7 reserved */
371216b409dSAlex Elder 	[TIMER_GRAN_SEL]				= BIT(8),
372216b409dSAlex Elder 						/* Bits 9-31 reserved */
373216b409dSAlex Elder };
374216b409dSAlex Elder 
375*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_TIMER, endp_init_hol_block_timer,
37607f120bcSAlex Elder 		  0x00000830, 0x0070);
37707f120bcSAlex Elder 
378*81772e44SAlex Elder static const u32 reg_endp_init_deaggr_fmask[] = {
379181ca020SAlex Elder 	[DEAGGR_HDR_LEN]				= GENMASK(5, 0),
380181ca020SAlex Elder 	[SYSPIPE_ERR_DETECTION]				= BIT(6),
381181ca020SAlex Elder 	[PACKET_OFFSET_VALID]				= BIT(7),
382181ca020SAlex Elder 	[PACKET_OFFSET_LOCATION]			= GENMASK(13, 8),
383181ca020SAlex Elder 	[IGNORE_MIN_PKT_ERR]				= BIT(14),
384181ca020SAlex Elder 						/* Bit 15 reserved */
385181ca020SAlex Elder 	[MAX_PACKET_LEN]				= GENMASK(31, 16),
386181ca020SAlex Elder };
38707f120bcSAlex Elder 
388*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_DEAGGR, endp_init_deaggr, 0x00000834, 0x0070);
38907f120bcSAlex Elder 
390*81772e44SAlex Elder static const u32 reg_endp_init_rsrc_grp_fmask[] = {
391181ca020SAlex Elder 	[ENDP_RSRC_GRP]					= GENMASK(1, 0),
392181ca020SAlex Elder 						/* Bits 2-31 reserved */
393181ca020SAlex Elder };
39407f120bcSAlex Elder 
395*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_RSRC_GRP, endp_init_rsrc_grp, 0x00000838, 0x0070);
39607f120bcSAlex Elder 
397*81772e44SAlex Elder static const u32 reg_endp_init_seq_fmask[] = {
398181ca020SAlex Elder 	[SEQ_TYPE]					= GENMASK(7, 0),
399181ca020SAlex Elder 						/* Bits 8-31 reserved */
400181ca020SAlex Elder };
401181ca020SAlex Elder 
402*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_INIT_SEQ, endp_init_seq, 0x0000083c, 0x0070);
403181ca020SAlex Elder 
404*81772e44SAlex Elder static const u32 reg_endp_status_fmask[] = {
405181ca020SAlex Elder 	[STATUS_EN]					= BIT(0),
406181ca020SAlex Elder 	[STATUS_ENDP]					= GENMASK(5, 1),
407181ca020SAlex Elder 						/* Bits 6-8 reserved */
408181ca020SAlex Elder 	[STATUS_PKT_SUPPRESS]				= BIT(9),
409181ca020SAlex Elder 						/* Bits 10-31 reserved */
410181ca020SAlex Elder };
411181ca020SAlex Elder 
412*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_STATUS, endp_status, 0x00000840, 0x0070);
413181ca020SAlex Elder 
414*81772e44SAlex Elder static const u32 reg_endp_filter_router_hsh_cfg_fmask[] = {
415181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_ID]			= BIT(0),
416181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_IP]			= BIT(1),
417181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_IP]			= BIT(2),
418181ca020SAlex Elder 	[FILTER_HASH_MSK_SRC_PORT]			= BIT(3),
419181ca020SAlex Elder 	[FILTER_HASH_MSK_DST_PORT]			= BIT(4),
420181ca020SAlex Elder 	[FILTER_HASH_MSK_PROTOCOL]			= BIT(5),
421181ca020SAlex Elder 	[FILTER_HASH_MSK_METADATA]			= BIT(6),
422181ca020SAlex Elder 	[FILTER_HASH_MSK_ALL]				= GENMASK(6, 0),
423181ca020SAlex Elder 						/* Bits 7-15 reserved */
424181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_ID]			= BIT(16),
425181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_IP]			= BIT(17),
426181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_IP]			= BIT(18),
427181ca020SAlex Elder 	[ROUTER_HASH_MSK_SRC_PORT]			= BIT(19),
428181ca020SAlex Elder 	[ROUTER_HASH_MSK_DST_PORT]			= BIT(20),
429181ca020SAlex Elder 	[ROUTER_HASH_MSK_PROTOCOL]			= BIT(21),
430181ca020SAlex Elder 	[ROUTER_HASH_MSK_METADATA]			= BIT(22),
431181ca020SAlex Elder 	[ROUTER_HASH_MSK_ALL]				= GENMASK(22, 16),
432181ca020SAlex Elder 						/* Bits 23-31 reserved */
433181ca020SAlex Elder };
434181ca020SAlex Elder 
435*81772e44SAlex Elder REG_STRIDE_FIELDS(ENDP_FILTER_ROUTER_HSH_CFG, endp_filter_router_hsh_cfg,
43607f120bcSAlex Elder 		  0x0000085c, 0x0070);
43707f120bcSAlex Elder 
43807f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
439*81772e44SAlex Elder REG(IPA_IRQ_STTS, ipa_irq_stts, 0x00004008 + 0x1000 * GSI_EE_AP);
44007f120bcSAlex Elder 
44107f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
442*81772e44SAlex Elder REG(IPA_IRQ_EN, ipa_irq_en, 0x0000400c + 0x1000 * GSI_EE_AP);
44307f120bcSAlex Elder 
44407f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
445*81772e44SAlex Elder REG(IPA_IRQ_CLR, ipa_irq_clr, 0x00004010 + 0x1000 * GSI_EE_AP);
44607f120bcSAlex Elder 
447*81772e44SAlex Elder static const u32 reg_ipa_irq_uc_fmask[] = {
448181ca020SAlex Elder 	[UC_INTR]					= BIT(0),
449181ca020SAlex Elder 						/* Bits 1-31 reserved */
450181ca020SAlex Elder };
451181ca020SAlex Elder 
452*81772e44SAlex Elder REG_FIELDS(IPA_IRQ_UC, ipa_irq_uc, 0x0000401c + 0x1000 * GSI_EE_AP);
45307f120bcSAlex Elder 
45407f120bcSAlex Elder /* Valid bits defined by ipa->available */
455*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_INFO, irq_suspend_info,
456f298ba78SAlex Elder 	   0x00004030 + 0x1000 * GSI_EE_AP, 0x0004);
45707f120bcSAlex Elder 
45807f120bcSAlex Elder /* Valid bits defined by ipa->available */
459*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_EN, irq_suspend_en,
460f298ba78SAlex Elder 	   0x00004034 + 0x1000 * GSI_EE_AP, 0x0004);
46107f120bcSAlex Elder 
46207f120bcSAlex Elder /* Valid bits defined by ipa->available */
463*81772e44SAlex Elder REG_STRIDE(IRQ_SUSPEND_CLR, irq_suspend_clr,
464f298ba78SAlex Elder 	   0x00004038 + 0x1000 * GSI_EE_AP, 0x0004);
46507f120bcSAlex Elder 
466*81772e44SAlex Elder static const struct reg *reg_array[] = {
467*81772e44SAlex Elder 	[COMP_CFG]			= &reg_comp_cfg,
468*81772e44SAlex Elder 	[CLKON_CFG]			= &reg_clkon_cfg,
469*81772e44SAlex Elder 	[ROUTE]				= &reg_route,
470*81772e44SAlex Elder 	[SHARED_MEM_SIZE]		= &reg_shared_mem_size,
471*81772e44SAlex Elder 	[QSB_MAX_WRITES]		= &reg_qsb_max_writes,
472*81772e44SAlex Elder 	[QSB_MAX_READS]			= &reg_qsb_max_reads,
473*81772e44SAlex Elder 	[FILT_ROUT_HASH_EN]		= &reg_filt_rout_hash_en,
474*81772e44SAlex Elder 	[FILT_ROUT_HASH_FLUSH]		= &reg_filt_rout_hash_flush,
475*81772e44SAlex Elder 	[STATE_AGGR_ACTIVE]		= &reg_state_aggr_active,
476*81772e44SAlex Elder 	[LOCAL_PKT_PROC_CNTXT]		= &reg_local_pkt_proc_cntxt,
477*81772e44SAlex Elder 	[AGGR_FORCE_CLOSE]		= &reg_aggr_force_close,
478*81772e44SAlex Elder 	[IPA_TX_CFG]			= &reg_ipa_tx_cfg,
479*81772e44SAlex Elder 	[FLAVOR_0]			= &reg_flavor_0,
480*81772e44SAlex Elder 	[IDLE_INDICATION_CFG]		= &reg_idle_indication_cfg,
481*81772e44SAlex Elder 	[QTIME_TIMESTAMP_CFG]		= &reg_qtime_timestamp_cfg,
482*81772e44SAlex Elder 	[TIMERS_XO_CLK_DIV_CFG]		= &reg_timers_xo_clk_div_cfg,
483*81772e44SAlex Elder 	[TIMERS_PULSE_GRAN_CFG]		= &reg_timers_pulse_gran_cfg,
484*81772e44SAlex Elder 	[SRC_RSRC_GRP_01_RSRC_TYPE]	= &reg_src_rsrc_grp_01_rsrc_type,
485*81772e44SAlex Elder 	[SRC_RSRC_GRP_23_RSRC_TYPE]	= &reg_src_rsrc_grp_23_rsrc_type,
486*81772e44SAlex Elder 	[DST_RSRC_GRP_01_RSRC_TYPE]	= &reg_dst_rsrc_grp_01_rsrc_type,
487*81772e44SAlex Elder 	[DST_RSRC_GRP_23_RSRC_TYPE]	= &reg_dst_rsrc_grp_23_rsrc_type,
488*81772e44SAlex Elder 	[ENDP_INIT_CFG]			= &reg_endp_init_cfg,
489*81772e44SAlex Elder 	[ENDP_INIT_NAT]			= &reg_endp_init_nat,
490*81772e44SAlex Elder 	[ENDP_INIT_HDR]			= &reg_endp_init_hdr,
491*81772e44SAlex Elder 	[ENDP_INIT_HDR_EXT]		= &reg_endp_init_hdr_ext,
492*81772e44SAlex Elder 	[ENDP_INIT_HDR_METADATA_MASK]	= &reg_endp_init_hdr_metadata_mask,
493*81772e44SAlex Elder 	[ENDP_INIT_MODE]		= &reg_endp_init_mode,
494*81772e44SAlex Elder 	[ENDP_INIT_AGGR]		= &reg_endp_init_aggr,
495*81772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_EN]	= &reg_endp_init_hol_block_en,
496*81772e44SAlex Elder 	[ENDP_INIT_HOL_BLOCK_TIMER]	= &reg_endp_init_hol_block_timer,
497*81772e44SAlex Elder 	[ENDP_INIT_DEAGGR]		= &reg_endp_init_deaggr,
498*81772e44SAlex Elder 	[ENDP_INIT_RSRC_GRP]		= &reg_endp_init_rsrc_grp,
499*81772e44SAlex Elder 	[ENDP_INIT_SEQ]			= &reg_endp_init_seq,
500*81772e44SAlex Elder 	[ENDP_STATUS]			= &reg_endp_status,
501*81772e44SAlex Elder 	[ENDP_FILTER_ROUTER_HSH_CFG]	= &reg_endp_filter_router_hsh_cfg,
502*81772e44SAlex Elder 	[IPA_IRQ_STTS]			= &reg_ipa_irq_stts,
503*81772e44SAlex Elder 	[IPA_IRQ_EN]			= &reg_ipa_irq_en,
504*81772e44SAlex Elder 	[IPA_IRQ_CLR]			= &reg_ipa_irq_clr,
505*81772e44SAlex Elder 	[IPA_IRQ_UC]			= &reg_ipa_irq_uc,
506*81772e44SAlex Elder 	[IRQ_SUSPEND_INFO]		= &reg_irq_suspend_info,
507*81772e44SAlex Elder 	[IRQ_SUSPEND_EN]		= &reg_irq_suspend_en,
508*81772e44SAlex Elder 	[IRQ_SUSPEND_CLR]		= &reg_irq_suspend_clr,
50907f120bcSAlex Elder };
51007f120bcSAlex Elder 
511*81772e44SAlex Elder const struct regs ipa_regs_v4_11 = {
512*81772e44SAlex Elder 	.reg_count	= ARRAY_SIZE(reg_array),
513*81772e44SAlex Elder 	.reg		= reg_array,
51407f120bcSAlex Elder };
515