162306a36Sopenharmony_ci// SPDX-License-Identifier: (GPL-2.0 OR MIT) 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Microsemi Ocelot Switch driver 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (c) 2017 Microsemi Corporation 662306a36Sopenharmony_ci * Copyright (c) 2021 Innovative Advantage 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci#include <soc/mscc/ocelot_vcap.h> 962306a36Sopenharmony_ci#include <soc/mscc/vsc7514_regs.h> 1062306a36Sopenharmony_ci#include "ocelot.h" 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ciconst struct reg_field vsc7514_regfields[REGFIELD_MAX] = { 1362306a36Sopenharmony_ci [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11), 1462306a36Sopenharmony_ci [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10), 1562306a36Sopenharmony_ci [ANA_ANEVENTS_MSTI_DROP] = REG_FIELD(ANA_ANEVENTS, 27, 27), 1662306a36Sopenharmony_ci [ANA_ANEVENTS_ACLKILL] = REG_FIELD(ANA_ANEVENTS, 26, 26), 1762306a36Sopenharmony_ci [ANA_ANEVENTS_ACLUSED] = REG_FIELD(ANA_ANEVENTS, 25, 25), 1862306a36Sopenharmony_ci [ANA_ANEVENTS_AUTOAGE] = REG_FIELD(ANA_ANEVENTS, 24, 24), 1962306a36Sopenharmony_ci [ANA_ANEVENTS_VS2TTL1] = REG_FIELD(ANA_ANEVENTS, 23, 23), 2062306a36Sopenharmony_ci [ANA_ANEVENTS_STORM_DROP] = REG_FIELD(ANA_ANEVENTS, 22, 22), 2162306a36Sopenharmony_ci [ANA_ANEVENTS_LEARN_DROP] = REG_FIELD(ANA_ANEVENTS, 21, 21), 2262306a36Sopenharmony_ci [ANA_ANEVENTS_AGED_ENTRY] = REG_FIELD(ANA_ANEVENTS, 20, 20), 2362306a36Sopenharmony_ci [ANA_ANEVENTS_CPU_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 19, 19), 2462306a36Sopenharmony_ci [ANA_ANEVENTS_AUTO_LEARN_FAILED] = REG_FIELD(ANA_ANEVENTS, 18, 18), 2562306a36Sopenharmony_ci [ANA_ANEVENTS_LEARN_REMOVE] = REG_FIELD(ANA_ANEVENTS, 17, 17), 2662306a36Sopenharmony_ci [ANA_ANEVENTS_AUTO_LEARNED] = REG_FIELD(ANA_ANEVENTS, 16, 16), 2762306a36Sopenharmony_ci [ANA_ANEVENTS_AUTO_MOVED] = REG_FIELD(ANA_ANEVENTS, 15, 15), 2862306a36Sopenharmony_ci [ANA_ANEVENTS_DROPPED] = REG_FIELD(ANA_ANEVENTS, 14, 14), 2962306a36Sopenharmony_ci [ANA_ANEVENTS_CLASSIFIED_DROP] = REG_FIELD(ANA_ANEVENTS, 13, 13), 3062306a36Sopenharmony_ci [ANA_ANEVENTS_CLASSIFIED_COPY] = REG_FIELD(ANA_ANEVENTS, 12, 12), 3162306a36Sopenharmony_ci [ANA_ANEVENTS_VLAN_DISCARD] = REG_FIELD(ANA_ANEVENTS, 11, 11), 3262306a36Sopenharmony_ci [ANA_ANEVENTS_FWD_DISCARD] = REG_FIELD(ANA_ANEVENTS, 10, 10), 3362306a36Sopenharmony_ci [ANA_ANEVENTS_MULTICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 9, 9), 3462306a36Sopenharmony_ci [ANA_ANEVENTS_UNICAST_FLOOD] = REG_FIELD(ANA_ANEVENTS, 8, 8), 3562306a36Sopenharmony_ci [ANA_ANEVENTS_DEST_KNOWN] = REG_FIELD(ANA_ANEVENTS, 7, 7), 3662306a36Sopenharmony_ci [ANA_ANEVENTS_BUCKET3_MATCH] = REG_FIELD(ANA_ANEVENTS, 6, 6), 3762306a36Sopenharmony_ci [ANA_ANEVENTS_BUCKET2_MATCH] = REG_FIELD(ANA_ANEVENTS, 5, 5), 3862306a36Sopenharmony_ci [ANA_ANEVENTS_BUCKET1_MATCH] = REG_FIELD(ANA_ANEVENTS, 4, 4), 3962306a36Sopenharmony_ci [ANA_ANEVENTS_BUCKET0_MATCH] = REG_FIELD(ANA_ANEVENTS, 3, 3), 4062306a36Sopenharmony_ci [ANA_ANEVENTS_CPU_OPERATION] = REG_FIELD(ANA_ANEVENTS, 2, 2), 4162306a36Sopenharmony_ci [ANA_ANEVENTS_DMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 1, 1), 4262306a36Sopenharmony_ci [ANA_ANEVENTS_SMAC_LOOKUP] = REG_FIELD(ANA_ANEVENTS, 0, 0), 4362306a36Sopenharmony_ci [ANA_TABLES_MACACCESS_B_DOM] = REG_FIELD(ANA_TABLES_MACACCESS, 18, 18), 4462306a36Sopenharmony_ci [ANA_TABLES_MACTINDX_BUCKET] = REG_FIELD(ANA_TABLES_MACTINDX, 10, 11), 4562306a36Sopenharmony_ci [ANA_TABLES_MACTINDX_M_INDEX] = REG_FIELD(ANA_TABLES_MACTINDX, 0, 9), 4662306a36Sopenharmony_ci [QSYS_TIMED_FRAME_ENTRY_TFRM_VLD] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 20, 20), 4762306a36Sopenharmony_ci [QSYS_TIMED_FRAME_ENTRY_TFRM_FP] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 8, 19), 4862306a36Sopenharmony_ci [QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 4, 7), 4962306a36Sopenharmony_ci [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 1, 3), 5062306a36Sopenharmony_ci [QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T] = REG_FIELD(QSYS_TIMED_FRAME_ENTRY, 0, 0), 5162306a36Sopenharmony_ci [SYS_RESET_CFG_CORE_ENA] = REG_FIELD(SYS_RESET_CFG, 2, 2), 5262306a36Sopenharmony_ci [SYS_RESET_CFG_MEM_ENA] = REG_FIELD(SYS_RESET_CFG, 1, 1), 5362306a36Sopenharmony_ci [SYS_RESET_CFG_MEM_INIT] = REG_FIELD(SYS_RESET_CFG, 0, 0), 5462306a36Sopenharmony_ci /* Replicated per number of ports (12), register size 4 per port */ 5562306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_PORT_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 14, 14, 12, 4), 5662306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 11, 13, 12, 4), 5762306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_YEL_RSRVD] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 10, 10, 12, 4), 5862306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 9, 9, 12, 4), 5962306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_TX_PFC_ENA] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 1, 8, 12, 4), 6062306a36Sopenharmony_ci [QSYS_SWITCH_PORT_MODE_TX_PFC_MODE] = REG_FIELD_ID(QSYS_SWITCH_PORT_MODE, 0, 0, 12, 4), 6162306a36Sopenharmony_ci [SYS_PORT_MODE_DATA_WO_TS] = REG_FIELD_ID(SYS_PORT_MODE, 5, 6, 12, 4), 6262306a36Sopenharmony_ci [SYS_PORT_MODE_INCL_INJ_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 3, 4, 12, 4), 6362306a36Sopenharmony_ci [SYS_PORT_MODE_INCL_XTR_HDR] = REG_FIELD_ID(SYS_PORT_MODE, 1, 2, 12, 4), 6462306a36Sopenharmony_ci [SYS_PORT_MODE_INCL_HDR_ERR] = REG_FIELD_ID(SYS_PORT_MODE, 0, 0, 12, 4), 6562306a36Sopenharmony_ci [SYS_PAUSE_CFG_PAUSE_START] = REG_FIELD_ID(SYS_PAUSE_CFG, 10, 18, 12, 4), 6662306a36Sopenharmony_ci [SYS_PAUSE_CFG_PAUSE_STOP] = REG_FIELD_ID(SYS_PAUSE_CFG, 1, 9, 12, 4), 6762306a36Sopenharmony_ci [SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 12, 4), 6862306a36Sopenharmony_ci}; 6962306a36Sopenharmony_ciEXPORT_SYMBOL(vsc7514_regfields); 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_cistatic const u32 vsc7514_ana_regmap[] = { 7262306a36Sopenharmony_ci REG(ANA_ADVLEARN, 0x009000), 7362306a36Sopenharmony_ci REG(ANA_VLANMASK, 0x009004), 7462306a36Sopenharmony_ci REG(ANA_PORT_B_DOMAIN, 0x009008), 7562306a36Sopenharmony_ci REG(ANA_ANAGEFIL, 0x00900c), 7662306a36Sopenharmony_ci REG(ANA_ANEVENTS, 0x009010), 7762306a36Sopenharmony_ci REG(ANA_STORMLIMIT_BURST, 0x009014), 7862306a36Sopenharmony_ci REG(ANA_STORMLIMIT_CFG, 0x009018), 7962306a36Sopenharmony_ci REG(ANA_ISOLATED_PORTS, 0x009028), 8062306a36Sopenharmony_ci REG(ANA_COMMUNITY_PORTS, 0x00902c), 8162306a36Sopenharmony_ci REG(ANA_AUTOAGE, 0x009030), 8262306a36Sopenharmony_ci REG(ANA_MACTOPTIONS, 0x009034), 8362306a36Sopenharmony_ci REG(ANA_LEARNDISC, 0x009038), 8462306a36Sopenharmony_ci REG(ANA_AGENCTRL, 0x00903c), 8562306a36Sopenharmony_ci REG(ANA_MIRRORPORTS, 0x009040), 8662306a36Sopenharmony_ci REG(ANA_EMIRRORPORTS, 0x009044), 8762306a36Sopenharmony_ci REG(ANA_FLOODING, 0x009048), 8862306a36Sopenharmony_ci REG(ANA_FLOODING_IPMC, 0x00904c), 8962306a36Sopenharmony_ci REG(ANA_SFLOW_CFG, 0x009050), 9062306a36Sopenharmony_ci REG(ANA_PORT_MODE, 0x009080), 9162306a36Sopenharmony_ci REG(ANA_PGID_PGID, 0x008c00), 9262306a36Sopenharmony_ci REG(ANA_TABLES_ANMOVED, 0x008b30), 9362306a36Sopenharmony_ci REG(ANA_TABLES_MACHDATA, 0x008b34), 9462306a36Sopenharmony_ci REG(ANA_TABLES_MACLDATA, 0x008b38), 9562306a36Sopenharmony_ci REG(ANA_TABLES_MACACCESS, 0x008b3c), 9662306a36Sopenharmony_ci REG(ANA_TABLES_MACTINDX, 0x008b40), 9762306a36Sopenharmony_ci REG(ANA_TABLES_VLANACCESS, 0x008b44), 9862306a36Sopenharmony_ci REG(ANA_TABLES_VLANTIDX, 0x008b48), 9962306a36Sopenharmony_ci REG(ANA_TABLES_ISDXACCESS, 0x008b4c), 10062306a36Sopenharmony_ci REG(ANA_TABLES_ISDXTIDX, 0x008b50), 10162306a36Sopenharmony_ci REG(ANA_TABLES_ENTRYLIM, 0x008b00), 10262306a36Sopenharmony_ci REG(ANA_TABLES_PTP_ID_HIGH, 0x008b54), 10362306a36Sopenharmony_ci REG(ANA_TABLES_PTP_ID_LOW, 0x008b58), 10462306a36Sopenharmony_ci REG(ANA_MSTI_STATE, 0x008e00), 10562306a36Sopenharmony_ci REG(ANA_PORT_VLAN_CFG, 0x007000), 10662306a36Sopenharmony_ci REG(ANA_PORT_DROP_CFG, 0x007004), 10762306a36Sopenharmony_ci REG(ANA_PORT_QOS_CFG, 0x007008), 10862306a36Sopenharmony_ci REG(ANA_PORT_VCAP_CFG, 0x00700c), 10962306a36Sopenharmony_ci REG(ANA_PORT_VCAP_S1_KEY_CFG, 0x007010), 11062306a36Sopenharmony_ci REG(ANA_PORT_VCAP_S2_CFG, 0x00701c), 11162306a36Sopenharmony_ci REG(ANA_PORT_PCP_DEI_MAP, 0x007020), 11262306a36Sopenharmony_ci REG(ANA_PORT_CPU_FWD_CFG, 0x007060), 11362306a36Sopenharmony_ci REG(ANA_PORT_CPU_FWD_BPDU_CFG, 0x007064), 11462306a36Sopenharmony_ci REG(ANA_PORT_CPU_FWD_GARP_CFG, 0x007068), 11562306a36Sopenharmony_ci REG(ANA_PORT_CPU_FWD_CCM_CFG, 0x00706c), 11662306a36Sopenharmony_ci REG(ANA_PORT_PORT_CFG, 0x007070), 11762306a36Sopenharmony_ci REG(ANA_PORT_POL_CFG, 0x007074), 11862306a36Sopenharmony_ci REG(ANA_PORT_PTP_CFG, 0x007078), 11962306a36Sopenharmony_ci REG(ANA_PORT_PTP_DLY1_CFG, 0x00707c), 12062306a36Sopenharmony_ci REG(ANA_OAM_UPM_LM_CNT, 0x007c00), 12162306a36Sopenharmony_ci REG(ANA_PORT_PTP_DLY2_CFG, 0x007080), 12262306a36Sopenharmony_ci REG(ANA_PFC_PFC_CFG, 0x008800), 12362306a36Sopenharmony_ci REG(ANA_PFC_PFC_TIMER, 0x008804), 12462306a36Sopenharmony_ci REG(ANA_IPT_OAM_MEP_CFG, 0x008000), 12562306a36Sopenharmony_ci REG(ANA_IPT_IPT, 0x008004), 12662306a36Sopenharmony_ci REG(ANA_PPT_PPT, 0x008ac0), 12762306a36Sopenharmony_ci REG(ANA_FID_MAP_FID_MAP, 0x000000), 12862306a36Sopenharmony_ci REG(ANA_AGGR_CFG, 0x0090b4), 12962306a36Sopenharmony_ci REG(ANA_CPUQ_CFG, 0x0090b8), 13062306a36Sopenharmony_ci REG(ANA_CPUQ_CFG2, 0x0090bc), 13162306a36Sopenharmony_ci REG(ANA_CPUQ_8021_CFG, 0x0090c0), 13262306a36Sopenharmony_ci REG(ANA_DSCP_CFG, 0x009100), 13362306a36Sopenharmony_ci REG(ANA_DSCP_REWR_CFG, 0x009200), 13462306a36Sopenharmony_ci REG(ANA_VCAP_RNG_TYPE_CFG, 0x009240), 13562306a36Sopenharmony_ci REG(ANA_VCAP_RNG_VAL_CFG, 0x009260), 13662306a36Sopenharmony_ci REG(ANA_VRAP_CFG, 0x009280), 13762306a36Sopenharmony_ci REG(ANA_VRAP_HDR_DATA, 0x009284), 13862306a36Sopenharmony_ci REG(ANA_VRAP_HDR_MASK, 0x009288), 13962306a36Sopenharmony_ci REG(ANA_DISCARD_CFG, 0x00928c), 14062306a36Sopenharmony_ci REG(ANA_FID_CFG, 0x009290), 14162306a36Sopenharmony_ci REG(ANA_POL_PIR_CFG, 0x004000), 14262306a36Sopenharmony_ci REG(ANA_POL_CIR_CFG, 0x004004), 14362306a36Sopenharmony_ci REG(ANA_POL_MODE_CFG, 0x004008), 14462306a36Sopenharmony_ci REG(ANA_POL_PIR_STATE, 0x00400c), 14562306a36Sopenharmony_ci REG(ANA_POL_CIR_STATE, 0x004010), 14662306a36Sopenharmony_ci REG(ANA_POL_STATE, 0x004014), 14762306a36Sopenharmony_ci REG(ANA_POL_FLOWC, 0x008b80), 14862306a36Sopenharmony_ci REG(ANA_POL_HYST, 0x008bec), 14962306a36Sopenharmony_ci REG(ANA_POL_MISC_CFG, 0x008bf0), 15062306a36Sopenharmony_ci}; 15162306a36Sopenharmony_ci 15262306a36Sopenharmony_cistatic const u32 vsc7514_qs_regmap[] = { 15362306a36Sopenharmony_ci REG(QS_XTR_GRP_CFG, 0x000000), 15462306a36Sopenharmony_ci REG(QS_XTR_RD, 0x000008), 15562306a36Sopenharmony_ci REG(QS_XTR_FRM_PRUNING, 0x000010), 15662306a36Sopenharmony_ci REG(QS_XTR_FLUSH, 0x000018), 15762306a36Sopenharmony_ci REG(QS_XTR_DATA_PRESENT, 0x00001c), 15862306a36Sopenharmony_ci REG(QS_XTR_CFG, 0x000020), 15962306a36Sopenharmony_ci REG(QS_INJ_GRP_CFG, 0x000024), 16062306a36Sopenharmony_ci REG(QS_INJ_WR, 0x00002c), 16162306a36Sopenharmony_ci REG(QS_INJ_CTRL, 0x000034), 16262306a36Sopenharmony_ci REG(QS_INJ_STATUS, 0x00003c), 16362306a36Sopenharmony_ci REG(QS_INJ_ERR, 0x000040), 16462306a36Sopenharmony_ci REG(QS_INH_DBG, 0x000048), 16562306a36Sopenharmony_ci}; 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_cistatic const u32 vsc7514_qsys_regmap[] = { 16862306a36Sopenharmony_ci REG(QSYS_PORT_MODE, 0x011200), 16962306a36Sopenharmony_ci REG(QSYS_SWITCH_PORT_MODE, 0x011234), 17062306a36Sopenharmony_ci REG(QSYS_STAT_CNT_CFG, 0x011264), 17162306a36Sopenharmony_ci REG(QSYS_EEE_CFG, 0x011268), 17262306a36Sopenharmony_ci REG(QSYS_EEE_THRES, 0x011294), 17362306a36Sopenharmony_ci REG(QSYS_IGR_NO_SHARING, 0x011298), 17462306a36Sopenharmony_ci REG(QSYS_EGR_NO_SHARING, 0x01129c), 17562306a36Sopenharmony_ci REG(QSYS_SW_STATUS, 0x0112a0), 17662306a36Sopenharmony_ci REG(QSYS_EXT_CPU_CFG, 0x0112d0), 17762306a36Sopenharmony_ci REG(QSYS_PAD_CFG, 0x0112d4), 17862306a36Sopenharmony_ci REG(QSYS_CPU_GROUP_MAP, 0x0112d8), 17962306a36Sopenharmony_ci REG(QSYS_QMAP, 0x0112dc), 18062306a36Sopenharmony_ci REG(QSYS_ISDX_SGRP, 0x011400), 18162306a36Sopenharmony_ci REG(QSYS_TIMED_FRAME_ENTRY, 0x014000), 18262306a36Sopenharmony_ci REG(QSYS_TFRM_MISC, 0x011310), 18362306a36Sopenharmony_ci REG(QSYS_TFRM_PORT_DLY, 0x011314), 18462306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_1, 0x011318), 18562306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_2, 0x01131c), 18662306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_3, 0x011320), 18762306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_4, 0x011324), 18862306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_5, 0x011328), 18962306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_6, 0x01132c), 19062306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_7, 0x011330), 19162306a36Sopenharmony_ci REG(QSYS_TFRM_TIMER_CFG_8, 0x011334), 19262306a36Sopenharmony_ci REG(QSYS_RED_PROFILE, 0x011338), 19362306a36Sopenharmony_ci REG(QSYS_RES_QOS_MODE, 0x011378), 19462306a36Sopenharmony_ci REG(QSYS_RES_CFG, 0x012000), 19562306a36Sopenharmony_ci REG(QSYS_RES_STAT, 0x012004), 19662306a36Sopenharmony_ci REG(QSYS_EGR_DROP_MODE, 0x01137c), 19762306a36Sopenharmony_ci REG(QSYS_EQ_CTRL, 0x011380), 19862306a36Sopenharmony_ci REG(QSYS_EVENTS_CORE, 0x011384), 19962306a36Sopenharmony_ci REG(QSYS_CIR_CFG, 0x000000), 20062306a36Sopenharmony_ci REG(QSYS_EIR_CFG, 0x000004), 20162306a36Sopenharmony_ci REG(QSYS_SE_CFG, 0x000008), 20262306a36Sopenharmony_ci REG(QSYS_SE_DWRR_CFG, 0x00000c), 20362306a36Sopenharmony_ci REG(QSYS_SE_CONNECT, 0x00003c), 20462306a36Sopenharmony_ci REG(QSYS_SE_DLB_SENSE, 0x000040), 20562306a36Sopenharmony_ci REG(QSYS_CIR_STATE, 0x000044), 20662306a36Sopenharmony_ci REG(QSYS_EIR_STATE, 0x000048), 20762306a36Sopenharmony_ci REG(QSYS_SE_STATE, 0x00004c), 20862306a36Sopenharmony_ci REG(QSYS_HSCH_MISC_CFG, 0x011388), 20962306a36Sopenharmony_ci}; 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_cistatic const u32 vsc7514_rew_regmap[] = { 21262306a36Sopenharmony_ci REG(REW_PORT_VLAN_CFG, 0x000000), 21362306a36Sopenharmony_ci REG(REW_TAG_CFG, 0x000004), 21462306a36Sopenharmony_ci REG(REW_PORT_CFG, 0x000008), 21562306a36Sopenharmony_ci REG(REW_DSCP_CFG, 0x00000c), 21662306a36Sopenharmony_ci REG(REW_PCP_DEI_QOS_MAP_CFG, 0x000010), 21762306a36Sopenharmony_ci REG(REW_PTP_CFG, 0x000050), 21862306a36Sopenharmony_ci REG(REW_PTP_DLY1_CFG, 0x000054), 21962306a36Sopenharmony_ci REG(REW_DSCP_REMAP_DP1_CFG, 0x000690), 22062306a36Sopenharmony_ci REG(REW_DSCP_REMAP_CFG, 0x000790), 22162306a36Sopenharmony_ci REG(REW_STAT_CFG, 0x000890), 22262306a36Sopenharmony_ci REG(REW_PPT, 0x000680), 22362306a36Sopenharmony_ci}; 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_cistatic const u32 vsc7514_sys_regmap[] = { 22662306a36Sopenharmony_ci REG(SYS_COUNT_RX_OCTETS, 0x000000), 22762306a36Sopenharmony_ci REG(SYS_COUNT_RX_UNICAST, 0x000004), 22862306a36Sopenharmony_ci REG(SYS_COUNT_RX_MULTICAST, 0x000008), 22962306a36Sopenharmony_ci REG(SYS_COUNT_RX_BROADCAST, 0x00000c), 23062306a36Sopenharmony_ci REG(SYS_COUNT_RX_SHORTS, 0x000010), 23162306a36Sopenharmony_ci REG(SYS_COUNT_RX_FRAGMENTS, 0x000014), 23262306a36Sopenharmony_ci REG(SYS_COUNT_RX_JABBERS, 0x000018), 23362306a36Sopenharmony_ci REG(SYS_COUNT_RX_CRC_ALIGN_ERRS, 0x00001c), 23462306a36Sopenharmony_ci REG(SYS_COUNT_RX_SYM_ERRS, 0x000020), 23562306a36Sopenharmony_ci REG(SYS_COUNT_RX_64, 0x000024), 23662306a36Sopenharmony_ci REG(SYS_COUNT_RX_65_127, 0x000028), 23762306a36Sopenharmony_ci REG(SYS_COUNT_RX_128_255, 0x00002c), 23862306a36Sopenharmony_ci REG(SYS_COUNT_RX_256_511, 0x000030), 23962306a36Sopenharmony_ci REG(SYS_COUNT_RX_512_1023, 0x000034), 24062306a36Sopenharmony_ci REG(SYS_COUNT_RX_1024_1526, 0x000038), 24162306a36Sopenharmony_ci REG(SYS_COUNT_RX_1527_MAX, 0x00003c), 24262306a36Sopenharmony_ci REG(SYS_COUNT_RX_PAUSE, 0x000040), 24362306a36Sopenharmony_ci REG(SYS_COUNT_RX_CONTROL, 0x000044), 24462306a36Sopenharmony_ci REG(SYS_COUNT_RX_LONGS, 0x000048), 24562306a36Sopenharmony_ci REG(SYS_COUNT_RX_CLASSIFIED_DROPS, 0x00004c), 24662306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_0, 0x000050), 24762306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_1, 0x000054), 24862306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_2, 0x000058), 24962306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_3, 0x00005c), 25062306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_4, 0x000060), 25162306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_5, 0x000064), 25262306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_6, 0x000068), 25362306a36Sopenharmony_ci REG(SYS_COUNT_RX_RED_PRIO_7, 0x00006c), 25462306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_0, 0x000070), 25562306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_1, 0x000074), 25662306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_2, 0x000078), 25762306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_3, 0x00007c), 25862306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_4, 0x000080), 25962306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_5, 0x000084), 26062306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_6, 0x000088), 26162306a36Sopenharmony_ci REG(SYS_COUNT_RX_YELLOW_PRIO_7, 0x00008c), 26262306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_0, 0x000090), 26362306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_1, 0x000094), 26462306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_2, 0x000098), 26562306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_3, 0x00009c), 26662306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_4, 0x0000a0), 26762306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_5, 0x0000a4), 26862306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_6, 0x0000a8), 26962306a36Sopenharmony_ci REG(SYS_COUNT_RX_GREEN_PRIO_7, 0x0000ac), 27062306a36Sopenharmony_ci REG(SYS_COUNT_TX_OCTETS, 0x000100), 27162306a36Sopenharmony_ci REG(SYS_COUNT_TX_UNICAST, 0x000104), 27262306a36Sopenharmony_ci REG(SYS_COUNT_TX_MULTICAST, 0x000108), 27362306a36Sopenharmony_ci REG(SYS_COUNT_TX_BROADCAST, 0x00010c), 27462306a36Sopenharmony_ci REG(SYS_COUNT_TX_COLLISION, 0x000110), 27562306a36Sopenharmony_ci REG(SYS_COUNT_TX_DROPS, 0x000114), 27662306a36Sopenharmony_ci REG(SYS_COUNT_TX_PAUSE, 0x000118), 27762306a36Sopenharmony_ci REG(SYS_COUNT_TX_64, 0x00011c), 27862306a36Sopenharmony_ci REG(SYS_COUNT_TX_65_127, 0x000120), 27962306a36Sopenharmony_ci REG(SYS_COUNT_TX_128_255, 0x000124), 28062306a36Sopenharmony_ci REG(SYS_COUNT_TX_256_511, 0x000128), 28162306a36Sopenharmony_ci REG(SYS_COUNT_TX_512_1023, 0x00012c), 28262306a36Sopenharmony_ci REG(SYS_COUNT_TX_1024_1526, 0x000130), 28362306a36Sopenharmony_ci REG(SYS_COUNT_TX_1527_MAX, 0x000134), 28462306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_0, 0x000138), 28562306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_1, 0x00013c), 28662306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_2, 0x000140), 28762306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_3, 0x000144), 28862306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_4, 0x000148), 28962306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_5, 0x00014c), 29062306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_6, 0x000150), 29162306a36Sopenharmony_ci REG(SYS_COUNT_TX_YELLOW_PRIO_7, 0x000154), 29262306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_0, 0x000158), 29362306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_1, 0x00015c), 29462306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_2, 0x000160), 29562306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_3, 0x000164), 29662306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_4, 0x000168), 29762306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_5, 0x00016c), 29862306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_6, 0x000170), 29962306a36Sopenharmony_ci REG(SYS_COUNT_TX_GREEN_PRIO_7, 0x000174), 30062306a36Sopenharmony_ci REG(SYS_COUNT_TX_AGED, 0x000178), 30162306a36Sopenharmony_ci REG(SYS_COUNT_DROP_LOCAL, 0x000200), 30262306a36Sopenharmony_ci REG(SYS_COUNT_DROP_TAIL, 0x000204), 30362306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_0, 0x000208), 30462306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_1, 0x00020c), 30562306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_2, 0x000210), 30662306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_3, 0x000214), 30762306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_4, 0x000218), 30862306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_5, 0x00021c), 30962306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_6, 0x000220), 31062306a36Sopenharmony_ci REG(SYS_COUNT_DROP_YELLOW_PRIO_7, 0x000224), 31162306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_0, 0x000228), 31262306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_1, 0x00022c), 31362306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_2, 0x000230), 31462306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_3, 0x000234), 31562306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_4, 0x000238), 31662306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_5, 0x00023c), 31762306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_6, 0x000240), 31862306a36Sopenharmony_ci REG(SYS_COUNT_DROP_GREEN_PRIO_7, 0x000244), 31962306a36Sopenharmony_ci REG(SYS_RESET_CFG, 0x000508), 32062306a36Sopenharmony_ci REG(SYS_CMID, 0x00050c), 32162306a36Sopenharmony_ci REG(SYS_VLAN_ETYPE_CFG, 0x000510), 32262306a36Sopenharmony_ci REG(SYS_PORT_MODE, 0x000514), 32362306a36Sopenharmony_ci REG(SYS_FRONT_PORT_MODE, 0x000548), 32462306a36Sopenharmony_ci REG(SYS_FRM_AGING, 0x000574), 32562306a36Sopenharmony_ci REG(SYS_STAT_CFG, 0x000578), 32662306a36Sopenharmony_ci REG(SYS_SW_STATUS, 0x00057c), 32762306a36Sopenharmony_ci REG(SYS_MISC_CFG, 0x0005ac), 32862306a36Sopenharmony_ci REG(SYS_REW_MAC_HIGH_CFG, 0x0005b0), 32962306a36Sopenharmony_ci REG(SYS_REW_MAC_LOW_CFG, 0x0005dc), 33062306a36Sopenharmony_ci REG(SYS_CM_ADDR, 0x000500), 33162306a36Sopenharmony_ci REG(SYS_CM_DATA, 0x000504), 33262306a36Sopenharmony_ci REG(SYS_PAUSE_CFG, 0x000608), 33362306a36Sopenharmony_ci REG(SYS_PAUSE_TOT_CFG, 0x000638), 33462306a36Sopenharmony_ci REG(SYS_ATOP, 0x00063c), 33562306a36Sopenharmony_ci REG(SYS_ATOP_TOT_CFG, 0x00066c), 33662306a36Sopenharmony_ci REG(SYS_MAC_FC_CFG, 0x000670), 33762306a36Sopenharmony_ci REG(SYS_MMGT, 0x00069c), 33862306a36Sopenharmony_ci REG(SYS_MMGT_FAST, 0x0006a0), 33962306a36Sopenharmony_ci REG(SYS_EVENTS_DIF, 0x0006a4), 34062306a36Sopenharmony_ci REG(SYS_EVENTS_CORE, 0x0006b4), 34162306a36Sopenharmony_ci REG(SYS_PTP_STATUS, 0x0006b8), 34262306a36Sopenharmony_ci REG(SYS_PTP_TXSTAMP, 0x0006bc), 34362306a36Sopenharmony_ci REG(SYS_PTP_NXT, 0x0006c0), 34462306a36Sopenharmony_ci REG(SYS_PTP_CFG, 0x0006c4), 34562306a36Sopenharmony_ci}; 34662306a36Sopenharmony_ci 34762306a36Sopenharmony_cistatic const u32 vsc7514_vcap_regmap[] = { 34862306a36Sopenharmony_ci /* VCAP_CORE_CFG */ 34962306a36Sopenharmony_ci REG(VCAP_CORE_UPDATE_CTRL, 0x000000), 35062306a36Sopenharmony_ci REG(VCAP_CORE_MV_CFG, 0x000004), 35162306a36Sopenharmony_ci /* VCAP_CORE_CACHE */ 35262306a36Sopenharmony_ci REG(VCAP_CACHE_ENTRY_DAT, 0x000008), 35362306a36Sopenharmony_ci REG(VCAP_CACHE_MASK_DAT, 0x000108), 35462306a36Sopenharmony_ci REG(VCAP_CACHE_ACTION_DAT, 0x000208), 35562306a36Sopenharmony_ci REG(VCAP_CACHE_CNT_DAT, 0x000308), 35662306a36Sopenharmony_ci REG(VCAP_CACHE_TG_DAT, 0x000388), 35762306a36Sopenharmony_ci /* VCAP_CONST */ 35862306a36Sopenharmony_ci REG(VCAP_CONST_VCAP_VER, 0x000398), 35962306a36Sopenharmony_ci REG(VCAP_CONST_ENTRY_WIDTH, 0x00039c), 36062306a36Sopenharmony_ci REG(VCAP_CONST_ENTRY_CNT, 0x0003a0), 36162306a36Sopenharmony_ci REG(VCAP_CONST_ENTRY_SWCNT, 0x0003a4), 36262306a36Sopenharmony_ci REG(VCAP_CONST_ENTRY_TG_WIDTH, 0x0003a8), 36362306a36Sopenharmony_ci REG(VCAP_CONST_ACTION_DEF_CNT, 0x0003ac), 36462306a36Sopenharmony_ci REG(VCAP_CONST_ACTION_WIDTH, 0x0003b0), 36562306a36Sopenharmony_ci REG(VCAP_CONST_CNT_WIDTH, 0x0003b4), 36662306a36Sopenharmony_ci REG(VCAP_CONST_CORE_CNT, 0x0003b8), 36762306a36Sopenharmony_ci REG(VCAP_CONST_IF_CNT, 0x0003bc), 36862306a36Sopenharmony_ci}; 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_cistatic const u32 vsc7514_ptp_regmap[] = { 37162306a36Sopenharmony_ci REG(PTP_PIN_CFG, 0x000000), 37262306a36Sopenharmony_ci REG(PTP_PIN_TOD_SEC_MSB, 0x000004), 37362306a36Sopenharmony_ci REG(PTP_PIN_TOD_SEC_LSB, 0x000008), 37462306a36Sopenharmony_ci REG(PTP_PIN_TOD_NSEC, 0x00000c), 37562306a36Sopenharmony_ci REG(PTP_PIN_WF_HIGH_PERIOD, 0x000014), 37662306a36Sopenharmony_ci REG(PTP_PIN_WF_LOW_PERIOD, 0x000018), 37762306a36Sopenharmony_ci REG(PTP_CFG_MISC, 0x0000a0), 37862306a36Sopenharmony_ci REG(PTP_CLK_CFG_ADJ_CFG, 0x0000a4), 37962306a36Sopenharmony_ci REG(PTP_CLK_CFG_ADJ_FREQ, 0x0000a8), 38062306a36Sopenharmony_ci}; 38162306a36Sopenharmony_ci 38262306a36Sopenharmony_cistatic const u32 vsc7514_dev_gmii_regmap[] = { 38362306a36Sopenharmony_ci REG(DEV_CLOCK_CFG, 0x0), 38462306a36Sopenharmony_ci REG(DEV_PORT_MISC, 0x4), 38562306a36Sopenharmony_ci REG(DEV_EVENTS, 0x8), 38662306a36Sopenharmony_ci REG(DEV_EEE_CFG, 0xc), 38762306a36Sopenharmony_ci REG(DEV_RX_PATH_DELAY, 0x10), 38862306a36Sopenharmony_ci REG(DEV_TX_PATH_DELAY, 0x14), 38962306a36Sopenharmony_ci REG(DEV_PTP_PREDICT_CFG, 0x18), 39062306a36Sopenharmony_ci REG(DEV_MAC_ENA_CFG, 0x1c), 39162306a36Sopenharmony_ci REG(DEV_MAC_MODE_CFG, 0x20), 39262306a36Sopenharmony_ci REG(DEV_MAC_MAXLEN_CFG, 0x24), 39362306a36Sopenharmony_ci REG(DEV_MAC_TAGS_CFG, 0x28), 39462306a36Sopenharmony_ci REG(DEV_MAC_ADV_CHK_CFG, 0x2c), 39562306a36Sopenharmony_ci REG(DEV_MAC_IFG_CFG, 0x30), 39662306a36Sopenharmony_ci REG(DEV_MAC_HDX_CFG, 0x34), 39762306a36Sopenharmony_ci REG(DEV_MAC_DBG_CFG, 0x38), 39862306a36Sopenharmony_ci REG(DEV_MAC_FC_MAC_LOW_CFG, 0x3c), 39962306a36Sopenharmony_ci REG(DEV_MAC_FC_MAC_HIGH_CFG, 0x40), 40062306a36Sopenharmony_ci REG(DEV_MAC_STICKY, 0x44), 40162306a36Sopenharmony_ci REG(PCS1G_CFG, 0x48), 40262306a36Sopenharmony_ci REG(PCS1G_MODE_CFG, 0x4c), 40362306a36Sopenharmony_ci REG(PCS1G_SD_CFG, 0x50), 40462306a36Sopenharmony_ci REG(PCS1G_ANEG_CFG, 0x54), 40562306a36Sopenharmony_ci REG(PCS1G_ANEG_NP_CFG, 0x58), 40662306a36Sopenharmony_ci REG(PCS1G_LB_CFG, 0x5c), 40762306a36Sopenharmony_ci REG(PCS1G_DBG_CFG, 0x60), 40862306a36Sopenharmony_ci REG(PCS1G_CDET_CFG, 0x64), 40962306a36Sopenharmony_ci REG(PCS1G_ANEG_STATUS, 0x68), 41062306a36Sopenharmony_ci REG(PCS1G_ANEG_NP_STATUS, 0x6c), 41162306a36Sopenharmony_ci REG(PCS1G_LINK_STATUS, 0x70), 41262306a36Sopenharmony_ci REG(PCS1G_LINK_DOWN_CNT, 0x74), 41362306a36Sopenharmony_ci REG(PCS1G_STICKY, 0x78), 41462306a36Sopenharmony_ci REG(PCS1G_DEBUG_STATUS, 0x7c), 41562306a36Sopenharmony_ci REG(PCS1G_LPI_CFG, 0x80), 41662306a36Sopenharmony_ci REG(PCS1G_LPI_WAKE_ERROR_CNT, 0x84), 41762306a36Sopenharmony_ci REG(PCS1G_LPI_STATUS, 0x88), 41862306a36Sopenharmony_ci REG(PCS1G_TSTPAT_MODE_CFG, 0x8c), 41962306a36Sopenharmony_ci REG(PCS1G_TSTPAT_STATUS, 0x90), 42062306a36Sopenharmony_ci REG(DEV_PCS_FX100_CFG, 0x94), 42162306a36Sopenharmony_ci REG(DEV_PCS_FX100_STATUS, 0x98), 42262306a36Sopenharmony_ci}; 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ciconst u32 *vsc7514_regmap[TARGET_MAX] = { 42562306a36Sopenharmony_ci [ANA] = vsc7514_ana_regmap, 42662306a36Sopenharmony_ci [QS] = vsc7514_qs_regmap, 42762306a36Sopenharmony_ci [QSYS] = vsc7514_qsys_regmap, 42862306a36Sopenharmony_ci [REW] = vsc7514_rew_regmap, 42962306a36Sopenharmony_ci [SYS] = vsc7514_sys_regmap, 43062306a36Sopenharmony_ci [S0] = vsc7514_vcap_regmap, 43162306a36Sopenharmony_ci [S1] = vsc7514_vcap_regmap, 43262306a36Sopenharmony_ci [S2] = vsc7514_vcap_regmap, 43362306a36Sopenharmony_ci [PTP] = vsc7514_ptp_regmap, 43462306a36Sopenharmony_ci [DEV_GMII] = vsc7514_dev_gmii_regmap, 43562306a36Sopenharmony_ci}; 43662306a36Sopenharmony_ciEXPORT_SYMBOL(vsc7514_regmap); 43762306a36Sopenharmony_ci 43862306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_es0_keys[] = { 43962306a36Sopenharmony_ci [VCAP_ES0_EGR_PORT] = { 0, 4 }, 44062306a36Sopenharmony_ci [VCAP_ES0_IGR_PORT] = { 4, 4 }, 44162306a36Sopenharmony_ci [VCAP_ES0_RSV] = { 8, 2 }, 44262306a36Sopenharmony_ci [VCAP_ES0_L2_MC] = { 10, 1 }, 44362306a36Sopenharmony_ci [VCAP_ES0_L2_BC] = { 11, 1 }, 44462306a36Sopenharmony_ci [VCAP_ES0_VID] = { 12, 12 }, 44562306a36Sopenharmony_ci [VCAP_ES0_DP] = { 24, 1 }, 44662306a36Sopenharmony_ci [VCAP_ES0_PCP] = { 25, 3 }, 44762306a36Sopenharmony_ci}; 44862306a36Sopenharmony_ci 44962306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_es0_actions[] = { 45062306a36Sopenharmony_ci [VCAP_ES0_ACT_PUSH_OUTER_TAG] = { 0, 2 }, 45162306a36Sopenharmony_ci [VCAP_ES0_ACT_PUSH_INNER_TAG] = { 2, 1 }, 45262306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_A_TPID_SEL] = { 3, 2 }, 45362306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_A_VID_SEL] = { 5, 1 }, 45462306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_A_PCP_SEL] = { 6, 2 }, 45562306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_A_DEI_SEL] = { 8, 2 }, 45662306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_B_TPID_SEL] = { 10, 2 }, 45762306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_B_VID_SEL] = { 12, 1 }, 45862306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_B_PCP_SEL] = { 13, 2 }, 45962306a36Sopenharmony_ci [VCAP_ES0_ACT_TAG_B_DEI_SEL] = { 15, 2 }, 46062306a36Sopenharmony_ci [VCAP_ES0_ACT_VID_A_VAL] = { 17, 12 }, 46162306a36Sopenharmony_ci [VCAP_ES0_ACT_PCP_A_VAL] = { 29, 3 }, 46262306a36Sopenharmony_ci [VCAP_ES0_ACT_DEI_A_VAL] = { 32, 1 }, 46362306a36Sopenharmony_ci [VCAP_ES0_ACT_VID_B_VAL] = { 33, 12 }, 46462306a36Sopenharmony_ci [VCAP_ES0_ACT_PCP_B_VAL] = { 45, 3 }, 46562306a36Sopenharmony_ci [VCAP_ES0_ACT_DEI_B_VAL] = { 48, 1 }, 46662306a36Sopenharmony_ci [VCAP_ES0_ACT_RSV] = { 49, 24 }, 46762306a36Sopenharmony_ci [VCAP_ES0_ACT_HIT_STICKY] = { 73, 1 }, 46862306a36Sopenharmony_ci}; 46962306a36Sopenharmony_ci 47062306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_is1_keys[] = { 47162306a36Sopenharmony_ci [VCAP_IS1_HK_TYPE] = { 0, 1 }, 47262306a36Sopenharmony_ci [VCAP_IS1_HK_LOOKUP] = { 1, 2 }, 47362306a36Sopenharmony_ci [VCAP_IS1_HK_IGR_PORT_MASK] = { 3, 12 }, 47462306a36Sopenharmony_ci [VCAP_IS1_HK_RSV] = { 15, 9 }, 47562306a36Sopenharmony_ci [VCAP_IS1_HK_OAM_Y1731] = { 24, 1 }, 47662306a36Sopenharmony_ci [VCAP_IS1_HK_L2_MC] = { 25, 1 }, 47762306a36Sopenharmony_ci [VCAP_IS1_HK_L2_BC] = { 26, 1 }, 47862306a36Sopenharmony_ci [VCAP_IS1_HK_IP_MC] = { 27, 1 }, 47962306a36Sopenharmony_ci [VCAP_IS1_HK_VLAN_TAGGED] = { 28, 1 }, 48062306a36Sopenharmony_ci [VCAP_IS1_HK_VLAN_DBL_TAGGED] = { 29, 1 }, 48162306a36Sopenharmony_ci [VCAP_IS1_HK_TPID] = { 30, 1 }, 48262306a36Sopenharmony_ci [VCAP_IS1_HK_VID] = { 31, 12 }, 48362306a36Sopenharmony_ci [VCAP_IS1_HK_DEI] = { 43, 1 }, 48462306a36Sopenharmony_ci [VCAP_IS1_HK_PCP] = { 44, 3 }, 48562306a36Sopenharmony_ci /* Specific Fields for IS1 Half Key S1_NORMAL */ 48662306a36Sopenharmony_ci [VCAP_IS1_HK_L2_SMAC] = { 47, 48 }, 48762306a36Sopenharmony_ci [VCAP_IS1_HK_ETYPE_LEN] = { 95, 1 }, 48862306a36Sopenharmony_ci [VCAP_IS1_HK_ETYPE] = { 96, 16 }, 48962306a36Sopenharmony_ci [VCAP_IS1_HK_IP_SNAP] = { 112, 1 }, 49062306a36Sopenharmony_ci [VCAP_IS1_HK_IP4] = { 113, 1 }, 49162306a36Sopenharmony_ci /* Layer-3 Information */ 49262306a36Sopenharmony_ci [VCAP_IS1_HK_L3_FRAGMENT] = { 114, 1 }, 49362306a36Sopenharmony_ci [VCAP_IS1_HK_L3_FRAG_OFS_GT0] = { 115, 1 }, 49462306a36Sopenharmony_ci [VCAP_IS1_HK_L3_OPTIONS] = { 116, 1 }, 49562306a36Sopenharmony_ci [VCAP_IS1_HK_L3_DSCP] = { 117, 6 }, 49662306a36Sopenharmony_ci [VCAP_IS1_HK_L3_IP4_SIP] = { 123, 32 }, 49762306a36Sopenharmony_ci /* Layer-4 Information */ 49862306a36Sopenharmony_ci [VCAP_IS1_HK_TCP_UDP] = { 155, 1 }, 49962306a36Sopenharmony_ci [VCAP_IS1_HK_TCP] = { 156, 1 }, 50062306a36Sopenharmony_ci [VCAP_IS1_HK_L4_SPORT] = { 157, 16 }, 50162306a36Sopenharmony_ci [VCAP_IS1_HK_L4_RNG] = { 173, 8 }, 50262306a36Sopenharmony_ci /* Specific Fields for IS1 Half Key S1_5TUPLE_IP4 */ 50362306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_INNER_TPID] = { 47, 1 }, 50462306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_INNER_VID] = { 48, 12 }, 50562306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_INNER_DEI] = { 60, 1 }, 50662306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_INNER_PCP] = { 61, 3 }, 50762306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_IP4] = { 64, 1 }, 50862306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_FRAGMENT] = { 65, 1 }, 50962306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_FRAG_OFS_GT0] = { 66, 1 }, 51062306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_OPTIONS] = { 67, 1 }, 51162306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_DSCP] = { 68, 6 }, 51262306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_IP4_DIP] = { 74, 32 }, 51362306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_IP4_SIP] = { 106, 32 }, 51462306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L3_PROTO] = { 138, 8 }, 51562306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_TCP_UDP] = { 146, 1 }, 51662306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_TCP] = { 147, 1 }, 51762306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_L4_RNG] = { 148, 8 }, 51862306a36Sopenharmony_ci [VCAP_IS1_HK_IP4_IP_PAYLOAD_S1_5TUPLE] = { 156, 32 }, 51962306a36Sopenharmony_ci}; 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_is1_actions[] = { 52262306a36Sopenharmony_ci [VCAP_IS1_ACT_DSCP_ENA] = { 0, 1 }, 52362306a36Sopenharmony_ci [VCAP_IS1_ACT_DSCP_VAL] = { 1, 6 }, 52462306a36Sopenharmony_ci [VCAP_IS1_ACT_QOS_ENA] = { 7, 1 }, 52562306a36Sopenharmony_ci [VCAP_IS1_ACT_QOS_VAL] = { 8, 3 }, 52662306a36Sopenharmony_ci [VCAP_IS1_ACT_DP_ENA] = { 11, 1 }, 52762306a36Sopenharmony_ci [VCAP_IS1_ACT_DP_VAL] = { 12, 1 }, 52862306a36Sopenharmony_ci [VCAP_IS1_ACT_PAG_OVERRIDE_MASK] = { 13, 8 }, 52962306a36Sopenharmony_ci [VCAP_IS1_ACT_PAG_VAL] = { 21, 8 }, 53062306a36Sopenharmony_ci [VCAP_IS1_ACT_RSV] = { 29, 9 }, 53162306a36Sopenharmony_ci /* The fields below are incorrectly shifted by 2 in the manual */ 53262306a36Sopenharmony_ci [VCAP_IS1_ACT_VID_REPLACE_ENA] = { 38, 1 }, 53362306a36Sopenharmony_ci [VCAP_IS1_ACT_VID_ADD_VAL] = { 39, 12 }, 53462306a36Sopenharmony_ci [VCAP_IS1_ACT_FID_SEL] = { 51, 2 }, 53562306a36Sopenharmony_ci [VCAP_IS1_ACT_FID_VAL] = { 53, 13 }, 53662306a36Sopenharmony_ci [VCAP_IS1_ACT_PCP_DEI_ENA] = { 66, 1 }, 53762306a36Sopenharmony_ci [VCAP_IS1_ACT_PCP_VAL] = { 67, 3 }, 53862306a36Sopenharmony_ci [VCAP_IS1_ACT_DEI_VAL] = { 70, 1 }, 53962306a36Sopenharmony_ci [VCAP_IS1_ACT_VLAN_POP_CNT_ENA] = { 71, 1 }, 54062306a36Sopenharmony_ci [VCAP_IS1_ACT_VLAN_POP_CNT] = { 72, 2 }, 54162306a36Sopenharmony_ci [VCAP_IS1_ACT_CUSTOM_ACE_TYPE_ENA] = { 74, 4 }, 54262306a36Sopenharmony_ci [VCAP_IS1_ACT_HIT_STICKY] = { 78, 1 }, 54362306a36Sopenharmony_ci}; 54462306a36Sopenharmony_ci 54562306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_is2_keys[] = { 54662306a36Sopenharmony_ci /* Common: 46 bits */ 54762306a36Sopenharmony_ci [VCAP_IS2_TYPE] = { 0, 4 }, 54862306a36Sopenharmony_ci [VCAP_IS2_HK_FIRST] = { 4, 1 }, 54962306a36Sopenharmony_ci [VCAP_IS2_HK_PAG] = { 5, 8 }, 55062306a36Sopenharmony_ci [VCAP_IS2_HK_IGR_PORT_MASK] = { 13, 12 }, 55162306a36Sopenharmony_ci [VCAP_IS2_HK_RSV2] = { 25, 1 }, 55262306a36Sopenharmony_ci [VCAP_IS2_HK_HOST_MATCH] = { 26, 1 }, 55362306a36Sopenharmony_ci [VCAP_IS2_HK_L2_MC] = { 27, 1 }, 55462306a36Sopenharmony_ci [VCAP_IS2_HK_L2_BC] = { 28, 1 }, 55562306a36Sopenharmony_ci [VCAP_IS2_HK_VLAN_TAGGED] = { 29, 1 }, 55662306a36Sopenharmony_ci [VCAP_IS2_HK_VID] = { 30, 12 }, 55762306a36Sopenharmony_ci [VCAP_IS2_HK_DEI] = { 42, 1 }, 55862306a36Sopenharmony_ci [VCAP_IS2_HK_PCP] = { 43, 3 }, 55962306a36Sopenharmony_ci /* MAC_ETYPE / MAC_LLC / MAC_SNAP / OAM common */ 56062306a36Sopenharmony_ci [VCAP_IS2_HK_L2_DMAC] = { 46, 48 }, 56162306a36Sopenharmony_ci [VCAP_IS2_HK_L2_SMAC] = { 94, 48 }, 56262306a36Sopenharmony_ci /* MAC_ETYPE (TYPE=000) */ 56362306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ETYPE_ETYPE] = { 142, 16 }, 56462306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD0] = { 158, 16 }, 56562306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD1] = { 174, 8 }, 56662306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ETYPE_L2_PAYLOAD2] = { 182, 3 }, 56762306a36Sopenharmony_ci /* MAC_LLC (TYPE=001) */ 56862306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_LLC_L2_LLC] = { 142, 40 }, 56962306a36Sopenharmony_ci /* MAC_SNAP (TYPE=010) */ 57062306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_SNAP_L2_SNAP] = { 142, 40 }, 57162306a36Sopenharmony_ci /* MAC_ARP (TYPE=011) */ 57262306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_SMAC] = { 46, 48 }, 57362306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_ADDR_SPACE_OK] = { 94, 1 }, 57462306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_PROTO_SPACE_OK] = { 95, 1 }, 57562306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_LEN_OK] = { 96, 1 }, 57662306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_TARGET_MATCH] = { 97, 1 }, 57762306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_SENDER_MATCH] = { 98, 1 }, 57862306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_OPCODE_UNKNOWN] = { 99, 1 }, 57962306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_OPCODE] = { 100, 2 }, 58062306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_L3_IP4_DIP] = { 102, 32 }, 58162306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_L3_IP4_SIP] = { 134, 32 }, 58262306a36Sopenharmony_ci [VCAP_IS2_HK_MAC_ARP_DIP_EQ_SIP] = { 166, 1 }, 58362306a36Sopenharmony_ci /* IP4_TCP_UDP / IP4_OTHER common */ 58462306a36Sopenharmony_ci [VCAP_IS2_HK_IP4] = { 46, 1 }, 58562306a36Sopenharmony_ci [VCAP_IS2_HK_L3_FRAGMENT] = { 47, 1 }, 58662306a36Sopenharmony_ci [VCAP_IS2_HK_L3_FRAG_OFS_GT0] = { 48, 1 }, 58762306a36Sopenharmony_ci [VCAP_IS2_HK_L3_OPTIONS] = { 49, 1 }, 58862306a36Sopenharmony_ci [VCAP_IS2_HK_IP4_L3_TTL_GT0] = { 50, 1 }, 58962306a36Sopenharmony_ci [VCAP_IS2_HK_L3_TOS] = { 51, 8 }, 59062306a36Sopenharmony_ci [VCAP_IS2_HK_L3_IP4_DIP] = { 59, 32 }, 59162306a36Sopenharmony_ci [VCAP_IS2_HK_L3_IP4_SIP] = { 91, 32 }, 59262306a36Sopenharmony_ci [VCAP_IS2_HK_DIP_EQ_SIP] = { 123, 1 }, 59362306a36Sopenharmony_ci /* IP4_TCP_UDP (TYPE=100) */ 59462306a36Sopenharmony_ci [VCAP_IS2_HK_TCP] = { 124, 1 }, 59562306a36Sopenharmony_ci [VCAP_IS2_HK_L4_DPORT] = { 125, 16 }, 59662306a36Sopenharmony_ci [VCAP_IS2_HK_L4_SPORT] = { 141, 16 }, 59762306a36Sopenharmony_ci [VCAP_IS2_HK_L4_RNG] = { 157, 8 }, 59862306a36Sopenharmony_ci [VCAP_IS2_HK_L4_SPORT_EQ_DPORT] = { 165, 1 }, 59962306a36Sopenharmony_ci [VCAP_IS2_HK_L4_SEQUENCE_EQ0] = { 166, 1 }, 60062306a36Sopenharmony_ci [VCAP_IS2_HK_L4_FIN] = { 167, 1 }, 60162306a36Sopenharmony_ci [VCAP_IS2_HK_L4_SYN] = { 168, 1 }, 60262306a36Sopenharmony_ci [VCAP_IS2_HK_L4_RST] = { 169, 1 }, 60362306a36Sopenharmony_ci [VCAP_IS2_HK_L4_PSH] = { 170, 1 }, 60462306a36Sopenharmony_ci [VCAP_IS2_HK_L4_ACK] = { 171, 1 }, 60562306a36Sopenharmony_ci [VCAP_IS2_HK_L4_URG] = { 172, 1 }, 60662306a36Sopenharmony_ci [VCAP_IS2_HK_L4_1588_DOM] = { 173, 8 }, 60762306a36Sopenharmony_ci [VCAP_IS2_HK_L4_1588_VER] = { 181, 4 }, 60862306a36Sopenharmony_ci /* IP4_OTHER (TYPE=101) */ 60962306a36Sopenharmony_ci [VCAP_IS2_HK_IP4_L3_PROTO] = { 124, 8 }, 61062306a36Sopenharmony_ci [VCAP_IS2_HK_L3_PAYLOAD] = { 132, 56 }, 61162306a36Sopenharmony_ci /* IP6_STD (TYPE=110) */ 61262306a36Sopenharmony_ci [VCAP_IS2_HK_IP6_L3_TTL_GT0] = { 46, 1 }, 61362306a36Sopenharmony_ci [VCAP_IS2_HK_L3_IP6_SIP] = { 47, 128 }, 61462306a36Sopenharmony_ci [VCAP_IS2_HK_IP6_L3_PROTO] = { 175, 8 }, 61562306a36Sopenharmony_ci /* OAM (TYPE=111) */ 61662306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_MEL_FLAGS] = { 142, 7 }, 61762306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_VER] = { 149, 5 }, 61862306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_OPCODE] = { 154, 8 }, 61962306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_FLAGS] = { 162, 8 }, 62062306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_MEPID] = { 170, 16 }, 62162306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_CCM_CNTS_EQ0] = { 186, 1 }, 62262306a36Sopenharmony_ci [VCAP_IS2_HK_OAM_IS_Y1731] = { 187, 1 }, 62362306a36Sopenharmony_ci}; 62462306a36Sopenharmony_ci 62562306a36Sopenharmony_cistatic const struct vcap_field vsc7514_vcap_is2_actions[] = { 62662306a36Sopenharmony_ci [VCAP_IS2_ACT_HIT_ME_ONCE] = { 0, 1 }, 62762306a36Sopenharmony_ci [VCAP_IS2_ACT_CPU_COPY_ENA] = { 1, 1 }, 62862306a36Sopenharmony_ci [VCAP_IS2_ACT_CPU_QU_NUM] = { 2, 3 }, 62962306a36Sopenharmony_ci [VCAP_IS2_ACT_MASK_MODE] = { 5, 2 }, 63062306a36Sopenharmony_ci [VCAP_IS2_ACT_MIRROR_ENA] = { 7, 1 }, 63162306a36Sopenharmony_ci [VCAP_IS2_ACT_LRN_DIS] = { 8, 1 }, 63262306a36Sopenharmony_ci [VCAP_IS2_ACT_POLICE_ENA] = { 9, 1 }, 63362306a36Sopenharmony_ci [VCAP_IS2_ACT_POLICE_IDX] = { 10, 9 }, 63462306a36Sopenharmony_ci [VCAP_IS2_ACT_POLICE_VCAP_ONLY] = { 19, 1 }, 63562306a36Sopenharmony_ci [VCAP_IS2_ACT_PORT_MASK] = { 20, 11 }, 63662306a36Sopenharmony_ci [VCAP_IS2_ACT_REW_OP] = { 31, 9 }, 63762306a36Sopenharmony_ci [VCAP_IS2_ACT_SMAC_REPLACE_ENA] = { 40, 1 }, 63862306a36Sopenharmony_ci [VCAP_IS2_ACT_RSV] = { 41, 2 }, 63962306a36Sopenharmony_ci [VCAP_IS2_ACT_ACL_ID] = { 43, 6 }, 64062306a36Sopenharmony_ci [VCAP_IS2_ACT_HIT_CNT] = { 49, 32 }, 64162306a36Sopenharmony_ci}; 64262306a36Sopenharmony_ci 64362306a36Sopenharmony_cistruct vcap_props vsc7514_vcap_props[] = { 64462306a36Sopenharmony_ci [VCAP_ES0] = { 64562306a36Sopenharmony_ci .action_type_width = 0, 64662306a36Sopenharmony_ci .action_table = { 64762306a36Sopenharmony_ci [ES0_ACTION_TYPE_NORMAL] = { 64862306a36Sopenharmony_ci .width = 73, /* HIT_STICKY not included */ 64962306a36Sopenharmony_ci .count = 1, 65062306a36Sopenharmony_ci }, 65162306a36Sopenharmony_ci }, 65262306a36Sopenharmony_ci .target = S0, 65362306a36Sopenharmony_ci .keys = vsc7514_vcap_es0_keys, 65462306a36Sopenharmony_ci .actions = vsc7514_vcap_es0_actions, 65562306a36Sopenharmony_ci }, 65662306a36Sopenharmony_ci [VCAP_IS1] = { 65762306a36Sopenharmony_ci .action_type_width = 0, 65862306a36Sopenharmony_ci .action_table = { 65962306a36Sopenharmony_ci [IS1_ACTION_TYPE_NORMAL] = { 66062306a36Sopenharmony_ci .width = 78, /* HIT_STICKY not included */ 66162306a36Sopenharmony_ci .count = 4, 66262306a36Sopenharmony_ci }, 66362306a36Sopenharmony_ci }, 66462306a36Sopenharmony_ci .target = S1, 66562306a36Sopenharmony_ci .keys = vsc7514_vcap_is1_keys, 66662306a36Sopenharmony_ci .actions = vsc7514_vcap_is1_actions, 66762306a36Sopenharmony_ci }, 66862306a36Sopenharmony_ci [VCAP_IS2] = { 66962306a36Sopenharmony_ci .action_type_width = 1, 67062306a36Sopenharmony_ci .action_table = { 67162306a36Sopenharmony_ci [IS2_ACTION_TYPE_NORMAL] = { 67262306a36Sopenharmony_ci .width = 49, 67362306a36Sopenharmony_ci .count = 2 67462306a36Sopenharmony_ci }, 67562306a36Sopenharmony_ci [IS2_ACTION_TYPE_SMAC_SIP] = { 67662306a36Sopenharmony_ci .width = 6, 67762306a36Sopenharmony_ci .count = 4 67862306a36Sopenharmony_ci }, 67962306a36Sopenharmony_ci }, 68062306a36Sopenharmony_ci .target = S2, 68162306a36Sopenharmony_ci .keys = vsc7514_vcap_is2_keys, 68262306a36Sopenharmony_ci .actions = vsc7514_vcap_is2_actions, 68362306a36Sopenharmony_ci }, 68462306a36Sopenharmony_ci}; 68562306a36Sopenharmony_ciEXPORT_SYMBOL(vsc7514_vcap_props); 686