18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0 OR MIT) 28c2ecf20Sopenharmony_ci * Microsemi Ocelot Switch driver 38c2ecf20Sopenharmony_ci * Copyright (c) 2019 Microsemi Corporation 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _OCELOT_VCAP_H_ 78c2ecf20Sopenharmony_ci#define _OCELOT_VCAP_H_ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <soc/mscc/ocelot.h> 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci/* ================================================================= 128c2ecf20Sopenharmony_ci * VCAP Common 138c2ecf20Sopenharmony_ci * ================================================================= 148c2ecf20Sopenharmony_ci */ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_cienum { 178c2ecf20Sopenharmony_ci VCAP_ES0, 188c2ecf20Sopenharmony_ci VCAP_IS1, 198c2ecf20Sopenharmony_ci VCAP_IS2, 208c2ecf20Sopenharmony_ci __VCAP_COUNT, 218c2ecf20Sopenharmony_ci}; 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define OCELOT_NUM_VCAP_BLOCKS __VCAP_COUNT 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_cistruct vcap_props { 268c2ecf20Sopenharmony_ci u16 tg_width; /* Type-group width (in bits) */ 278c2ecf20Sopenharmony_ci u16 sw_count; /* Sub word count */ 288c2ecf20Sopenharmony_ci u16 entry_count; /* Entry count */ 298c2ecf20Sopenharmony_ci u16 entry_words; /* Number of entry words */ 308c2ecf20Sopenharmony_ci u16 entry_width; /* Entry width (in bits) */ 318c2ecf20Sopenharmony_ci u16 action_count; /* Action count */ 328c2ecf20Sopenharmony_ci u16 action_words; /* Number of action words */ 338c2ecf20Sopenharmony_ci u16 action_width; /* Action width (in bits) */ 348c2ecf20Sopenharmony_ci u16 action_type_width; /* Action type width (in bits) */ 358c2ecf20Sopenharmony_ci struct { 368c2ecf20Sopenharmony_ci u16 width; /* Action type width (in bits) */ 378c2ecf20Sopenharmony_ci u16 count; /* Action type sub word count */ 388c2ecf20Sopenharmony_ci } action_table[2]; 398c2ecf20Sopenharmony_ci u16 counter_words; /* Number of counter words */ 408c2ecf20Sopenharmony_ci u16 counter_width; /* Counter width (in bits) */ 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci enum ocelot_target target; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci const struct vcap_field *keys; 458c2ecf20Sopenharmony_ci const struct vcap_field *actions; 468c2ecf20Sopenharmony_ci}; 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci/* VCAP Type-Group values */ 498c2ecf20Sopenharmony_ci#define VCAP_TG_NONE 0 /* Entry is invalid */ 508c2ecf20Sopenharmony_ci#define VCAP_TG_FULL 1 /* Full entry */ 518c2ecf20Sopenharmony_ci#define VCAP_TG_HALF 2 /* Half entry */ 528c2ecf20Sopenharmony_ci#define VCAP_TG_QUARTER 3 /* Quarter entry */ 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_CMD(x) (((x) << 22) & GENMASK(24, 22)) 558c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_CMD_M GENMASK(24, 22) 568c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_CMD_X(x) (((x) & GENMASK(24, 22)) >> 22) 578c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_ENTRY_DIS BIT(21) 588c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_ACTION_DIS BIT(20) 598c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_CNT_DIS BIT(19) 608c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_ADDR(x) (((x) << 3) & GENMASK(18, 3)) 618c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_ADDR_M GENMASK(18, 3) 628c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_ADDR_X(x) (((x) & GENMASK(18, 3)) >> 3) 638c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_UPDATE_SHOT BIT(2) 648c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_CLEAR_CACHE BIT(1) 658c2ecf20Sopenharmony_ci#define VCAP_CORE_UPDATE_CTRL_MV_TRAFFIC_IGN BIT(0) 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#define VCAP_CORE_MV_CFG_MV_NUM_POS(x) (((x) << 16) & GENMASK(31, 16)) 688c2ecf20Sopenharmony_ci#define VCAP_CORE_MV_CFG_MV_NUM_POS_M GENMASK(31, 16) 698c2ecf20Sopenharmony_ci#define VCAP_CORE_MV_CFG_MV_NUM_POS_X(x) (((x) & GENMASK(31, 16)) >> 16) 708c2ecf20Sopenharmony_ci#define VCAP_CORE_MV_CFG_MV_SIZE(x) ((x) & GENMASK(15, 0)) 718c2ecf20Sopenharmony_ci#define VCAP_CORE_MV_CFG_MV_SIZE_M GENMASK(15, 0) 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define VCAP_CACHE_ENTRY_DAT_RSZ 0x4 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#define VCAP_CACHE_MASK_DAT_RSZ 0x4 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define VCAP_CACHE_ACTION_DAT_RSZ 0x4 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci#define VCAP_CACHE_CNT_DAT_RSZ 0x4 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#define VCAP_STICKY_VCAP_ROW_DELETED_STICKY BIT(0) 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci#define TCAM_BIST_CTRL_TCAM_BIST BIT(1) 848c2ecf20Sopenharmony_ci#define TCAM_BIST_CTRL_TCAM_INIT BIT(0) 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#define TCAM_BIST_CFG_TCAM_BIST_SOE_ENA BIT(8) 878c2ecf20Sopenharmony_ci#define TCAM_BIST_CFG_TCAM_HCG_DIS BIT(7) 888c2ecf20Sopenharmony_ci#define TCAM_BIST_CFG_TCAM_CG_DIS BIT(6) 898c2ecf20Sopenharmony_ci#define TCAM_BIST_CFG_TCAM_BIAS(x) ((x) & GENMASK(5, 0)) 908c2ecf20Sopenharmony_ci#define TCAM_BIST_CFG_TCAM_BIAS_M GENMASK(5, 0) 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_RT_ERR BIT(15) 938c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_PENC_ERR BIT(14) 948c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_COMP_ERR BIT(13) 958c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_ADDR_ERR BIT(12) 968c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_BL1E_ERR BIT(11) 978c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_BL1_ERR BIT(10) 988c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_BL0E_ERR BIT(9) 998c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_BL0_ERR BIT(8) 1008c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_PH1_ERR BIT(7) 1018c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_PH0_ERR BIT(6) 1028c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_PV1_ERR BIT(5) 1038c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_PV0_ERR BIT(4) 1048c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_RUN BIT(3) 1058c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_ERR BIT(2) 1068c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_BIST_BUSY BIT(1) 1078c2ecf20Sopenharmony_ci#define TCAM_BIST_STAT_TCAM_RDY BIT(0) 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci/* ================================================================= 1108c2ecf20Sopenharmony_ci * VCAP IS2 1118c2ecf20Sopenharmony_ci * ================================================================= 1128c2ecf20Sopenharmony_ci */ 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci/* IS2 half key types */ 1158c2ecf20Sopenharmony_ci#define IS2_TYPE_ETYPE 0 1168c2ecf20Sopenharmony_ci#define IS2_TYPE_LLC 1 1178c2ecf20Sopenharmony_ci#define IS2_TYPE_SNAP 2 1188c2ecf20Sopenharmony_ci#define IS2_TYPE_ARP 3 1198c2ecf20Sopenharmony_ci#define IS2_TYPE_IP_UDP_TCP 4 1208c2ecf20Sopenharmony_ci#define IS2_TYPE_IP_OTHER 5 1218c2ecf20Sopenharmony_ci#define IS2_TYPE_IPV6 6 1228c2ecf20Sopenharmony_ci#define IS2_TYPE_OAM 7 1238c2ecf20Sopenharmony_ci#define IS2_TYPE_SMAC_SIP6 8 1248c2ecf20Sopenharmony_ci#define IS2_TYPE_ANY 100 /* Pseudo type */ 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci/* IS2 half key type mask for matching any IP */ 1278c2ecf20Sopenharmony_ci#define IS2_TYPE_MASK_IP_ANY 0xe 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_cienum { 1308c2ecf20Sopenharmony_ci IS2_ACTION_TYPE_NORMAL, 1318c2ecf20Sopenharmony_ci IS2_ACTION_TYPE_SMAC_SIP, 1328c2ecf20Sopenharmony_ci IS2_ACTION_TYPE_MAX, 1338c2ecf20Sopenharmony_ci}; 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ci/* IS2 MASK_MODE values */ 1368c2ecf20Sopenharmony_ci#define IS2_ACT_MASK_MODE_NONE 0 1378c2ecf20Sopenharmony_ci#define IS2_ACT_MASK_MODE_FILTER 1 1388c2ecf20Sopenharmony_ci#define IS2_ACT_MASK_MODE_POLICY 2 1398c2ecf20Sopenharmony_ci#define IS2_ACT_MASK_MODE_REDIR 3 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_ci/* IS2 REW_OP values */ 1428c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_NONE 0 1438c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ONE 2 1448c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_TWO 3 1458c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_SPECIAL 8 1468c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ORG 9 1478c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ONE_SUB_DELAY_1 (IS2_ACT_REW_OP_PTP_ONE | (1 << 3)) 1488c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ONE_SUB_DELAY_2 (IS2_ACT_REW_OP_PTP_ONE | (2 << 3)) 1498c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ONE_ADD_DELAY (IS2_ACT_REW_OP_PTP_ONE | (1 << 5)) 1508c2ecf20Sopenharmony_ci#define IS2_ACT_REW_OP_PTP_ONE_ADD_SUB BIT(7) 1518c2ecf20Sopenharmony_ci 1528c2ecf20Sopenharmony_ci#define VCAP_PORT_WIDTH 4 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci/* IS2 quarter key - SMAC_SIP4 */ 1558c2ecf20Sopenharmony_ci#define IS2_QKO_IGR_PORT 0 1568c2ecf20Sopenharmony_ci#define IS2_QKL_IGR_PORT VCAP_PORT_WIDTH 1578c2ecf20Sopenharmony_ci#define IS2_QKO_L2_SMAC (IS2_QKO_IGR_PORT + IS2_QKL_IGR_PORT) 1588c2ecf20Sopenharmony_ci#define IS2_QKL_L2_SMAC 48 1598c2ecf20Sopenharmony_ci#define IS2_QKO_L3_IP4_SIP (IS2_QKO_L2_SMAC + IS2_QKL_L2_SMAC) 1608c2ecf20Sopenharmony_ci#define IS2_QKL_L3_IP4_SIP 32 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_cienum vcap_is2_half_key_field { 1638c2ecf20Sopenharmony_ci /* Common */ 1648c2ecf20Sopenharmony_ci VCAP_IS2_TYPE, 1658c2ecf20Sopenharmony_ci VCAP_IS2_HK_FIRST, 1668c2ecf20Sopenharmony_ci VCAP_IS2_HK_PAG, 1678c2ecf20Sopenharmony_ci VCAP_IS2_HK_RSV1, 1688c2ecf20Sopenharmony_ci VCAP_IS2_HK_IGR_PORT_MASK, 1698c2ecf20Sopenharmony_ci VCAP_IS2_HK_RSV2, 1708c2ecf20Sopenharmony_ci VCAP_IS2_HK_HOST_MATCH, 1718c2ecf20Sopenharmony_ci VCAP_IS2_HK_L2_MC, 1728c2ecf20Sopenharmony_ci VCAP_IS2_HK_L2_BC, 1738c2ecf20Sopenharmony_ci VCAP_IS2_HK_VLAN_TAGGED, 1748c2ecf20Sopenharmony_ci VCAP_IS2_HK_VID, 1758c2ecf20Sopenharmony_ci VCAP_IS2_HK_DEI, 1768c2ecf20Sopenharmony_ci VCAP_IS2_HK_PCP, 1778c2ecf20Sopenharmony_ci /* MAC_ETYPE / MAC_LLC / MAC_SNAP / OAM common */ 1788c2ecf20Sopenharmony_ci VCAP_IS2_HK_L2_DMAC, 1798c2ecf20Sopenharmony_ci VCAP_IS2_HK_L2_SMAC, 1808c2ecf20Sopenharmony_ci /* MAC_ETYPE (TYPE=000) */ 1818c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ETYPE_ETYPE, 1828c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD0, 1838c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD1, 1848c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD2, 1858c2ecf20Sopenharmony_ci /* MAC_LLC (TYPE=001) */ 1868c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_LLC_DMAC, 1878c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_LLC_SMAC, 1888c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_LLC_L2_LLC, 1898c2ecf20Sopenharmony_ci /* MAC_SNAP (TYPE=010) */ 1908c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_SNAP_SMAC, 1918c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_SNAP_DMAC, 1928c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_SNAP_L2_SNAP, 1938c2ecf20Sopenharmony_ci /* MAC_ARP (TYPE=011) */ 1948c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_SMAC, 1958c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_ADDR_SPACE_OK, 1968c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_PROTO_SPACE_OK, 1978c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_LEN_OK, 1988c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_TARGET_MATCH, 1998c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_SENDER_MATCH, 2008c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_OPCODE_UNKNOWN, 2018c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_OPCODE, 2028c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_L3_IP4_DIP, 2038c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_L3_IP4_SIP, 2048c2ecf20Sopenharmony_ci VCAP_IS2_HK_MAC_ARP_DIP_EQ_SIP, 2058c2ecf20Sopenharmony_ci /* IP4_TCP_UDP / IP4_OTHER common */ 2068c2ecf20Sopenharmony_ci VCAP_IS2_HK_IP4, 2078c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_FRAGMENT, 2088c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_FRAG_OFS_GT0, 2098c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_OPTIONS, 2108c2ecf20Sopenharmony_ci VCAP_IS2_HK_IP4_L3_TTL_GT0, 2118c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_TOS, 2128c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_IP4_DIP, 2138c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_IP4_SIP, 2148c2ecf20Sopenharmony_ci VCAP_IS2_HK_DIP_EQ_SIP, 2158c2ecf20Sopenharmony_ci /* IP4_TCP_UDP (TYPE=100) */ 2168c2ecf20Sopenharmony_ci VCAP_IS2_HK_TCP, 2178c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_SPORT, 2188c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_DPORT, 2198c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_RNG, 2208c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_SPORT_EQ_DPORT, 2218c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_SEQUENCE_EQ0, 2228c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_URG, 2238c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_ACK, 2248c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_PSH, 2258c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_RST, 2268c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_SYN, 2278c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_FIN, 2288c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_1588_DOM, 2298c2ecf20Sopenharmony_ci VCAP_IS2_HK_L4_1588_VER, 2308c2ecf20Sopenharmony_ci /* IP4_OTHER (TYPE=101) */ 2318c2ecf20Sopenharmony_ci VCAP_IS2_HK_IP4_L3_PROTO, 2328c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_PAYLOAD, 2338c2ecf20Sopenharmony_ci /* IP6_STD (TYPE=110) */ 2348c2ecf20Sopenharmony_ci VCAP_IS2_HK_IP6_L3_TTL_GT0, 2358c2ecf20Sopenharmony_ci VCAP_IS2_HK_IP6_L3_PROTO, 2368c2ecf20Sopenharmony_ci VCAP_IS2_HK_L3_IP6_SIP, 2378c2ecf20Sopenharmony_ci /* OAM (TYPE=111) */ 2388c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_MEL_FLAGS, 2398c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_VER, 2408c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_OPCODE, 2418c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_FLAGS, 2428c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_MEPID, 2438c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_CCM_CNTS_EQ0, 2448c2ecf20Sopenharmony_ci VCAP_IS2_HK_OAM_IS_Y1731, 2458c2ecf20Sopenharmony_ci}; 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_cistruct vcap_field { 2488c2ecf20Sopenharmony_ci int offset; 2498c2ecf20Sopenharmony_ci int length; 2508c2ecf20Sopenharmony_ci}; 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_cienum vcap_is2_action_field { 2538c2ecf20Sopenharmony_ci VCAP_IS2_ACT_HIT_ME_ONCE, 2548c2ecf20Sopenharmony_ci VCAP_IS2_ACT_CPU_COPY_ENA, 2558c2ecf20Sopenharmony_ci VCAP_IS2_ACT_CPU_QU_NUM, 2568c2ecf20Sopenharmony_ci VCAP_IS2_ACT_MASK_MODE, 2578c2ecf20Sopenharmony_ci VCAP_IS2_ACT_MIRROR_ENA, 2588c2ecf20Sopenharmony_ci VCAP_IS2_ACT_LRN_DIS, 2598c2ecf20Sopenharmony_ci VCAP_IS2_ACT_POLICE_ENA, 2608c2ecf20Sopenharmony_ci VCAP_IS2_ACT_POLICE_IDX, 2618c2ecf20Sopenharmony_ci VCAP_IS2_ACT_POLICE_VCAP_ONLY, 2628c2ecf20Sopenharmony_ci VCAP_IS2_ACT_PORT_MASK, 2638c2ecf20Sopenharmony_ci VCAP_IS2_ACT_REW_OP, 2648c2ecf20Sopenharmony_ci VCAP_IS2_ACT_SMAC_REPLACE_ENA, 2658c2ecf20Sopenharmony_ci VCAP_IS2_ACT_RSV, 2668c2ecf20Sopenharmony_ci VCAP_IS2_ACT_ACL_ID, 2678c2ecf20Sopenharmony_ci VCAP_IS2_ACT_HIT_CNT, 2688c2ecf20Sopenharmony_ci}; 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci/* ================================================================= 2718c2ecf20Sopenharmony_ci * VCAP IS1 2728c2ecf20Sopenharmony_ci * ================================================================= 2738c2ecf20Sopenharmony_ci */ 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ci/* IS1 half key types */ 2768c2ecf20Sopenharmony_ci#define IS1_TYPE_S1_NORMAL 0 2778c2ecf20Sopenharmony_ci#define IS1_TYPE_S1_5TUPLE_IP4 1 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ci/* IS1 full key types */ 2808c2ecf20Sopenharmony_ci#define IS1_TYPE_S1_NORMAL_IP6 0 2818c2ecf20Sopenharmony_ci#define IS1_TYPE_S1_7TUPLE 1 2828c2ecf20Sopenharmony_ci#define IS2_TYPE_S1_5TUPLE_IP6 2 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_cienum { 2858c2ecf20Sopenharmony_ci IS1_ACTION_TYPE_NORMAL, 2868c2ecf20Sopenharmony_ci IS1_ACTION_TYPE_MAX, 2878c2ecf20Sopenharmony_ci}; 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_cienum vcap_is1_half_key_field { 2908c2ecf20Sopenharmony_ci VCAP_IS1_HK_TYPE, 2918c2ecf20Sopenharmony_ci VCAP_IS1_HK_LOOKUP, 2928c2ecf20Sopenharmony_ci VCAP_IS1_HK_IGR_PORT_MASK, 2938c2ecf20Sopenharmony_ci VCAP_IS1_HK_RSV, 2948c2ecf20Sopenharmony_ci VCAP_IS1_HK_OAM_Y1731, 2958c2ecf20Sopenharmony_ci VCAP_IS1_HK_L2_MC, 2968c2ecf20Sopenharmony_ci VCAP_IS1_HK_L2_BC, 2978c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP_MC, 2988c2ecf20Sopenharmony_ci VCAP_IS1_HK_VLAN_TAGGED, 2998c2ecf20Sopenharmony_ci VCAP_IS1_HK_VLAN_DBL_TAGGED, 3008c2ecf20Sopenharmony_ci VCAP_IS1_HK_TPID, 3018c2ecf20Sopenharmony_ci VCAP_IS1_HK_VID, 3028c2ecf20Sopenharmony_ci VCAP_IS1_HK_DEI, 3038c2ecf20Sopenharmony_ci VCAP_IS1_HK_PCP, 3048c2ecf20Sopenharmony_ci /* Specific Fields for IS1 Half Key S1_NORMAL */ 3058c2ecf20Sopenharmony_ci VCAP_IS1_HK_L2_SMAC, 3068c2ecf20Sopenharmony_ci VCAP_IS1_HK_ETYPE_LEN, 3078c2ecf20Sopenharmony_ci VCAP_IS1_HK_ETYPE, 3088c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP_SNAP, 3098c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4, 3108c2ecf20Sopenharmony_ci VCAP_IS1_HK_L3_FRAGMENT, 3118c2ecf20Sopenharmony_ci VCAP_IS1_HK_L3_FRAG_OFS_GT0, 3128c2ecf20Sopenharmony_ci VCAP_IS1_HK_L3_OPTIONS, 3138c2ecf20Sopenharmony_ci VCAP_IS1_HK_L3_DSCP, 3148c2ecf20Sopenharmony_ci VCAP_IS1_HK_L3_IP4_SIP, 3158c2ecf20Sopenharmony_ci VCAP_IS1_HK_TCP_UDP, 3168c2ecf20Sopenharmony_ci VCAP_IS1_HK_TCP, 3178c2ecf20Sopenharmony_ci VCAP_IS1_HK_L4_SPORT, 3188c2ecf20Sopenharmony_ci VCAP_IS1_HK_L4_RNG, 3198c2ecf20Sopenharmony_ci /* Specific Fields for IS1 Half Key S1_5TUPLE_IP4 */ 3208c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_INNER_TPID, 3218c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_INNER_VID, 3228c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_INNER_DEI, 3238c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_INNER_PCP, 3248c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_IP4, 3258c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_FRAGMENT, 3268c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_FRAG_OFS_GT0, 3278c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_OPTIONS, 3288c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_DSCP, 3298c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_IP4_DIP, 3308c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_IP4_SIP, 3318c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L3_PROTO, 3328c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_TCP_UDP, 3338c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_TCP, 3348c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_L4_RNG, 3358c2ecf20Sopenharmony_ci VCAP_IS1_HK_IP4_IP_PAYLOAD_S1_5TUPLE, 3368c2ecf20Sopenharmony_ci}; 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_cienum vcap_is1_action_field { 3398c2ecf20Sopenharmony_ci VCAP_IS1_ACT_DSCP_ENA, 3408c2ecf20Sopenharmony_ci VCAP_IS1_ACT_DSCP_VAL, 3418c2ecf20Sopenharmony_ci VCAP_IS1_ACT_QOS_ENA, 3428c2ecf20Sopenharmony_ci VCAP_IS1_ACT_QOS_VAL, 3438c2ecf20Sopenharmony_ci VCAP_IS1_ACT_DP_ENA, 3448c2ecf20Sopenharmony_ci VCAP_IS1_ACT_DP_VAL, 3458c2ecf20Sopenharmony_ci VCAP_IS1_ACT_PAG_OVERRIDE_MASK, 3468c2ecf20Sopenharmony_ci VCAP_IS1_ACT_PAG_VAL, 3478c2ecf20Sopenharmony_ci VCAP_IS1_ACT_RSV, 3488c2ecf20Sopenharmony_ci VCAP_IS1_ACT_VID_REPLACE_ENA, 3498c2ecf20Sopenharmony_ci VCAP_IS1_ACT_VID_ADD_VAL, 3508c2ecf20Sopenharmony_ci VCAP_IS1_ACT_FID_SEL, 3518c2ecf20Sopenharmony_ci VCAP_IS1_ACT_FID_VAL, 3528c2ecf20Sopenharmony_ci VCAP_IS1_ACT_PCP_DEI_ENA, 3538c2ecf20Sopenharmony_ci VCAP_IS1_ACT_PCP_VAL, 3548c2ecf20Sopenharmony_ci VCAP_IS1_ACT_DEI_VAL, 3558c2ecf20Sopenharmony_ci VCAP_IS1_ACT_VLAN_POP_CNT_ENA, 3568c2ecf20Sopenharmony_ci VCAP_IS1_ACT_VLAN_POP_CNT, 3578c2ecf20Sopenharmony_ci VCAP_IS1_ACT_CUSTOM_ACE_TYPE_ENA, 3588c2ecf20Sopenharmony_ci VCAP_IS1_ACT_HIT_STICKY, 3598c2ecf20Sopenharmony_ci}; 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ci/* ================================================================= 3628c2ecf20Sopenharmony_ci * VCAP ES0 3638c2ecf20Sopenharmony_ci * ================================================================= 3648c2ecf20Sopenharmony_ci */ 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_cienum { 3678c2ecf20Sopenharmony_ci ES0_ACTION_TYPE_NORMAL, 3688c2ecf20Sopenharmony_ci ES0_ACTION_TYPE_MAX, 3698c2ecf20Sopenharmony_ci}; 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_cienum vcap_es0_key_field { 3728c2ecf20Sopenharmony_ci VCAP_ES0_EGR_PORT, 3738c2ecf20Sopenharmony_ci VCAP_ES0_IGR_PORT, 3748c2ecf20Sopenharmony_ci VCAP_ES0_RSV, 3758c2ecf20Sopenharmony_ci VCAP_ES0_L2_MC, 3768c2ecf20Sopenharmony_ci VCAP_ES0_L2_BC, 3778c2ecf20Sopenharmony_ci VCAP_ES0_VID, 3788c2ecf20Sopenharmony_ci VCAP_ES0_DP, 3798c2ecf20Sopenharmony_ci VCAP_ES0_PCP, 3808c2ecf20Sopenharmony_ci}; 3818c2ecf20Sopenharmony_ci 3828c2ecf20Sopenharmony_cienum vcap_es0_action_field { 3838c2ecf20Sopenharmony_ci VCAP_ES0_ACT_PUSH_OUTER_TAG, 3848c2ecf20Sopenharmony_ci VCAP_ES0_ACT_PUSH_INNER_TAG, 3858c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_A_TPID_SEL, 3868c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_A_VID_SEL, 3878c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_A_PCP_SEL, 3888c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_A_DEI_SEL, 3898c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_B_TPID_SEL, 3908c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_B_VID_SEL, 3918c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_B_PCP_SEL, 3928c2ecf20Sopenharmony_ci VCAP_ES0_ACT_TAG_B_DEI_SEL, 3938c2ecf20Sopenharmony_ci VCAP_ES0_ACT_VID_A_VAL, 3948c2ecf20Sopenharmony_ci VCAP_ES0_ACT_PCP_A_VAL, 3958c2ecf20Sopenharmony_ci VCAP_ES0_ACT_DEI_A_VAL, 3968c2ecf20Sopenharmony_ci VCAP_ES0_ACT_VID_B_VAL, 3978c2ecf20Sopenharmony_ci VCAP_ES0_ACT_PCP_B_VAL, 3988c2ecf20Sopenharmony_ci VCAP_ES0_ACT_DEI_B_VAL, 3998c2ecf20Sopenharmony_ci VCAP_ES0_ACT_RSV, 4008c2ecf20Sopenharmony_ci VCAP_ES0_ACT_HIT_STICKY, 4018c2ecf20Sopenharmony_ci}; 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ci#endif /* _OCELOT_VCAP_H_ */ 404