xref: /openbmc/linux/drivers/net/ipa/reg/ipa_reg-v4.11.c (revision 07f120bcf76b6f0969a1bc18ce5b7a16555fadad)
1*07f120bcSAlex Elder // SPDX-License-Identifier: GPL-2.0
2*07f120bcSAlex Elder 
3*07f120bcSAlex Elder /* Copyright (C) 2022 Linaro Ltd. */
4*07f120bcSAlex Elder 
5*07f120bcSAlex Elder #include <linux/types.h>
6*07f120bcSAlex Elder 
7*07f120bcSAlex Elder #include "../ipa.h"
8*07f120bcSAlex Elder #include "../ipa_reg.h"
9*07f120bcSAlex Elder 
10*07f120bcSAlex Elder IPA_REG(COMP_CFG, comp_cfg, 0x0000003c);
11*07f120bcSAlex Elder 
12*07f120bcSAlex Elder IPA_REG(CLKON_CFG, clkon_cfg, 0x00000044);
13*07f120bcSAlex Elder 
14*07f120bcSAlex Elder IPA_REG(ROUTE, route, 0x00000048);
15*07f120bcSAlex Elder 
16*07f120bcSAlex Elder IPA_REG(SHARED_MEM_SIZE, shared_mem_size, 0x00000054);
17*07f120bcSAlex Elder 
18*07f120bcSAlex Elder IPA_REG(QSB_MAX_WRITES, qsb_max_writes, 0x00000074);
19*07f120bcSAlex Elder 
20*07f120bcSAlex Elder IPA_REG(QSB_MAX_READS, qsb_max_reads, 0x00000078);
21*07f120bcSAlex Elder 
22*07f120bcSAlex Elder IPA_REG(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x0000148);
23*07f120bcSAlex Elder 
24*07f120bcSAlex Elder IPA_REG(FILT_ROUT_HASH_FLUSH, filt_rout_hash_flush, 0x000014c);
25*07f120bcSAlex Elder 
26*07f120bcSAlex Elder /* Valid bits defined by ipa->available */
27*07f120bcSAlex Elder IPA_REG(STATE_AGGR_ACTIVE, state_aggr_active, 0x000000b4);
28*07f120bcSAlex Elder 
29*07f120bcSAlex Elder /* Offset must be a multiple of 8 */
30*07f120bcSAlex Elder IPA_REG(LOCAL_PKT_PROC_CNTXT, local_pkt_proc_cntxt, 0x000001e8);
31*07f120bcSAlex Elder 
32*07f120bcSAlex Elder /* Valid bits defined by ipa->available */
33*07f120bcSAlex Elder IPA_REG(AGGR_FORCE_CLOSE, aggr_force_close, 0x000001ec);
34*07f120bcSAlex Elder 
35*07f120bcSAlex Elder IPA_REG(IPA_TX_CFG, ipa_tx_cfg, 0x000001fc);
36*07f120bcSAlex Elder 
37*07f120bcSAlex Elder IPA_REG(FLAVOR_0, flavor_0, 0x00000210);
38*07f120bcSAlex Elder 
39*07f120bcSAlex Elder IPA_REG(IDLE_INDICATION_CFG, idle_indication_cfg, 0x00000240);
40*07f120bcSAlex Elder 
41*07f120bcSAlex Elder IPA_REG(QTIME_TIMESTAMP_CFG, qtime_timestamp_cfg, 0x0000024c);
42*07f120bcSAlex Elder 
43*07f120bcSAlex Elder IPA_REG(TIMERS_XO_CLK_DIV_CFG, timers_xo_clk_div_cfg, 0x00000250);
44*07f120bcSAlex Elder 
45*07f120bcSAlex Elder IPA_REG(TIMERS_PULSE_GRAN_CFG, timers_pulse_gran_cfg, 0x00000254);
46*07f120bcSAlex Elder 
47*07f120bcSAlex Elder IPA_REG_STRIDE(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type,
48*07f120bcSAlex Elder 	       0x00000400, 0x0020);
49*07f120bcSAlex Elder 
50*07f120bcSAlex Elder IPA_REG_STRIDE(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type,
51*07f120bcSAlex Elder 	       0x00000404, 0x0020);
52*07f120bcSAlex Elder 
53*07f120bcSAlex Elder IPA_REG_STRIDE(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type,
54*07f120bcSAlex Elder 	       0x00000500, 0x0020);
55*07f120bcSAlex Elder 
56*07f120bcSAlex Elder IPA_REG_STRIDE(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type,
57*07f120bcSAlex Elder 	       0x00000504, 0x0020);
58*07f120bcSAlex Elder 
59*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_CFG, endp_init_cfg, 0x00000808, 0x0070);
60*07f120bcSAlex Elder 
61*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_NAT, endp_init_nat, 0x0000080c, 0x0070);
62*07f120bcSAlex Elder 
63*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HDR, endp_init_hdr, 0x00000810, 0x0070);
64*07f120bcSAlex Elder 
65*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HDR_EXT, endp_init_hdr_ext, 0x00000814, 0x0070);
66*07f120bcSAlex Elder 
67*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HDR_METADATA_MASK, endp_init_hdr_metadata_mask,
68*07f120bcSAlex Elder 	       0x00000818, 0x0070);
69*07f120bcSAlex Elder 
70*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_MODE, endp_init_mode, 0x00000820, 0x0070);
71*07f120bcSAlex Elder 
72*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_AGGR, endp_init_aggr, 0x00000824, 0x0070);
73*07f120bcSAlex Elder 
74*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HOL_BLOCK_EN, endp_init_hol_block_en,
75*07f120bcSAlex Elder 	       0x0000082c, 0x0070);
76*07f120bcSAlex Elder 
77*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HOL_BLOCK_TIMER, endp_init_hol_block_timer,
78*07f120bcSAlex Elder 	       0x00000830, 0x0070);
79*07f120bcSAlex Elder 
80*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_DEAGGR, endp_init_deaggr, 0x00000834, 0x0070);
81*07f120bcSAlex Elder 
82*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_RSRC_GRP, endp_init_rsrc_grp, 0x00000838, 0x0070);
83*07f120bcSAlex Elder 
84*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_SEQ, endp_init_seq, 0x0000083c, 0x0070);
85*07f120bcSAlex Elder 
86*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_STATUS, endp_status, 0x00000840, 0x0070);
87*07f120bcSAlex Elder 
88*07f120bcSAlex Elder IPA_REG_STRIDE(ENDP_FILTER_ROUTER_HSH_CFG, endp_filter_router_hsh_cfg,
89*07f120bcSAlex Elder 	       0x0000085c, 0x0070);
90*07f120bcSAlex Elder 
91*07f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
92*07f120bcSAlex Elder IPA_REG(IPA_IRQ_STTS, ipa_irq_stts, 0x00004008 + 0x1000 * GSI_EE_AP);
93*07f120bcSAlex Elder 
94*07f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
95*07f120bcSAlex Elder IPA_REG(IPA_IRQ_EN, ipa_irq_en, 0x0000400c + 0x1000 * GSI_EE_AP);
96*07f120bcSAlex Elder 
97*07f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */
98*07f120bcSAlex Elder IPA_REG(IPA_IRQ_CLR, ipa_irq_clr, 0x00004010 + 0x1000 * GSI_EE_AP);
99*07f120bcSAlex Elder 
100*07f120bcSAlex Elder IPA_REG(IPA_IRQ_UC, ipa_irq_uc, 0x0000401c + 0x1000 * GSI_EE_AP);
101*07f120bcSAlex Elder 
102*07f120bcSAlex Elder /* Valid bits defined by ipa->available */
103*07f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_INFO, irq_suspend_info, 0x00004030 + 0x1000 * GSI_EE_AP);
104*07f120bcSAlex Elder 
105*07f120bcSAlex Elder /* Valid bits defined by ipa->available */
106*07f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_EN, irq_suspend_en, 0x00004034 + 0x1000 * GSI_EE_AP);
107*07f120bcSAlex Elder 
108*07f120bcSAlex Elder /* Valid bits defined by ipa->available */
109*07f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_CLR, irq_suspend_clr, 0x00004038 + 0x1000 * GSI_EE_AP);
110*07f120bcSAlex Elder 
111*07f120bcSAlex Elder static const struct ipa_reg *ipa_reg_array[] = {
112*07f120bcSAlex Elder 	[COMP_CFG]			= &ipa_reg_comp_cfg,
113*07f120bcSAlex Elder 	[CLKON_CFG]			= &ipa_reg_clkon_cfg,
114*07f120bcSAlex Elder 	[ROUTE]				= &ipa_reg_route,
115*07f120bcSAlex Elder 	[SHARED_MEM_SIZE]		= &ipa_reg_shared_mem_size,
116*07f120bcSAlex Elder 	[QSB_MAX_WRITES]		= &ipa_reg_qsb_max_writes,
117*07f120bcSAlex Elder 	[QSB_MAX_READS]			= &ipa_reg_qsb_max_reads,
118*07f120bcSAlex Elder 	[FILT_ROUT_HASH_EN]		= &ipa_reg_filt_rout_hash_en,
119*07f120bcSAlex Elder 	[FILT_ROUT_HASH_FLUSH]		= &ipa_reg_filt_rout_hash_flush,
120*07f120bcSAlex Elder 	[STATE_AGGR_ACTIVE]		= &ipa_reg_state_aggr_active,
121*07f120bcSAlex Elder 	[LOCAL_PKT_PROC_CNTXT]		= &ipa_reg_local_pkt_proc_cntxt,
122*07f120bcSAlex Elder 	[AGGR_FORCE_CLOSE]		= &ipa_reg_aggr_force_close,
123*07f120bcSAlex Elder 	[IPA_TX_CFG]			= &ipa_reg_ipa_tx_cfg,
124*07f120bcSAlex Elder 	[FLAVOR_0]			= &ipa_reg_flavor_0,
125*07f120bcSAlex Elder 	[IDLE_INDICATION_CFG]		= &ipa_reg_idle_indication_cfg,
126*07f120bcSAlex Elder 	[QTIME_TIMESTAMP_CFG]		= &ipa_reg_qtime_timestamp_cfg,
127*07f120bcSAlex Elder 	[TIMERS_XO_CLK_DIV_CFG]		= &ipa_reg_timers_xo_clk_div_cfg,
128*07f120bcSAlex Elder 	[TIMERS_PULSE_GRAN_CFG]		= &ipa_reg_timers_pulse_gran_cfg,
129*07f120bcSAlex Elder 	[SRC_RSRC_GRP_01_RSRC_TYPE]	= &ipa_reg_src_rsrc_grp_01_rsrc_type,
130*07f120bcSAlex Elder 	[SRC_RSRC_GRP_23_RSRC_TYPE]	= &ipa_reg_src_rsrc_grp_23_rsrc_type,
131*07f120bcSAlex Elder 	[DST_RSRC_GRP_01_RSRC_TYPE]	= &ipa_reg_dst_rsrc_grp_01_rsrc_type,
132*07f120bcSAlex Elder 	[DST_RSRC_GRP_23_RSRC_TYPE]	= &ipa_reg_dst_rsrc_grp_23_rsrc_type,
133*07f120bcSAlex Elder 	[ENDP_INIT_CFG]			= &ipa_reg_endp_init_cfg,
134*07f120bcSAlex Elder 	[ENDP_INIT_NAT]			= &ipa_reg_endp_init_nat,
135*07f120bcSAlex Elder 	[ENDP_INIT_HDR]			= &ipa_reg_endp_init_hdr,
136*07f120bcSAlex Elder 	[ENDP_INIT_HDR_EXT]		= &ipa_reg_endp_init_hdr_ext,
137*07f120bcSAlex Elder 	[ENDP_INIT_HDR_METADATA_MASK]	= &ipa_reg_endp_init_hdr_metadata_mask,
138*07f120bcSAlex Elder 	[ENDP_INIT_MODE]		= &ipa_reg_endp_init_mode,
139*07f120bcSAlex Elder 	[ENDP_INIT_AGGR]		= &ipa_reg_endp_init_aggr,
140*07f120bcSAlex Elder 	[ENDP_INIT_HOL_BLOCK_EN]	= &ipa_reg_endp_init_hol_block_en,
141*07f120bcSAlex Elder 	[ENDP_INIT_HOL_BLOCK_TIMER]	= &ipa_reg_endp_init_hol_block_timer,
142*07f120bcSAlex Elder 	[ENDP_INIT_DEAGGR]		= &ipa_reg_endp_init_deaggr,
143*07f120bcSAlex Elder 	[ENDP_INIT_RSRC_GRP]		= &ipa_reg_endp_init_rsrc_grp,
144*07f120bcSAlex Elder 	[ENDP_INIT_SEQ]			= &ipa_reg_endp_init_seq,
145*07f120bcSAlex Elder 	[ENDP_STATUS]			= &ipa_reg_endp_status,
146*07f120bcSAlex Elder 	[ENDP_FILTER_ROUTER_HSH_CFG]	= &ipa_reg_endp_filter_router_hsh_cfg,
147*07f120bcSAlex Elder 	[IPA_IRQ_STTS]			= &ipa_reg_ipa_irq_stts,
148*07f120bcSAlex Elder 	[IPA_IRQ_EN]			= &ipa_reg_ipa_irq_en,
149*07f120bcSAlex Elder 	[IPA_IRQ_CLR]			= &ipa_reg_ipa_irq_clr,
150*07f120bcSAlex Elder 	[IPA_IRQ_UC]			= &ipa_reg_ipa_irq_uc,
151*07f120bcSAlex Elder 	[IRQ_SUSPEND_INFO]		= &ipa_reg_irq_suspend_info,
152*07f120bcSAlex Elder 	[IRQ_SUSPEND_EN]		= &ipa_reg_irq_suspend_en,
153*07f120bcSAlex Elder 	[IRQ_SUSPEND_CLR]		= &ipa_reg_irq_suspend_clr,
154*07f120bcSAlex Elder };
155*07f120bcSAlex Elder 
156*07f120bcSAlex Elder const struct ipa_regs ipa_regs_v4_11 = {
157*07f120bcSAlex Elder 	.reg_count	= ARRAY_SIZE(ipa_reg_array),
158*07f120bcSAlex Elder 	.reg		= ipa_reg_array,
159*07f120bcSAlex Elder };
160