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 */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifndef _MSCC_OCELOT_REW_H_ 962306a36Sopenharmony_ci#define _MSCC_OCELOT_REW_H_ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_GSZ 0x80 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_TPID(x) (((x) << 16) & GENMASK(31, 16)) 1462306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_TPID_M GENMASK(31, 16) 1562306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_TPID_X(x) (((x) & GENMASK(31, 16)) >> 16) 1662306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_DEI BIT(15) 1762306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_PCP(x) (((x) << 12) & GENMASK(14, 12)) 1862306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_PCP_M GENMASK(14, 12) 1962306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_PCP_X(x) (((x) & GENMASK(14, 12)) >> 12) 2062306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_VID(x) ((x) & GENMASK(11, 0)) 2162306a36Sopenharmony_ci#define REW_PORT_VLAN_CFG_PORT_VID_M GENMASK(11, 0) 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci#define REW_TAG_CFG_GSZ 0x80 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_CFG(x) (((x) << 7) & GENMASK(8, 7)) 2662306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_CFG_M GENMASK(8, 7) 2762306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_CFG_X(x) (((x) & GENMASK(8, 7)) >> 7) 2862306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_TPID_CFG(x) (((x) << 5) & GENMASK(6, 5)) 2962306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_TPID_CFG_M GENMASK(6, 5) 3062306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_TPID_CFG_X(x) (((x) & GENMASK(6, 5)) >> 5) 3162306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_VID_CFG BIT(4) 3262306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_PCP_CFG(x) (((x) << 2) & GENMASK(3, 2)) 3362306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_PCP_CFG_M GENMASK(3, 2) 3462306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_PCP_CFG_X(x) (((x) & GENMASK(3, 2)) >> 2) 3562306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_DEI_CFG(x) ((x) & GENMASK(1, 0)) 3662306a36Sopenharmony_ci#define REW_TAG_CFG_TAG_DEI_CFG_M GENMASK(1, 0) 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci#define REW_PORT_CFG_GSZ 0x80 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci#define REW_PORT_CFG_ES0_EN BIT(5) 4162306a36Sopenharmony_ci#define REW_PORT_CFG_FCS_UPDATE_NONCPU_CFG(x) (((x) << 3) & GENMASK(4, 3)) 4262306a36Sopenharmony_ci#define REW_PORT_CFG_FCS_UPDATE_NONCPU_CFG_M GENMASK(4, 3) 4362306a36Sopenharmony_ci#define REW_PORT_CFG_FCS_UPDATE_NONCPU_CFG_X(x) (((x) & GENMASK(4, 3)) >> 3) 4462306a36Sopenharmony_ci#define REW_PORT_CFG_FCS_UPDATE_CPU_ENA BIT(2) 4562306a36Sopenharmony_ci#define REW_PORT_CFG_FLUSH_ENA BIT(1) 4662306a36Sopenharmony_ci#define REW_PORT_CFG_AGE_DIS BIT(0) 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#define REW_DSCP_CFG_GSZ 0x80 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci#define REW_PCP_DEI_QOS_MAP_CFG_GSZ 0x80 5162306a36Sopenharmony_ci#define REW_PCP_DEI_QOS_MAP_CFG_RSZ 0x4 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci#define REW_PCP_DEI_QOS_MAP_CFG_DEI_QOS_VAL BIT(3) 5462306a36Sopenharmony_ci#define REW_PCP_DEI_QOS_MAP_CFG_PCP_QOS_VAL(x) ((x) & GENMASK(2, 0)) 5562306a36Sopenharmony_ci#define REW_PCP_DEI_QOS_MAP_CFG_PCP_QOS_VAL_M GENMASK(2, 0) 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci#define REW_PTP_CFG_GSZ 0x80 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci#define REW_PTP_CFG_PTP_BACKPLANE_MODE BIT(7) 6062306a36Sopenharmony_ci#define REW_PTP_CFG_GP_CFG_UNUSED(x) (((x) << 3) & GENMASK(6, 3)) 6162306a36Sopenharmony_ci#define REW_PTP_CFG_GP_CFG_UNUSED_M GENMASK(6, 3) 6262306a36Sopenharmony_ci#define REW_PTP_CFG_GP_CFG_UNUSED_X(x) (((x) & GENMASK(6, 3)) >> 3) 6362306a36Sopenharmony_ci#define REW_PTP_CFG_PTP_1STEP_DIS BIT(2) 6462306a36Sopenharmony_ci#define REW_PTP_CFG_PTP_2STEP_DIS BIT(1) 6562306a36Sopenharmony_ci#define REW_PTP_CFG_PTP_UDP_KEEP BIT(0) 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci#define REW_PTP_DLY1_CFG_GSZ 0x80 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci#define REW_RED_TAG_CFG_GSZ 0x80 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci#define REW_RED_TAG_CFG_RED_TAG_CFG BIT(0) 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci#define REW_DSCP_REMAP_DP1_CFG_RSZ 0x4 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci#define REW_DSCP_REMAP_CFG_RSZ 0x4 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ci#define REW_REW_STICKY_ES0_TAGB_PUSH_FAILED BIT(0) 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define REW_PPT_RSZ 0x4 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci#endif 82