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 1012c7ea7dSAlex Elder static const u32 ipa_reg_comp_cfg_fmask[] = { 1112c7ea7dSAlex Elder [COMP_CFG_ENABLE] = 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 [IPA_DCMP_FAST_CLK_EN] = BIT(4), 1612c7ea7dSAlex Elder /* Bits 5-31 reserved */ 1712c7ea7dSAlex Elder }; 1812c7ea7dSAlex Elder 1912c7ea7dSAlex Elder IPA_REG_FIELDS(COMP_CFG, comp_cfg, 0x0000003c); 2007f120bcSAlex Elder 21479deb32SAlex Elder static const u32 ipa_reg_clkon_cfg_fmask[] = { 22479deb32SAlex Elder [CLKON_RX] = BIT(0), 23479deb32SAlex Elder [CLKON_PROC] = BIT(1), 24479deb32SAlex Elder [TX_WRAPPER] = BIT(2), 25479deb32SAlex Elder [CLKON_MISC] = BIT(3), 26479deb32SAlex Elder [RAM_ARB] = BIT(4), 27479deb32SAlex Elder [FTCH_HPS] = BIT(5), 28479deb32SAlex Elder [FTCH_DPS] = BIT(6), 29479deb32SAlex Elder [CLKON_HPS] = BIT(7), 30479deb32SAlex Elder [CLKON_DPS] = BIT(8), 31479deb32SAlex Elder [RX_HPS_CMDQS] = BIT(9), 32479deb32SAlex Elder [HPS_DPS_CMDQS] = BIT(10), 33479deb32SAlex Elder [DPS_TX_CMDQS] = BIT(11), 34479deb32SAlex Elder [RSRC_MNGR] = BIT(12), 35479deb32SAlex Elder [CTX_HANDLER] = BIT(13), 36479deb32SAlex Elder [ACK_MNGR] = BIT(14), 37479deb32SAlex Elder [D_DCPH] = BIT(15), 38479deb32SAlex Elder [H_DCPH] = BIT(16), 39479deb32SAlex Elder /* Bits 17-31 reserved */ 40479deb32SAlex Elder }; 4107f120bcSAlex Elder 42479deb32SAlex Elder IPA_REG_FIELDS(CLKON_CFG, clkon_cfg, 0x00000044); 43479deb32SAlex Elder 44479deb32SAlex Elder static const u32 ipa_reg_route_fmask[] = { 45479deb32SAlex Elder [ROUTE_DIS] = BIT(0), 46479deb32SAlex Elder [ROUTE_DEF_PIPE] = GENMASK(5, 1), 47479deb32SAlex Elder [ROUTE_DEF_HDR_TABLE] = BIT(6), 48479deb32SAlex Elder [ROUTE_DEF_HDR_OFST] = GENMASK(16, 7), 49479deb32SAlex Elder [ROUTE_FRAG_DEF_PIPE] = GENMASK(21, 17), 50479deb32SAlex Elder /* Bits 22-23 reserved */ 51479deb32SAlex Elder [ROUTE_DEF_RETAIN_HDR] = BIT(24), 52479deb32SAlex Elder /* Bits 25-31 reserved */ 53479deb32SAlex Elder }; 54479deb32SAlex Elder 55479deb32SAlex Elder IPA_REG_FIELDS(ROUTE, route, 0x00000048); 5607f120bcSAlex Elder 5762b9c009SAlex Elder static const u32 ipa_reg_shared_mem_size_fmask[] = { 5862b9c009SAlex Elder [MEM_SIZE] = GENMASK(15, 0), 5962b9c009SAlex Elder [MEM_BADDR] = GENMASK(31, 16), 6062b9c009SAlex Elder }; 6107f120bcSAlex Elder 6262b9c009SAlex Elder IPA_REG_FIELDS(SHARED_MEM_SIZE, shared_mem_size, 0x00000054); 6307f120bcSAlex Elder 6462b9c009SAlex Elder static const u32 ipa_reg_qsb_max_writes_fmask[] = { 6562b9c009SAlex Elder [GEN_QMB_0_MAX_WRITES] = GENMASK(3, 0), 6662b9c009SAlex Elder [GEN_QMB_1_MAX_WRITES] = GENMASK(7, 4), 6762b9c009SAlex Elder /* Bits 8-31 reserved */ 6862b9c009SAlex Elder }; 6907f120bcSAlex Elder 7062b9c009SAlex Elder IPA_REG_FIELDS(QSB_MAX_WRITES, qsb_max_writes, 0x00000074); 7107f120bcSAlex Elder 7262b9c009SAlex Elder static const u32 ipa_reg_qsb_max_reads_fmask[] = { 7362b9c009SAlex Elder [GEN_QMB_0_MAX_READS] = GENMASK(3, 0), 7462b9c009SAlex Elder [GEN_QMB_1_MAX_READS] = GENMASK(7, 4), 7562b9c009SAlex Elder }; 7662b9c009SAlex Elder 7762b9c009SAlex Elder IPA_REG_FIELDS(QSB_MAX_READS, qsb_max_reads, 0x00000078); 7862b9c009SAlex Elder 7962b9c009SAlex Elder static const u32 ipa_reg_filt_rout_hash_en_fmask[] = { 8062b9c009SAlex Elder [IPV6_ROUTER_HASH] = BIT(0), 8162b9c009SAlex Elder /* Bits 1-3 reserved */ 8262b9c009SAlex Elder [IPV6_FILTER_HASH] = BIT(4), 8362b9c009SAlex Elder /* Bits 5-7 reserved */ 8462b9c009SAlex Elder [IPV4_ROUTER_HASH] = BIT(8), 8562b9c009SAlex Elder /* Bits 9-11 reserved */ 8662b9c009SAlex Elder [IPV4_FILTER_HASH] = BIT(12), 8762b9c009SAlex Elder /* Bits 13-31 reserved */ 8862b9c009SAlex Elder }; 8962b9c009SAlex Elder 9062b9c009SAlex Elder IPA_REG_FIELDS(FILT_ROUT_HASH_EN, filt_rout_hash_en, 0x000008c); 9162b9c009SAlex Elder 9262b9c009SAlex Elder static const u32 ipa_reg_filt_rout_hash_flush_fmask[] = { 9362b9c009SAlex Elder [IPV6_ROUTER_HASH] = BIT(0), 9462b9c009SAlex Elder /* Bits 1-3 reserved */ 9562b9c009SAlex Elder [IPV6_FILTER_HASH] = BIT(4), 9662b9c009SAlex Elder /* Bits 5-7 reserved */ 9762b9c009SAlex Elder [IPV4_ROUTER_HASH] = BIT(8), 9862b9c009SAlex Elder /* Bits 9-11 reserved */ 9962b9c009SAlex Elder [IPV4_FILTER_HASH] = BIT(12), 10062b9c009SAlex Elder /* Bits 13-31 reserved */ 10162b9c009SAlex Elder }; 10262b9c009SAlex Elder 10362b9c009SAlex Elder IPA_REG_FIELDS(FILT_ROUT_HASH_FLUSH, filt_rout_hash_flush, 0x0000090); 10407f120bcSAlex Elder 10507f120bcSAlex Elder /* Valid bits defined by ipa->available */ 10607f120bcSAlex Elder IPA_REG(STATE_AGGR_ACTIVE, state_aggr_active, 0x0000010c); 10707f120bcSAlex Elder 10807f120bcSAlex Elder IPA_REG(IPA_BCR, ipa_bcr, 0x000001d0); 10907f120bcSAlex Elder 110b5c35fa4SAlex Elder static const u32 ipa_reg_local_pkt_proc_cntxt_fmask[] = { 111b5c35fa4SAlex Elder [IPA_BASE_ADDR] = GENMASK(16, 0), 112b5c35fa4SAlex Elder /* Bits 17-31 reserved */ 113b5c35fa4SAlex Elder }; 114b5c35fa4SAlex Elder 11507f120bcSAlex Elder /* Offset must be a multiple of 8 */ 116b5c35fa4SAlex Elder IPA_REG_FIELDS(LOCAL_PKT_PROC_CNTXT, local_pkt_proc_cntxt, 0x000001e8); 11707f120bcSAlex Elder 11807f120bcSAlex Elder /* Valid bits defined by ipa->available */ 11907f120bcSAlex Elder IPA_REG(AGGR_FORCE_CLOSE, aggr_force_close, 0x000001ec); 12007f120bcSAlex Elder 121b5c35fa4SAlex Elder static const u32 ipa_reg_counter_cfg_fmask[] = { 122b5c35fa4SAlex Elder [EOT_COAL_GRANULARITY] = GENMASK(3, 0), 123b5c35fa4SAlex Elder [AGGR_GRANULARITY] = GENMASK(8, 4), 124b5c35fa4SAlex Elder /* Bits 5-31 reserved */ 125b5c35fa4SAlex Elder }; 126b5c35fa4SAlex Elder 127b5c35fa4SAlex Elder IPA_REG_FIELDS(COUNTER_CFG, counter_cfg, 0x000001f0); 12807f120bcSAlex Elder 1291c418c4aSAlex Elder static const u32 ipa_reg_src_rsrc_grp_01_rsrc_type_fmask[] = { 1301c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 1311c418c4aSAlex Elder /* Bits 6-7 reserved */ 1321c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 1331c418c4aSAlex Elder /* Bits 14-15 reserved */ 1341c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 1351c418c4aSAlex Elder /* Bits 22-23 reserved */ 1361c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 1371c418c4aSAlex Elder /* Bits 30-31 reserved */ 1381c418c4aSAlex Elder }; 1391c418c4aSAlex Elder 1401c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_01_RSRC_TYPE, src_rsrc_grp_01_rsrc_type, 14107f120bcSAlex Elder 0x00000400, 0x0020); 14207f120bcSAlex Elder 1431c418c4aSAlex Elder static const u32 ipa_reg_src_rsrc_grp_23_rsrc_type_fmask[] = { 1441c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 1451c418c4aSAlex Elder /* Bits 6-7 reserved */ 1461c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 1471c418c4aSAlex Elder /* Bits 14-15 reserved */ 1481c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 1491c418c4aSAlex Elder /* Bits 22-23 reserved */ 1501c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 1511c418c4aSAlex Elder /* Bits 30-31 reserved */ 1521c418c4aSAlex Elder }; 1531c418c4aSAlex Elder 1541c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_23_RSRC_TYPE, src_rsrc_grp_23_rsrc_type, 15507f120bcSAlex Elder 0x00000404, 0x0020); 15607f120bcSAlex Elder 1571c418c4aSAlex Elder static const u32 ipa_reg_src_rsrc_grp_45_rsrc_type_fmask[] = { 1581c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 1591c418c4aSAlex Elder /* Bits 6-7 reserved */ 1601c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 1611c418c4aSAlex Elder /* Bits 14-15 reserved */ 1621c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 1631c418c4aSAlex Elder /* Bits 22-23 reserved */ 1641c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 1651c418c4aSAlex Elder /* Bits 30-31 reserved */ 1661c418c4aSAlex Elder }; 1671c418c4aSAlex Elder 1681c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_45_RSRC_TYPE, src_rsrc_grp_45_rsrc_type, 16907f120bcSAlex Elder 0x00000408, 0x0020); 17007f120bcSAlex Elder 1711c418c4aSAlex Elder static const u32 ipa_reg_src_rsrc_grp_67_rsrc_type_fmask[] = { 1721c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 1731c418c4aSAlex Elder /* Bits 6-7 reserved */ 1741c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 1751c418c4aSAlex Elder /* Bits 14-15 reserved */ 1761c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 1771c418c4aSAlex Elder /* Bits 22-23 reserved */ 1781c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 1791c418c4aSAlex Elder /* Bits 30-31 reserved */ 1801c418c4aSAlex Elder }; 1811c418c4aSAlex Elder 1821c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(SRC_RSRC_GRP_67_RSRC_TYPE, src_rsrc_grp_67_rsrc_type, 18307f120bcSAlex Elder 0x0000040c, 0x0020); 18407f120bcSAlex Elder 1851c418c4aSAlex Elder static const u32 ipa_reg_dst_rsrc_grp_01_rsrc_type_fmask[] = { 1861c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 1871c418c4aSAlex Elder /* Bits 6-7 reserved */ 1881c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 1891c418c4aSAlex Elder /* Bits 14-15 reserved */ 1901c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 1911c418c4aSAlex Elder /* Bits 22-23 reserved */ 1921c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 1931c418c4aSAlex Elder /* Bits 30-31 reserved */ 1941c418c4aSAlex Elder }; 1951c418c4aSAlex Elder 1961c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_01_RSRC_TYPE, dst_rsrc_grp_01_rsrc_type, 19707f120bcSAlex Elder 0x00000500, 0x0020); 19807f120bcSAlex Elder 1991c418c4aSAlex Elder static const u32 ipa_reg_dst_rsrc_grp_23_rsrc_type_fmask[] = { 2001c418c4aSAlex Elder [X_MIN_LIM] = GENMASK(5, 0), 2011c418c4aSAlex Elder /* Bits 6-7 reserved */ 2021c418c4aSAlex Elder [X_MAX_LIM] = GENMASK(13, 8), 2031c418c4aSAlex Elder /* Bits 14-15 reserved */ 2041c418c4aSAlex Elder [Y_MIN_LIM] = GENMASK(21, 16), 2051c418c4aSAlex Elder /* Bits 22-23 reserved */ 2061c418c4aSAlex Elder [Y_MAX_LIM] = GENMASK(29, 24), 2071c418c4aSAlex Elder /* Bits 30-31 reserved */ 2081c418c4aSAlex Elder }; 2091c418c4aSAlex Elder 2101c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_23_RSRC_TYPE, dst_rsrc_grp_23_rsrc_type, 21107f120bcSAlex Elder 0x00000504, 0x0020); 21207f120bcSAlex Elder 2131c418c4aSAlex Elder static const u32 ipa_reg_dst_rsrc_grp_45_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 2241c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_45_RSRC_TYPE, dst_rsrc_grp_45_rsrc_type, 22507f120bcSAlex Elder 0x00000508, 0x0020); 22607f120bcSAlex Elder 2271c418c4aSAlex Elder static const u32 ipa_reg_dst_rsrc_grp_67_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 2381c418c4aSAlex Elder IPA_REG_STRIDE_FIELDS(DST_RSRC_GRP_67_RSRC_TYPE, dst_rsrc_grp_67_rsrc_type, 23907f120bcSAlex Elder 0x0000050c, 0x0020); 24007f120bcSAlex Elder 2414468a344SAlex Elder static const u32 ipa_reg_endp_init_ctrl_fmask[] = { 2424468a344SAlex Elder [ENDP_SUSPEND] = BIT(0), 2434468a344SAlex Elder [ENDP_DELAY] = BIT(1), 2444468a344SAlex Elder /* Bits 2-31 reserved */ 2454468a344SAlex Elder }; 24607f120bcSAlex Elder 2474468a344SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_CTRL, endp_init_ctrl, 0x00000800, 0x0070); 24807f120bcSAlex Elder 2494468a344SAlex Elder static const u32 ipa_reg_endp_init_cfg_fmask[] = { 2504468a344SAlex Elder [FRAG_OFFLOAD_EN] = BIT(0), 2514468a344SAlex Elder [CS_OFFLOAD_EN] = GENMASK(2, 1), 2524468a344SAlex Elder [CS_METADATA_HDR_OFFSET] = GENMASK(6, 3), 2534468a344SAlex Elder /* Bit 7 reserved */ 2544468a344SAlex Elder [CS_GEN_QMB_MASTER_SEL] = BIT(8), 2554468a344SAlex Elder /* Bits 9-31 reserved */ 2564468a344SAlex Elder }; 25707f120bcSAlex Elder 2584468a344SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_CFG, endp_init_cfg, 0x00000808, 0x0070); 25907f120bcSAlex Elder 2604468a344SAlex Elder static const u32 ipa_reg_endp_init_nat_fmask[] = { 2614468a344SAlex Elder [NAT_EN] = GENMASK(1, 0), 2624468a344SAlex Elder /* Bits 2-31 reserved */ 2634468a344SAlex Elder }; 2644468a344SAlex Elder 2654468a344SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_NAT, endp_init_nat, 0x0000080c, 0x0070); 2664468a344SAlex Elder 2674468a344SAlex Elder static const u32 ipa_reg_endp_init_hdr_fmask[] = { 2684468a344SAlex Elder [HDR_LEN] = GENMASK(5, 0), 2694468a344SAlex Elder [HDR_OFST_METADATA_VALID] = BIT(6), 2704468a344SAlex Elder [HDR_OFST_METADATA] = GENMASK(12, 7), 2714468a344SAlex Elder [HDR_ADDITIONAL_CONST_LEN] = GENMASK(18, 13), 2724468a344SAlex Elder [HDR_OFST_PKT_SIZE_VALID] = BIT(19), 2734468a344SAlex Elder [HDR_OFST_PKT_SIZE] = GENMASK(25, 20), 2744468a344SAlex Elder [HDR_A5_MUX] = BIT(26), 2754468a344SAlex Elder [HDR_LEN_INC_DEAGG_HDR] = BIT(27), 2764468a344SAlex Elder [HDR_METADATA_REG_VALID] = BIT(28), 2774468a344SAlex Elder /* Bits 29-31 reserved */ 2784468a344SAlex Elder }; 2794468a344SAlex Elder 2804468a344SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_HDR, endp_init_hdr, 0x00000810, 0x0070); 2814468a344SAlex Elder 2824468a344SAlex Elder static const u32 ipa_reg_endp_init_hdr_ext_fmask[] = { 2834468a344SAlex Elder [HDR_ENDIANNESS] = BIT(0), 2844468a344SAlex Elder [HDR_TOTAL_LEN_OR_PAD_VALID] = BIT(1), 2854468a344SAlex Elder [HDR_TOTAL_LEN_OR_PAD] = BIT(2), 2864468a344SAlex Elder [HDR_PAYLOAD_LEN_INC_PADDING] = BIT(3), 2874468a344SAlex Elder [HDR_TOTAL_LEN_OR_PAD_OFFSET] = GENMASK(9, 4), 2884468a344SAlex Elder [HDR_PAD_TO_ALIGNMENT] = GENMASK(13, 10), 2894468a344SAlex Elder /* Bits 14-31 reserved */ 2904468a344SAlex Elder }; 2914468a344SAlex Elder 2924468a344SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_HDR_EXT, endp_init_hdr_ext, 0x00000814, 0x0070); 29307f120bcSAlex Elder 29407f120bcSAlex Elder IPA_REG_STRIDE(ENDP_INIT_HDR_METADATA_MASK, endp_init_hdr_metadata_mask, 29507f120bcSAlex Elder 0x00000818, 0x0070); 29607f120bcSAlex Elder 297216b409dSAlex Elder static const u32 ipa_reg_endp_init_mode_fmask[] = { 298216b409dSAlex Elder [ENDP_MODE] = GENMASK(2, 0), 299216b409dSAlex Elder /* Bit 3 reserved */ 300216b409dSAlex Elder [DEST_PIPE_INDEX] = GENMASK(8, 4), 301216b409dSAlex Elder /* Bits 9-11 reserved */ 302216b409dSAlex Elder [BYTE_THRESHOLD] = GENMASK(27, 12), 303216b409dSAlex Elder [PIPE_REPLICATION_EN] = BIT(28), 304216b409dSAlex Elder [PAD_EN] = BIT(29), 305216b409dSAlex Elder [HDR_FTCH_DISABLE] = BIT(30), 306216b409dSAlex Elder /* Bit 31 reserved */ 307216b409dSAlex Elder }; 30807f120bcSAlex Elder 309216b409dSAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_MODE, endp_init_mode, 0x00000820, 0x0070); 31007f120bcSAlex Elder 311216b409dSAlex Elder static const u32 ipa_reg_endp_init_aggr_fmask[] = { 312216b409dSAlex Elder [AGGR_EN] = GENMASK(1, 0), 313216b409dSAlex Elder [AGGR_TYPE] = GENMASK(4, 2), 314216b409dSAlex Elder [BYTE_LIMIT] = GENMASK(9, 5), 315216b409dSAlex Elder [TIME_LIMIT] = GENMASK(14, 10), 316216b409dSAlex Elder [PKT_LIMIT] = GENMASK(20, 15), 317216b409dSAlex Elder [SW_EOF_ACTIVE] = BIT(21), 318216b409dSAlex Elder [FORCE_CLOSE] = BIT(22), 319216b409dSAlex Elder /* Bit 23 reserved */ 320216b409dSAlex Elder [HARD_BYTE_LIMIT_EN] = BIT(24), 321216b409dSAlex Elder /* Bits 25-31 reserved */ 322216b409dSAlex Elder }; 323216b409dSAlex Elder 324216b409dSAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_AGGR, endp_init_aggr, 0x00000824, 0x0070); 325216b409dSAlex Elder 326216b409dSAlex Elder static const u32 ipa_reg_endp_init_hol_block_en_fmask[] = { 327216b409dSAlex Elder [HOL_BLOCK_EN] = BIT(0), 328216b409dSAlex Elder /* Bits 1-31 reserved */ 329216b409dSAlex Elder }; 330216b409dSAlex Elder 331216b409dSAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_EN, endp_init_hol_block_en, 33207f120bcSAlex Elder 0x0000082c, 0x0070); 33307f120bcSAlex Elder 334216b409dSAlex Elder /* Entire register is a tick count */ 335216b409dSAlex Elder static const u32 ipa_reg_endp_init_hol_block_timer_fmask[] = { 336216b409dSAlex Elder [TIMER_BASE_VALUE] = GENMASK(31, 0), 337216b409dSAlex Elder }; 338216b409dSAlex Elder 339216b409dSAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_HOL_BLOCK_TIMER, endp_init_hol_block_timer, 34007f120bcSAlex Elder 0x00000830, 0x0070); 34107f120bcSAlex Elder 342*181ca020SAlex Elder static const u32 ipa_reg_endp_init_deaggr_fmask[] = { 343*181ca020SAlex Elder [DEAGGR_HDR_LEN] = GENMASK(5, 0), 344*181ca020SAlex Elder [SYSPIPE_ERR_DETECTION] = BIT(6), 345*181ca020SAlex Elder [PACKET_OFFSET_VALID] = BIT(7), 346*181ca020SAlex Elder [PACKET_OFFSET_LOCATION] = GENMASK(13, 8), 347*181ca020SAlex Elder [IGNORE_MIN_PKT_ERR] = BIT(14), 348*181ca020SAlex Elder /* Bit 15 reserved */ 349*181ca020SAlex Elder [MAX_PACKET_LEN] = GENMASK(31, 16), 350*181ca020SAlex Elder }; 35107f120bcSAlex Elder 352*181ca020SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_DEAGGR, endp_init_deaggr, 0x00000834, 0x0070); 35307f120bcSAlex Elder 354*181ca020SAlex Elder static const u32 ipa_reg_endp_init_rsrc_grp_fmask[] = { 355*181ca020SAlex Elder [ENDP_RSRC_GRP] = GENMASK(2, 0), 356*181ca020SAlex Elder /* Bits 3-31 reserved */ 357*181ca020SAlex Elder }; 35807f120bcSAlex Elder 359*181ca020SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_RSRC_GRP, endp_init_rsrc_grp, 360*181ca020SAlex Elder 0x00000838, 0x0070); 36107f120bcSAlex Elder 362*181ca020SAlex Elder static const u32 ipa_reg_endp_init_seq_fmask[] = { 363*181ca020SAlex Elder [SEQ_TYPE] = GENMASK(7, 0), 364*181ca020SAlex Elder [SEQ_REP_TYPE] = GENMASK(15, 8), 365*181ca020SAlex Elder /* Bits 16-31 reserved */ 366*181ca020SAlex Elder }; 367*181ca020SAlex Elder 368*181ca020SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_INIT_SEQ, endp_init_seq, 0x0000083c, 0x0070); 369*181ca020SAlex Elder 370*181ca020SAlex Elder static const u32 ipa_reg_endp_status_fmask[] = { 371*181ca020SAlex Elder [STATUS_EN] = BIT(0), 372*181ca020SAlex Elder [STATUS_ENDP] = GENMASK(5, 1), 373*181ca020SAlex Elder /* Bits 6-7 reserved */ 374*181ca020SAlex Elder [STATUS_LOCATION] = BIT(8), 375*181ca020SAlex Elder /* Bits 9-31 reserved */ 376*181ca020SAlex Elder }; 377*181ca020SAlex Elder 378*181ca020SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_STATUS, endp_status, 0x00000840, 0x0070); 379*181ca020SAlex Elder 380*181ca020SAlex Elder static const u32 ipa_reg_endp_filter_router_hsh_cfg_fmask[] = { 381*181ca020SAlex Elder [FILTER_HASH_MSK_SRC_ID] = BIT(0), 382*181ca020SAlex Elder [FILTER_HASH_MSK_SRC_IP] = BIT(1), 383*181ca020SAlex Elder [FILTER_HASH_MSK_DST_IP] = BIT(2), 384*181ca020SAlex Elder [FILTER_HASH_MSK_SRC_PORT] = BIT(3), 385*181ca020SAlex Elder [FILTER_HASH_MSK_DST_PORT] = BIT(4), 386*181ca020SAlex Elder [FILTER_HASH_MSK_PROTOCOL] = BIT(5), 387*181ca020SAlex Elder [FILTER_HASH_MSK_METADATA] = BIT(6), 388*181ca020SAlex Elder [FILTER_HASH_MSK_ALL] = GENMASK(6, 0), 389*181ca020SAlex Elder /* Bits 7-15 reserved */ 390*181ca020SAlex Elder [ROUTER_HASH_MSK_SRC_ID] = BIT(16), 391*181ca020SAlex Elder [ROUTER_HASH_MSK_SRC_IP] = BIT(17), 392*181ca020SAlex Elder [ROUTER_HASH_MSK_DST_IP] = BIT(18), 393*181ca020SAlex Elder [ROUTER_HASH_MSK_SRC_PORT] = BIT(19), 394*181ca020SAlex Elder [ROUTER_HASH_MSK_DST_PORT] = BIT(20), 395*181ca020SAlex Elder [ROUTER_HASH_MSK_PROTOCOL] = BIT(21), 396*181ca020SAlex Elder [ROUTER_HASH_MSK_METADATA] = BIT(22), 397*181ca020SAlex Elder [ROUTER_HASH_MSK_ALL] = GENMASK(22, 16), 398*181ca020SAlex Elder /* Bits 23-31 reserved */ 399*181ca020SAlex Elder }; 400*181ca020SAlex Elder 401*181ca020SAlex Elder IPA_REG_STRIDE_FIELDS(ENDP_FILTER_ROUTER_HSH_CFG, endp_filter_router_hsh_cfg, 40207f120bcSAlex Elder 0x0000085c, 0x0070); 40307f120bcSAlex Elder 40407f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */ 40507f120bcSAlex Elder IPA_REG(IPA_IRQ_STTS, ipa_irq_stts, 0x00003008 + 0x1000 * GSI_EE_AP); 40607f120bcSAlex Elder 40707f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */ 40807f120bcSAlex Elder IPA_REG(IPA_IRQ_EN, ipa_irq_en, 0x0000300c + 0x1000 * GSI_EE_AP); 40907f120bcSAlex Elder 41007f120bcSAlex Elder /* Valid bits defined by enum ipa_irq_id; only used for GSI_EE_AP */ 41107f120bcSAlex Elder IPA_REG(IPA_IRQ_CLR, ipa_irq_clr, 0x00003010 + 0x1000 * GSI_EE_AP); 41207f120bcSAlex Elder 413*181ca020SAlex Elder static const u32 ipa_reg_ipa_irq_uc_fmask[] = { 414*181ca020SAlex Elder [UC_INTR] = BIT(0), 415*181ca020SAlex Elder /* Bits 1-31 reserved */ 416*181ca020SAlex Elder }; 417*181ca020SAlex Elder 418*181ca020SAlex Elder IPA_REG_FIELDS(IPA_IRQ_UC, ipa_irq_uc, 0x0000301c + 0x1000 * GSI_EE_AP); 41907f120bcSAlex Elder 42007f120bcSAlex Elder /* Valid bits defined by ipa->available */ 42107f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_INFO, irq_suspend_info, 0x00003030 + 0x1000 * GSI_EE_AP); 42207f120bcSAlex Elder 42307f120bcSAlex Elder /* Valid bits defined by ipa->available */ 42407f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_EN, irq_suspend_en, 0x00003034 + 0x1000 * GSI_EE_AP); 42507f120bcSAlex Elder 42607f120bcSAlex Elder /* Valid bits defined by ipa->available */ 42707f120bcSAlex Elder IPA_REG(IRQ_SUSPEND_CLR, irq_suspend_clr, 0x00003038 + 0x1000 * GSI_EE_AP); 42807f120bcSAlex Elder 42907f120bcSAlex Elder static const struct ipa_reg *ipa_reg_array[] = { 43007f120bcSAlex Elder [COMP_CFG] = &ipa_reg_comp_cfg, 43107f120bcSAlex Elder [CLKON_CFG] = &ipa_reg_clkon_cfg, 43207f120bcSAlex Elder [ROUTE] = &ipa_reg_route, 43307f120bcSAlex Elder [SHARED_MEM_SIZE] = &ipa_reg_shared_mem_size, 43407f120bcSAlex Elder [QSB_MAX_WRITES] = &ipa_reg_qsb_max_writes, 43507f120bcSAlex Elder [QSB_MAX_READS] = &ipa_reg_qsb_max_reads, 43607f120bcSAlex Elder [FILT_ROUT_HASH_EN] = &ipa_reg_filt_rout_hash_en, 43707f120bcSAlex Elder [FILT_ROUT_HASH_FLUSH] = &ipa_reg_filt_rout_hash_flush, 43807f120bcSAlex Elder [STATE_AGGR_ACTIVE] = &ipa_reg_state_aggr_active, 43907f120bcSAlex Elder [IPA_BCR] = &ipa_reg_ipa_bcr, 44007f120bcSAlex Elder [LOCAL_PKT_PROC_CNTXT] = &ipa_reg_local_pkt_proc_cntxt, 44107f120bcSAlex Elder [AGGR_FORCE_CLOSE] = &ipa_reg_aggr_force_close, 44207f120bcSAlex Elder [COUNTER_CFG] = &ipa_reg_counter_cfg, 44307f120bcSAlex Elder [SRC_RSRC_GRP_01_RSRC_TYPE] = &ipa_reg_src_rsrc_grp_01_rsrc_type, 44407f120bcSAlex Elder [SRC_RSRC_GRP_23_RSRC_TYPE] = &ipa_reg_src_rsrc_grp_23_rsrc_type, 44507f120bcSAlex Elder [SRC_RSRC_GRP_45_RSRC_TYPE] = &ipa_reg_src_rsrc_grp_45_rsrc_type, 44607f120bcSAlex Elder [SRC_RSRC_GRP_67_RSRC_TYPE] = &ipa_reg_src_rsrc_grp_67_rsrc_type, 44707f120bcSAlex Elder [DST_RSRC_GRP_01_RSRC_TYPE] = &ipa_reg_dst_rsrc_grp_01_rsrc_type, 44807f120bcSAlex Elder [DST_RSRC_GRP_23_RSRC_TYPE] = &ipa_reg_dst_rsrc_grp_23_rsrc_type, 44907f120bcSAlex Elder [DST_RSRC_GRP_45_RSRC_TYPE] = &ipa_reg_dst_rsrc_grp_45_rsrc_type, 45007f120bcSAlex Elder [DST_RSRC_GRP_67_RSRC_TYPE] = &ipa_reg_dst_rsrc_grp_67_rsrc_type, 45107f120bcSAlex Elder [ENDP_INIT_CTRL] = &ipa_reg_endp_init_ctrl, 45207f120bcSAlex Elder [ENDP_INIT_CFG] = &ipa_reg_endp_init_cfg, 45307f120bcSAlex Elder [ENDP_INIT_NAT] = &ipa_reg_endp_init_nat, 45407f120bcSAlex Elder [ENDP_INIT_HDR] = &ipa_reg_endp_init_hdr, 45507f120bcSAlex Elder [ENDP_INIT_HDR_EXT] = &ipa_reg_endp_init_hdr_ext, 45607f120bcSAlex Elder [ENDP_INIT_HDR_METADATA_MASK] = &ipa_reg_endp_init_hdr_metadata_mask, 45707f120bcSAlex Elder [ENDP_INIT_MODE] = &ipa_reg_endp_init_mode, 45807f120bcSAlex Elder [ENDP_INIT_AGGR] = &ipa_reg_endp_init_aggr, 45907f120bcSAlex Elder [ENDP_INIT_HOL_BLOCK_EN] = &ipa_reg_endp_init_hol_block_en, 46007f120bcSAlex Elder [ENDP_INIT_HOL_BLOCK_TIMER] = &ipa_reg_endp_init_hol_block_timer, 46107f120bcSAlex Elder [ENDP_INIT_DEAGGR] = &ipa_reg_endp_init_deaggr, 46207f120bcSAlex Elder [ENDP_INIT_RSRC_GRP] = &ipa_reg_endp_init_rsrc_grp, 46307f120bcSAlex Elder [ENDP_INIT_SEQ] = &ipa_reg_endp_init_seq, 46407f120bcSAlex Elder [ENDP_STATUS] = &ipa_reg_endp_status, 46507f120bcSAlex Elder [ENDP_FILTER_ROUTER_HSH_CFG] = &ipa_reg_endp_filter_router_hsh_cfg, 46607f120bcSAlex Elder [IPA_IRQ_STTS] = &ipa_reg_ipa_irq_stts, 46707f120bcSAlex Elder [IPA_IRQ_EN] = &ipa_reg_ipa_irq_en, 46807f120bcSAlex Elder [IPA_IRQ_CLR] = &ipa_reg_ipa_irq_clr, 46907f120bcSAlex Elder [IPA_IRQ_UC] = &ipa_reg_ipa_irq_uc, 47007f120bcSAlex Elder [IRQ_SUSPEND_INFO] = &ipa_reg_irq_suspend_info, 47107f120bcSAlex Elder [IRQ_SUSPEND_EN] = &ipa_reg_irq_suspend_en, 47207f120bcSAlex Elder [IRQ_SUSPEND_CLR] = &ipa_reg_irq_suspend_clr, 47307f120bcSAlex Elder }; 47407f120bcSAlex Elder 47507f120bcSAlex Elder const struct ipa_regs ipa_regs_v3_1 = { 47607f120bcSAlex Elder .reg_count = ARRAY_SIZE(ipa_reg_array), 47707f120bcSAlex Elder .reg = ipa_reg_array, 47807f120bcSAlex Elder }; 479