15e256365SVladimir Oltean /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
25e256365SVladimir Oltean /* Copyright (c) 2017 Microsemi Corporation
35e256365SVladimir Oltean */
45e256365SVladimir Oltean
55e256365SVladimir Oltean #ifndef _SOC_MSCC_OCELOT_H
65e256365SVladimir Oltean #define _SOC_MSCC_OCELOT_H
75e256365SVladimir Oltean
85e256365SVladimir Oltean #include <linux/ptp_clock_kernel.h>
95e256365SVladimir Oltean #include <linux/net_tstamp.h>
105e256365SVladimir Oltean #include <linux/if_vlan.h>
115e256365SVladimir Oltean #include <linux/regmap.h>
125e256365SVladimir Oltean #include <net/dsa.h>
135e256365SVladimir Oltean
14aac80140SVladimir Oltean struct tc_mqprio_qopt_offload;
15aac80140SVladimir Oltean
161cf3299bSVladimir Oltean /* Port Group IDs (PGID) are masks of destination ports.
171cf3299bSVladimir Oltean *
181cf3299bSVladimir Oltean * For L2 forwarding, the switch performs 3 lookups in the PGID table for each
191cf3299bSVladimir Oltean * frame, and forwards the frame to the ports that are present in the logical
201cf3299bSVladimir Oltean * AND of all 3 PGIDs.
211cf3299bSVladimir Oltean *
221cf3299bSVladimir Oltean * These PGID lookups are:
231cf3299bSVladimir Oltean * - In one of PGID[0-63]: for the destination masks. There are 2 paths by
241cf3299bSVladimir Oltean * which the switch selects a destination PGID:
251cf3299bSVladimir Oltean * - The {DMAC, VID} is present in the MAC table. In that case, the
261cf3299bSVladimir Oltean * destination PGID is given by the DEST_IDX field of the MAC table entry
271cf3299bSVladimir Oltean * that matched.
281cf3299bSVladimir Oltean * - The {DMAC, VID} is not present in the MAC table (it is unknown). The
291cf3299bSVladimir Oltean * frame is disseminated as being either unicast, multicast or broadcast,
301cf3299bSVladimir Oltean * and according to that, the destination PGID is chosen as being the
311cf3299bSVladimir Oltean * value contained by ANA_FLOODING_FLD_UNICAST,
321cf3299bSVladimir Oltean * ANA_FLOODING_FLD_MULTICAST or ANA_FLOODING_FLD_BROADCAST.
331cf3299bSVladimir Oltean * The destination PGID can be an unicast set: the first PGIDs, 0 to
341cf3299bSVladimir Oltean * ocelot->num_phys_ports - 1, or a multicast set: the PGIDs from
351cf3299bSVladimir Oltean * ocelot->num_phys_ports to 63. By convention, a unicast PGID corresponds to
361cf3299bSVladimir Oltean * a physical port and has a single bit set in the destination ports mask:
371cf3299bSVladimir Oltean * that corresponding to the port number itself. In contrast, a multicast
381cf3299bSVladimir Oltean * PGID will have potentially more than one single bit set in the destination
391cf3299bSVladimir Oltean * ports mask.
401cf3299bSVladimir Oltean * - In one of PGID[64-79]: for the aggregation mask. The switch classifier
411cf3299bSVladimir Oltean * dissects each frame and generates a 4-bit Link Aggregation Code which is
421cf3299bSVladimir Oltean * used for this second PGID table lookup. The goal of link aggregation is to
431cf3299bSVladimir Oltean * hash multiple flows within the same LAG on to different destination ports.
441cf3299bSVladimir Oltean * The first lookup will result in a PGID with all the LAG members present in
451cf3299bSVladimir Oltean * the destination ports mask, and the second lookup, by Link Aggregation
461cf3299bSVladimir Oltean * Code, will ensure that each flow gets forwarded only to a single port out
471cf3299bSVladimir Oltean * of that mask (there are no duplicates).
481cf3299bSVladimir Oltean * - In one of PGID[80-90]: for the source mask. The third time, the PGID table
491cf3299bSVladimir Oltean * is indexed with the ingress port (plus 80). These PGIDs answer the
501cf3299bSVladimir Oltean * question "is port i allowed to forward traffic to port j?" If yes, then
511cf3299bSVladimir Oltean * BIT(j) of PGID 80+i will be found set. The third PGID lookup can be used
521cf3299bSVladimir Oltean * to enforce the L2 forwarding matrix imposed by e.g. a Linux bridge.
531cf3299bSVladimir Oltean */
541cf3299bSVladimir Oltean
551cf3299bSVladimir Oltean /* Reserve some destination PGIDs at the end of the range:
56ebb1bb40SHoratiu Vultur * PGID_BLACKHOLE: used for not forwarding the frames
571cf3299bSVladimir Oltean * PGID_CPU: used for whitelisting certain MAC addresses, such as the addresses
581cf3299bSVladimir Oltean * of the switch port net devices, towards the CPU port module.
591cf3299bSVladimir Oltean * PGID_UC: the flooding destinations for unknown unicast traffic.
60b360d94fSVladimir Oltean * PGID_MC: the flooding destinations for non-IP multicast traffic.
611cf3299bSVladimir Oltean * PGID_MCIPV4: the flooding destinations for IPv4 multicast traffic.
621cf3299bSVladimir Oltean * PGID_MCIPV6: the flooding destinations for IPv6 multicast traffic.
63b360d94fSVladimir Oltean * PGID_BC: the flooding destinations for broadcast traffic.
641cf3299bSVladimir Oltean */
65ebb1bb40SHoratiu Vultur #define PGID_BLACKHOLE 57
66b360d94fSVladimir Oltean #define PGID_CPU 58
67b360d94fSVladimir Oltean #define PGID_UC 59
68b360d94fSVladimir Oltean #define PGID_MC 60
69b360d94fSVladimir Oltean #define PGID_MCIPV4 61
70b360d94fSVladimir Oltean #define PGID_MCIPV6 62
71b360d94fSVladimir Oltean #define PGID_BC 63
721cf3299bSVladimir Oltean
7396b029b0SVladimir Oltean #define for_each_unicast_dest_pgid(ocelot, pgid) \
7496b029b0SVladimir Oltean for ((pgid) = 0; \
7596b029b0SVladimir Oltean (pgid) < (ocelot)->num_phys_ports; \
7696b029b0SVladimir Oltean (pgid)++)
7796b029b0SVladimir Oltean
7896b029b0SVladimir Oltean #define for_each_nonreserved_multicast_dest_pgid(ocelot, pgid) \
7996b029b0SVladimir Oltean for ((pgid) = (ocelot)->num_phys_ports + 1; \
80ebb1bb40SHoratiu Vultur (pgid) < PGID_BLACKHOLE; \
8196b029b0SVladimir Oltean (pgid)++)
8296b029b0SVladimir Oltean
8396b029b0SVladimir Oltean #define for_each_aggr_pgid(ocelot, pgid) \
8496b029b0SVladimir Oltean for ((pgid) = PGID_AGGR; \
8596b029b0SVladimir Oltean (pgid) < PGID_SRC; \
8696b029b0SVladimir Oltean (pgid)++)
8796b029b0SVladimir Oltean
881cf3299bSVladimir Oltean /* Aggregation PGIDs, one per Link Aggregation Code */
891cf3299bSVladimir Oltean #define PGID_AGGR 64
901cf3299bSVladimir Oltean
911cf3299bSVladimir Oltean /* Source PGIDs, one per physical port */
921cf3299bSVladimir Oltean #define PGID_SRC 80
931cf3299bSVladimir Oltean
9470d39a6eSVladimir Oltean #define OCELOT_NUM_TC 8
955e256365SVladimir Oltean
965e256365SVladimir Oltean #define OCELOT_SPEED_2500 0
975e256365SVladimir Oltean #define OCELOT_SPEED_1000 1
985e256365SVladimir Oltean #define OCELOT_SPEED_100 2
995e256365SVladimir Oltean #define OCELOT_SPEED_10 3
1005e256365SVladimir Oltean
101cc2d87bbSYangbo Lu #define OCELOT_PTP_PINS_NUM 4
102cc2d87bbSYangbo Lu
1035e256365SVladimir Oltean #define TARGET_OFFSET 24
1045e256365SVladimir Oltean #define REG_MASK GENMASK(TARGET_OFFSET - 1, 0)
1055e256365SVladimir Oltean #define REG(reg, offset) [reg & REG_MASK] = offset
1065e256365SVladimir Oltean
1075e256365SVladimir Oltean #define REG_RESERVED_ADDR 0xffffffff
1085e256365SVladimir Oltean #define REG_RESERVED(reg) REG(reg, REG_RESERVED_ADDR)
1095e256365SVladimir Oltean
1105e256365SVladimir Oltean enum ocelot_target {
1115e256365SVladimir Oltean ANA = 1,
1125e256365SVladimir Oltean QS,
1135e256365SVladimir Oltean QSYS,
1145e256365SVladimir Oltean REW,
1155e256365SVladimir Oltean SYS,
116e3aea296SVladimir Oltean S0,
117a61e365dSVladimir Oltean S1,
1185e256365SVladimir Oltean S2,
1195e256365SVladimir Oltean HSIO,
1205e256365SVladimir Oltean PTP,
121753a026cSClément Léger FDMA,
1225e256365SVladimir Oltean GCB,
12391c724cfSVladimir Oltean DEV_GMII,
1245e256365SVladimir Oltean TARGET_MAX,
1255e256365SVladimir Oltean };
1265e256365SVladimir Oltean
1275e256365SVladimir Oltean enum ocelot_reg {
1285e256365SVladimir Oltean ANA_ADVLEARN = ANA << TARGET_OFFSET,
1295e256365SVladimir Oltean ANA_VLANMASK,
1305e256365SVladimir Oltean ANA_PORT_B_DOMAIN,
1315e256365SVladimir Oltean ANA_ANAGEFIL,
1325e256365SVladimir Oltean ANA_ANEVENTS,
1335e256365SVladimir Oltean ANA_STORMLIMIT_BURST,
1345e256365SVladimir Oltean ANA_STORMLIMIT_CFG,
1355e256365SVladimir Oltean ANA_ISOLATED_PORTS,
1365e256365SVladimir Oltean ANA_COMMUNITY_PORTS,
1375e256365SVladimir Oltean ANA_AUTOAGE,
1385e256365SVladimir Oltean ANA_MACTOPTIONS,
1395e256365SVladimir Oltean ANA_LEARNDISC,
1405e256365SVladimir Oltean ANA_AGENCTRL,
1415e256365SVladimir Oltean ANA_MIRRORPORTS,
1425e256365SVladimir Oltean ANA_EMIRRORPORTS,
1435e256365SVladimir Oltean ANA_FLOODING,
1445e256365SVladimir Oltean ANA_FLOODING_IPMC,
1455e256365SVladimir Oltean ANA_SFLOW_CFG,
1465e256365SVladimir Oltean ANA_PORT_MODE,
1475e256365SVladimir Oltean ANA_CUT_THRU_CFG,
1485e256365SVladimir Oltean ANA_PGID_PGID,
1495e256365SVladimir Oltean ANA_TABLES_ANMOVED,
1505e256365SVladimir Oltean ANA_TABLES_MACHDATA,
1515e256365SVladimir Oltean ANA_TABLES_MACLDATA,
1525e256365SVladimir Oltean ANA_TABLES_STREAMDATA,
1535e256365SVladimir Oltean ANA_TABLES_MACACCESS,
1545e256365SVladimir Oltean ANA_TABLES_MACTINDX,
1555e256365SVladimir Oltean ANA_TABLES_VLANACCESS,
1565e256365SVladimir Oltean ANA_TABLES_VLANTIDX,
1575e256365SVladimir Oltean ANA_TABLES_ISDXACCESS,
1585e256365SVladimir Oltean ANA_TABLES_ISDXTIDX,
1595e256365SVladimir Oltean ANA_TABLES_ENTRYLIM,
1605e256365SVladimir Oltean ANA_TABLES_PTP_ID_HIGH,
1615e256365SVladimir Oltean ANA_TABLES_PTP_ID_LOW,
1625e256365SVladimir Oltean ANA_TABLES_STREAMACCESS,
1635e256365SVladimir Oltean ANA_TABLES_STREAMTIDX,
1645e256365SVladimir Oltean ANA_TABLES_SEQ_HISTORY,
1655e256365SVladimir Oltean ANA_TABLES_SEQ_MASK,
1665e256365SVladimir Oltean ANA_TABLES_SFID_MASK,
1675e256365SVladimir Oltean ANA_TABLES_SFIDACCESS,
1685e256365SVladimir Oltean ANA_TABLES_SFIDTIDX,
1695e256365SVladimir Oltean ANA_MSTI_STATE,
1705e256365SVladimir Oltean ANA_OAM_UPM_LM_CNT,
1715e256365SVladimir Oltean ANA_SG_ACCESS_CTRL,
1725e256365SVladimir Oltean ANA_SG_CONFIG_REG_1,
1735e256365SVladimir Oltean ANA_SG_CONFIG_REG_2,
1745e256365SVladimir Oltean ANA_SG_CONFIG_REG_3,
1755e256365SVladimir Oltean ANA_SG_CONFIG_REG_4,
1765e256365SVladimir Oltean ANA_SG_CONFIG_REG_5,
1775e256365SVladimir Oltean ANA_SG_GCL_GS_CONFIG,
1785e256365SVladimir Oltean ANA_SG_GCL_TI_CONFIG,
1795e256365SVladimir Oltean ANA_SG_STATUS_REG_1,
1805e256365SVladimir Oltean ANA_SG_STATUS_REG_2,
1815e256365SVladimir Oltean ANA_SG_STATUS_REG_3,
1825e256365SVladimir Oltean ANA_PORT_VLAN_CFG,
1835e256365SVladimir Oltean ANA_PORT_DROP_CFG,
1845e256365SVladimir Oltean ANA_PORT_QOS_CFG,
1855e256365SVladimir Oltean ANA_PORT_VCAP_CFG,
1865e256365SVladimir Oltean ANA_PORT_VCAP_S1_KEY_CFG,
1875e256365SVladimir Oltean ANA_PORT_VCAP_S2_CFG,
1885e256365SVladimir Oltean ANA_PORT_PCP_DEI_MAP,
1895e256365SVladimir Oltean ANA_PORT_CPU_FWD_CFG,
1905e256365SVladimir Oltean ANA_PORT_CPU_FWD_BPDU_CFG,
1915e256365SVladimir Oltean ANA_PORT_CPU_FWD_GARP_CFG,
1925e256365SVladimir Oltean ANA_PORT_CPU_FWD_CCM_CFG,
1935e256365SVladimir Oltean ANA_PORT_PORT_CFG,
1945e256365SVladimir Oltean ANA_PORT_POL_CFG,
1955e256365SVladimir Oltean ANA_PORT_PTP_CFG,
1965e256365SVladimir Oltean ANA_PORT_PTP_DLY1_CFG,
1975e256365SVladimir Oltean ANA_PORT_PTP_DLY2_CFG,
1985e256365SVladimir Oltean ANA_PORT_SFID_CFG,
1995e256365SVladimir Oltean ANA_PFC_PFC_CFG,
2005e256365SVladimir Oltean ANA_PFC_PFC_TIMER,
2015e256365SVladimir Oltean ANA_IPT_OAM_MEP_CFG,
2025e256365SVladimir Oltean ANA_IPT_IPT,
2035e256365SVladimir Oltean ANA_PPT_PPT,
2045e256365SVladimir Oltean ANA_FID_MAP_FID_MAP,
2055e256365SVladimir Oltean ANA_AGGR_CFG,
2065e256365SVladimir Oltean ANA_CPUQ_CFG,
2075e256365SVladimir Oltean ANA_CPUQ_CFG2,
2085e256365SVladimir Oltean ANA_CPUQ_8021_CFG,
2095e256365SVladimir Oltean ANA_DSCP_CFG,
2105e256365SVladimir Oltean ANA_DSCP_REWR_CFG,
2115e256365SVladimir Oltean ANA_VCAP_RNG_TYPE_CFG,
2125e256365SVladimir Oltean ANA_VCAP_RNG_VAL_CFG,
2135e256365SVladimir Oltean ANA_VRAP_CFG,
2145e256365SVladimir Oltean ANA_VRAP_HDR_DATA,
2155e256365SVladimir Oltean ANA_VRAP_HDR_MASK,
2165e256365SVladimir Oltean ANA_DISCARD_CFG,
2175e256365SVladimir Oltean ANA_FID_CFG,
2185e256365SVladimir Oltean ANA_POL_PIR_CFG,
2195e256365SVladimir Oltean ANA_POL_CIR_CFG,
2205e256365SVladimir Oltean ANA_POL_MODE_CFG,
2215e256365SVladimir Oltean ANA_POL_PIR_STATE,
2225e256365SVladimir Oltean ANA_POL_CIR_STATE,
2235e256365SVladimir Oltean ANA_POL_STATE,
2245e256365SVladimir Oltean ANA_POL_FLOWC,
2255e256365SVladimir Oltean ANA_POL_HYST,
2265e256365SVladimir Oltean ANA_POL_MISC_CFG,
2275e256365SVladimir Oltean QS_XTR_GRP_CFG = QS << TARGET_OFFSET,
2285e256365SVladimir Oltean QS_XTR_RD,
2295e256365SVladimir Oltean QS_XTR_FRM_PRUNING,
2305e256365SVladimir Oltean QS_XTR_FLUSH,
2315e256365SVladimir Oltean QS_XTR_DATA_PRESENT,
2325e256365SVladimir Oltean QS_XTR_CFG,
2335e256365SVladimir Oltean QS_INJ_GRP_CFG,
2345e256365SVladimir Oltean QS_INJ_WR,
2355e256365SVladimir Oltean QS_INJ_CTRL,
2365e256365SVladimir Oltean QS_INJ_STATUS,
2375e256365SVladimir Oltean QS_INJ_ERR,
2385e256365SVladimir Oltean QS_INH_DBG,
2395e256365SVladimir Oltean QSYS_PORT_MODE = QSYS << TARGET_OFFSET,
2405e256365SVladimir Oltean QSYS_SWITCH_PORT_MODE,
2415e256365SVladimir Oltean QSYS_STAT_CNT_CFG,
2425e256365SVladimir Oltean QSYS_EEE_CFG,
2435e256365SVladimir Oltean QSYS_EEE_THRES,
2445e256365SVladimir Oltean QSYS_IGR_NO_SHARING,
2455e256365SVladimir Oltean QSYS_EGR_NO_SHARING,
2465e256365SVladimir Oltean QSYS_SW_STATUS,
2475e256365SVladimir Oltean QSYS_EXT_CPU_CFG,
2485e256365SVladimir Oltean QSYS_PAD_CFG,
2495e256365SVladimir Oltean QSYS_CPU_GROUP_MAP,
2505e256365SVladimir Oltean QSYS_QMAP,
2515e256365SVladimir Oltean QSYS_ISDX_SGRP,
2525e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY,
2535e256365SVladimir Oltean QSYS_TFRM_MISC,
2545e256365SVladimir Oltean QSYS_TFRM_PORT_DLY,
2555e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_1,
2565e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_2,
2575e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_3,
2585e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_4,
2595e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_5,
2605e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_6,
2615e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_7,
2625e256365SVladimir Oltean QSYS_TFRM_TIMER_CFG_8,
2635e256365SVladimir Oltean QSYS_RED_PROFILE,
2645e256365SVladimir Oltean QSYS_RES_QOS_MODE,
2655e256365SVladimir Oltean QSYS_RES_CFG,
2665e256365SVladimir Oltean QSYS_RES_STAT,
2675e256365SVladimir Oltean QSYS_EGR_DROP_MODE,
2685e256365SVladimir Oltean QSYS_EQ_CTRL,
2695e256365SVladimir Oltean QSYS_EVENTS_CORE,
2705e256365SVladimir Oltean QSYS_QMAXSDU_CFG_0,
2715e256365SVladimir Oltean QSYS_QMAXSDU_CFG_1,
2725e256365SVladimir Oltean QSYS_QMAXSDU_CFG_2,
2735e256365SVladimir Oltean QSYS_QMAXSDU_CFG_3,
2745e256365SVladimir Oltean QSYS_QMAXSDU_CFG_4,
2755e256365SVladimir Oltean QSYS_QMAXSDU_CFG_5,
2765e256365SVladimir Oltean QSYS_QMAXSDU_CFG_6,
2775e256365SVladimir Oltean QSYS_QMAXSDU_CFG_7,
2785e256365SVladimir Oltean QSYS_PREEMPTION_CFG,
2795e256365SVladimir Oltean QSYS_CIR_CFG,
2805e256365SVladimir Oltean QSYS_EIR_CFG,
2815e256365SVladimir Oltean QSYS_SE_CFG,
2825e256365SVladimir Oltean QSYS_SE_DWRR_CFG,
2835e256365SVladimir Oltean QSYS_SE_CONNECT,
2845e256365SVladimir Oltean QSYS_SE_DLB_SENSE,
2855e256365SVladimir Oltean QSYS_CIR_STATE,
2865e256365SVladimir Oltean QSYS_EIR_STATE,
2875e256365SVladimir Oltean QSYS_SE_STATE,
2885e256365SVladimir Oltean QSYS_HSCH_MISC_CFG,
2895e256365SVladimir Oltean QSYS_TAG_CONFIG,
2905e256365SVladimir Oltean QSYS_TAS_PARAM_CFG_CTRL,
2915e256365SVladimir Oltean QSYS_PORT_MAX_SDU,
2925e256365SVladimir Oltean QSYS_PARAM_CFG_REG_1,
2935e256365SVladimir Oltean QSYS_PARAM_CFG_REG_2,
2945e256365SVladimir Oltean QSYS_PARAM_CFG_REG_3,
2955e256365SVladimir Oltean QSYS_PARAM_CFG_REG_4,
2965e256365SVladimir Oltean QSYS_PARAM_CFG_REG_5,
2975e256365SVladimir Oltean QSYS_GCL_CFG_REG_1,
2985e256365SVladimir Oltean QSYS_GCL_CFG_REG_2,
2995e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_1,
3005e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_2,
3015e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_3,
3025e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_4,
3035e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_5,
3045e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_6,
3055e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_7,
3065e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_8,
3075e256365SVladimir Oltean QSYS_PARAM_STATUS_REG_9,
3085e256365SVladimir Oltean QSYS_GCL_STATUS_REG_1,
3095e256365SVladimir Oltean QSYS_GCL_STATUS_REG_2,
3105e256365SVladimir Oltean REW_PORT_VLAN_CFG = REW << TARGET_OFFSET,
3115e256365SVladimir Oltean REW_TAG_CFG,
3125e256365SVladimir Oltean REW_PORT_CFG,
3135e256365SVladimir Oltean REW_DSCP_CFG,
3145e256365SVladimir Oltean REW_PCP_DEI_QOS_MAP_CFG,
3155e256365SVladimir Oltean REW_PTP_CFG,
3165e256365SVladimir Oltean REW_PTP_DLY1_CFG,
3175e256365SVladimir Oltean REW_RED_TAG_CFG,
3185e256365SVladimir Oltean REW_DSCP_REMAP_DP1_CFG,
3195e256365SVladimir Oltean REW_DSCP_REMAP_CFG,
3205e256365SVladimir Oltean REW_STAT_CFG,
3215e256365SVladimir Oltean REW_REW_STICKY,
3225e256365SVladimir Oltean REW_PPT,
3235e256365SVladimir Oltean SYS_COUNT_RX_OCTETS = SYS << TARGET_OFFSET,
3245e256365SVladimir Oltean SYS_COUNT_RX_UNICAST,
3255e256365SVladimir Oltean SYS_COUNT_RX_MULTICAST,
3265e256365SVladimir Oltean SYS_COUNT_RX_BROADCAST,
3275e256365SVladimir Oltean SYS_COUNT_RX_SHORTS,
3285e256365SVladimir Oltean SYS_COUNT_RX_FRAGMENTS,
3295e256365SVladimir Oltean SYS_COUNT_RX_JABBERS,
3305e256365SVladimir Oltean SYS_COUNT_RX_CRC_ALIGN_ERRS,
3315e256365SVladimir Oltean SYS_COUNT_RX_SYM_ERRS,
3325e256365SVladimir Oltean SYS_COUNT_RX_64,
3335e256365SVladimir Oltean SYS_COUNT_RX_65_127,
3345e256365SVladimir Oltean SYS_COUNT_RX_128_255,
3355152de7bSVladimir Oltean SYS_COUNT_RX_256_511,
3365152de7bSVladimir Oltean SYS_COUNT_RX_512_1023,
3375e256365SVladimir Oltean SYS_COUNT_RX_1024_1526,
3385e256365SVladimir Oltean SYS_COUNT_RX_1527_MAX,
3395e256365SVladimir Oltean SYS_COUNT_RX_PAUSE,
3405e256365SVladimir Oltean SYS_COUNT_RX_CONTROL,
3415e256365SVladimir Oltean SYS_COUNT_RX_LONGS,
3425e256365SVladimir Oltean SYS_COUNT_RX_CLASSIFIED_DROPS,
343d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_0,
344d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_1,
345d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_2,
346d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_3,
347d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_4,
348d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_5,
349d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_6,
350d4c36765SVladimir Oltean SYS_COUNT_RX_RED_PRIO_7,
351d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_0,
352d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_1,
353d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_2,
354d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_3,
355d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_4,
356d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_5,
357d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_6,
358d4c36765SVladimir Oltean SYS_COUNT_RX_YELLOW_PRIO_7,
359d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_0,
360d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_1,
361d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_2,
362d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_3,
363d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_4,
364d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_5,
365d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_6,
366d4c36765SVladimir Oltean SYS_COUNT_RX_GREEN_PRIO_7,
367ab3f97a9SVladimir Oltean SYS_COUNT_RX_ASSEMBLY_ERRS,
368ab3f97a9SVladimir Oltean SYS_COUNT_RX_SMD_ERRS,
369ab3f97a9SVladimir Oltean SYS_COUNT_RX_ASSEMBLY_OK,
370ab3f97a9SVladimir Oltean SYS_COUNT_RX_MERGE_FRAGMENTS,
371ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_OCTETS,
372ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_UNICAST,
373ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_MULTICAST,
374ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_BROADCAST,
375ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_SHORTS,
376ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_FRAGMENTS,
377ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_JABBERS,
378ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_CRC_ALIGN_ERRS,
379ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_SYM_ERRS,
380ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_64,
381ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_65_127,
382ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_128_255,
383ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_256_511,
384ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_512_1023,
385ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_1024_1526,
386ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_1527_MAX,
387ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_PAUSE,
388ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_CONTROL,
389ab3f97a9SVladimir Oltean SYS_COUNT_RX_PMAC_LONGS,
3905e256365SVladimir Oltean SYS_COUNT_TX_OCTETS,
3915e256365SVladimir Oltean SYS_COUNT_TX_UNICAST,
3925e256365SVladimir Oltean SYS_COUNT_TX_MULTICAST,
3935e256365SVladimir Oltean SYS_COUNT_TX_BROADCAST,
3945e256365SVladimir Oltean SYS_COUNT_TX_COLLISION,
3955e256365SVladimir Oltean SYS_COUNT_TX_DROPS,
3965e256365SVladimir Oltean SYS_COUNT_TX_PAUSE,
3975e256365SVladimir Oltean SYS_COUNT_TX_64,
3985e256365SVladimir Oltean SYS_COUNT_TX_65_127,
3995152de7bSVladimir Oltean SYS_COUNT_TX_128_255,
4005152de7bSVladimir Oltean SYS_COUNT_TX_256_511,
4015e256365SVladimir Oltean SYS_COUNT_TX_512_1023,
4025e256365SVladimir Oltean SYS_COUNT_TX_1024_1526,
4035e256365SVladimir Oltean SYS_COUNT_TX_1527_MAX,
404d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_0,
405d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_1,
406d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_2,
407d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_3,
408d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_4,
409d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_5,
410d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_6,
411d4c36765SVladimir Oltean SYS_COUNT_TX_YELLOW_PRIO_7,
412d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_0,
413d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_1,
414d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_2,
415d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_3,
416d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_4,
417d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_5,
418d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_6,
419d4c36765SVladimir Oltean SYS_COUNT_TX_GREEN_PRIO_7,
420be5c13f2SVladimir Oltean SYS_COUNT_TX_AGED,
421ab3f97a9SVladimir Oltean SYS_COUNT_TX_MM_HOLD,
422ab3f97a9SVladimir Oltean SYS_COUNT_TX_MERGE_FRAGMENTS,
423ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_OCTETS,
424ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_UNICAST,
425ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_MULTICAST,
426ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_BROADCAST,
427ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_PAUSE,
428ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_64,
429ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_65_127,
430ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_128_255,
431ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_256_511,
432ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_512_1023,
433ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_1024_1526,
434ab3f97a9SVladimir Oltean SYS_COUNT_TX_PMAC_1527_MAX,
435d4c36765SVladimir Oltean SYS_COUNT_DROP_LOCAL,
436d4c36765SVladimir Oltean SYS_COUNT_DROP_TAIL,
437d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_0,
438d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_1,
439d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_2,
440d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_3,
441d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_4,
442d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_5,
443d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_6,
444d4c36765SVladimir Oltean SYS_COUNT_DROP_YELLOW_PRIO_7,
445d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_0,
446d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_1,
447d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_2,
448d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_3,
449d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_4,
450d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_5,
451d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_6,
452d4c36765SVladimir Oltean SYS_COUNT_DROP_GREEN_PRIO_7,
4530a2360c5SVladimir Oltean SYS_COUNT_SF_MATCHING_FRAMES,
4540a2360c5SVladimir Oltean SYS_COUNT_SF_NOT_PASSING_FRAMES,
4550a2360c5SVladimir Oltean SYS_COUNT_SF_NOT_PASSING_SDU,
4560a2360c5SVladimir Oltean SYS_COUNT_SF_RED_FRAMES,
4575e256365SVladimir Oltean SYS_RESET_CFG,
4585e256365SVladimir Oltean SYS_SR_ETYPE_CFG,
4595e256365SVladimir Oltean SYS_VLAN_ETYPE_CFG,
4605e256365SVladimir Oltean SYS_PORT_MODE,
4615e256365SVladimir Oltean SYS_FRONT_PORT_MODE,
4625e256365SVladimir Oltean SYS_FRM_AGING,
4635e256365SVladimir Oltean SYS_STAT_CFG,
4645e256365SVladimir Oltean SYS_SW_STATUS,
4655e256365SVladimir Oltean SYS_MISC_CFG,
4665e256365SVladimir Oltean SYS_REW_MAC_HIGH_CFG,
4675e256365SVladimir Oltean SYS_REW_MAC_LOW_CFG,
4685e256365SVladimir Oltean SYS_TIMESTAMP_OFFSET,
4695e256365SVladimir Oltean SYS_CMID,
4705e256365SVladimir Oltean SYS_PAUSE_CFG,
4715e256365SVladimir Oltean SYS_PAUSE_TOT_CFG,
4725e256365SVladimir Oltean SYS_ATOP,
4735e256365SVladimir Oltean SYS_ATOP_TOT_CFG,
4745e256365SVladimir Oltean SYS_MAC_FC_CFG,
4755e256365SVladimir Oltean SYS_MMGT,
4765e256365SVladimir Oltean SYS_MMGT_FAST,
4775e256365SVladimir Oltean SYS_EVENTS_DIF,
4785e256365SVladimir Oltean SYS_EVENTS_CORE,
4795e256365SVladimir Oltean SYS_PTP_STATUS,
4805e256365SVladimir Oltean SYS_PTP_TXSTAMP,
4815e256365SVladimir Oltean SYS_PTP_NXT,
4825e256365SVladimir Oltean SYS_PTP_CFG,
4835e256365SVladimir Oltean SYS_RAM_INIT,
4845e256365SVladimir Oltean SYS_CM_ADDR,
4855e256365SVladimir Oltean SYS_CM_DATA_WR,
4865e256365SVladimir Oltean SYS_CM_DATA_RD,
4875e256365SVladimir Oltean SYS_CM_OP,
4885e256365SVladimir Oltean SYS_CM_DATA,
4895e256365SVladimir Oltean PTP_PIN_CFG = PTP << TARGET_OFFSET,
4905e256365SVladimir Oltean PTP_PIN_TOD_SEC_MSB,
4915e256365SVladimir Oltean PTP_PIN_TOD_SEC_LSB,
4925e256365SVladimir Oltean PTP_PIN_TOD_NSEC,
49394aca082SYangbo Lu PTP_PIN_WF_HIGH_PERIOD,
49494aca082SYangbo Lu PTP_PIN_WF_LOW_PERIOD,
4955e256365SVladimir Oltean PTP_CFG_MISC,
4965e256365SVladimir Oltean PTP_CLK_CFG_ADJ_CFG,
4975e256365SVladimir Oltean PTP_CLK_CFG_ADJ_FREQ,
4985e256365SVladimir Oltean GCB_SOFT_RST = GCB << TARGET_OFFSET,
4992789658fSMaxim Kochetkov GCB_MIIM_MII_STATUS,
5002789658fSMaxim Kochetkov GCB_MIIM_MII_CMD,
5012789658fSMaxim Kochetkov GCB_MIIM_MII_DATA,
50291c724cfSVladimir Oltean DEV_CLOCK_CFG = DEV_GMII << TARGET_OFFSET,
50391c724cfSVladimir Oltean DEV_PORT_MISC,
50491c724cfSVladimir Oltean DEV_EVENTS,
50591c724cfSVladimir Oltean DEV_EEE_CFG,
50691c724cfSVladimir Oltean DEV_RX_PATH_DELAY,
50791c724cfSVladimir Oltean DEV_TX_PATH_DELAY,
50891c724cfSVladimir Oltean DEV_PTP_PREDICT_CFG,
50991c724cfSVladimir Oltean DEV_MAC_ENA_CFG,
51091c724cfSVladimir Oltean DEV_MAC_MODE_CFG,
51191c724cfSVladimir Oltean DEV_MAC_MAXLEN_CFG,
51291c724cfSVladimir Oltean DEV_MAC_TAGS_CFG,
51391c724cfSVladimir Oltean DEV_MAC_ADV_CHK_CFG,
51491c724cfSVladimir Oltean DEV_MAC_IFG_CFG,
51591c724cfSVladimir Oltean DEV_MAC_HDX_CFG,
51691c724cfSVladimir Oltean DEV_MAC_DBG_CFG,
51791c724cfSVladimir Oltean DEV_MAC_FC_MAC_LOW_CFG,
51891c724cfSVladimir Oltean DEV_MAC_FC_MAC_HIGH_CFG,
51991c724cfSVladimir Oltean DEV_MAC_STICKY,
5206505b680SVladimir Oltean DEV_MM_ENABLE_CONFIG,
5216505b680SVladimir Oltean DEV_MM_VERIF_CONFIG,
5226505b680SVladimir Oltean DEV_MM_STATUS,
52391c724cfSVladimir Oltean PCS1G_CFG,
52491c724cfSVladimir Oltean PCS1G_MODE_CFG,
52591c724cfSVladimir Oltean PCS1G_SD_CFG,
52691c724cfSVladimir Oltean PCS1G_ANEG_CFG,
52791c724cfSVladimir Oltean PCS1G_ANEG_NP_CFG,
52891c724cfSVladimir Oltean PCS1G_LB_CFG,
52991c724cfSVladimir Oltean PCS1G_DBG_CFG,
53091c724cfSVladimir Oltean PCS1G_CDET_CFG,
53191c724cfSVladimir Oltean PCS1G_ANEG_STATUS,
53291c724cfSVladimir Oltean PCS1G_ANEG_NP_STATUS,
53391c724cfSVladimir Oltean PCS1G_LINK_STATUS,
53491c724cfSVladimir Oltean PCS1G_LINK_DOWN_CNT,
53591c724cfSVladimir Oltean PCS1G_STICKY,
53691c724cfSVladimir Oltean PCS1G_DEBUG_STATUS,
53791c724cfSVladimir Oltean PCS1G_LPI_CFG,
53891c724cfSVladimir Oltean PCS1G_LPI_WAKE_ERROR_CNT,
53991c724cfSVladimir Oltean PCS1G_LPI_STATUS,
54091c724cfSVladimir Oltean PCS1G_TSTPAT_MODE_CFG,
54191c724cfSVladimir Oltean PCS1G_TSTPAT_STATUS,
54291c724cfSVladimir Oltean DEV_PCS_FX100_CFG,
54391c724cfSVladimir Oltean DEV_PCS_FX100_STATUS,
5445e256365SVladimir Oltean };
5455e256365SVladimir Oltean
5465e256365SVladimir Oltean enum ocelot_regfield {
5475e256365SVladimir Oltean ANA_ADVLEARN_VLAN_CHK,
5485e256365SVladimir Oltean ANA_ADVLEARN_LEARN_MIRROR,
5495e256365SVladimir Oltean ANA_ANEVENTS_FLOOD_DISCARD,
5505e256365SVladimir Oltean ANA_ANEVENTS_MSTI_DROP,
5515e256365SVladimir Oltean ANA_ANEVENTS_ACLKILL,
5525e256365SVladimir Oltean ANA_ANEVENTS_ACLUSED,
5535e256365SVladimir Oltean ANA_ANEVENTS_AUTOAGE,
5545e256365SVladimir Oltean ANA_ANEVENTS_VS2TTL1,
5555e256365SVladimir Oltean ANA_ANEVENTS_STORM_DROP,
5565e256365SVladimir Oltean ANA_ANEVENTS_LEARN_DROP,
5575e256365SVladimir Oltean ANA_ANEVENTS_AGED_ENTRY,
5585e256365SVladimir Oltean ANA_ANEVENTS_CPU_LEARN_FAILED,
5595e256365SVladimir Oltean ANA_ANEVENTS_AUTO_LEARN_FAILED,
5605e256365SVladimir Oltean ANA_ANEVENTS_LEARN_REMOVE,
5615e256365SVladimir Oltean ANA_ANEVENTS_AUTO_LEARNED,
5625e256365SVladimir Oltean ANA_ANEVENTS_AUTO_MOVED,
5635e256365SVladimir Oltean ANA_ANEVENTS_DROPPED,
5645e256365SVladimir Oltean ANA_ANEVENTS_CLASSIFIED_DROP,
5655e256365SVladimir Oltean ANA_ANEVENTS_CLASSIFIED_COPY,
5665e256365SVladimir Oltean ANA_ANEVENTS_VLAN_DISCARD,
5675e256365SVladimir Oltean ANA_ANEVENTS_FWD_DISCARD,
5685e256365SVladimir Oltean ANA_ANEVENTS_MULTICAST_FLOOD,
5695e256365SVladimir Oltean ANA_ANEVENTS_UNICAST_FLOOD,
5705e256365SVladimir Oltean ANA_ANEVENTS_DEST_KNOWN,
5715e256365SVladimir Oltean ANA_ANEVENTS_BUCKET3_MATCH,
5725e256365SVladimir Oltean ANA_ANEVENTS_BUCKET2_MATCH,
5735e256365SVladimir Oltean ANA_ANEVENTS_BUCKET1_MATCH,
5745e256365SVladimir Oltean ANA_ANEVENTS_BUCKET0_MATCH,
5755e256365SVladimir Oltean ANA_ANEVENTS_CPU_OPERATION,
5765e256365SVladimir Oltean ANA_ANEVENTS_DMAC_LOOKUP,
5775e256365SVladimir Oltean ANA_ANEVENTS_SMAC_LOOKUP,
5785e256365SVladimir Oltean ANA_ANEVENTS_SEQ_GEN_ERR_0,
5795e256365SVladimir Oltean ANA_ANEVENTS_SEQ_GEN_ERR_1,
5805e256365SVladimir Oltean ANA_TABLES_MACACCESS_B_DOM,
5815e256365SVladimir Oltean ANA_TABLES_MACTINDX_BUCKET,
5825e256365SVladimir Oltean ANA_TABLES_MACTINDX_M_INDEX,
583886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_PORT_ENA,
584886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_SCH_NEXT_CFG,
585886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_YEL_RSRVD,
586886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_INGRESS_DROP_MODE,
587886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_TX_PFC_ENA,
588886e1387SVladimir Oltean QSYS_SWITCH_PORT_MODE_TX_PFC_MODE,
5895e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY_TFRM_VLD,
5905e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY_TFRM_FP,
5915e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY_TFRM_PORTNO,
5925e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY_TFRM_TM_SEL,
5935e256365SVladimir Oltean QSYS_TIMED_FRAME_ENTRY_TFRM_TM_T,
594886e1387SVladimir Oltean SYS_PORT_MODE_DATA_WO_TS,
595886e1387SVladimir Oltean SYS_PORT_MODE_INCL_INJ_HDR,
596886e1387SVladimir Oltean SYS_PORT_MODE_INCL_XTR_HDR,
597886e1387SVladimir Oltean SYS_PORT_MODE_INCL_HDR_ERR,
5985e256365SVladimir Oltean SYS_RESET_CFG_CORE_ENA,
5995e256365SVladimir Oltean SYS_RESET_CFG_MEM_ENA,
6005e256365SVladimir Oltean SYS_RESET_CFG_MEM_INIT,
6015e256365SVladimir Oltean GCB_SOFT_RST_SWC_RST,
6022789658fSMaxim Kochetkov GCB_MIIM_MII_STATUS_PENDING,
6032789658fSMaxim Kochetkov GCB_MIIM_MII_STATUS_BUSY,
604541132f0SMaxim Kochetkov SYS_PAUSE_CFG_PAUSE_START,
605541132f0SMaxim Kochetkov SYS_PAUSE_CFG_PAUSE_STOP,
606541132f0SMaxim Kochetkov SYS_PAUSE_CFG_PAUSE_ENA,
6075e256365SVladimir Oltean REGFIELD_MAX
6085e256365SVladimir Oltean };
6095e256365SVladimir Oltean
610c1c3993eSVladimir Oltean enum {
611c1c3993eSVladimir Oltean /* VCAP_CORE_CFG */
612c1c3993eSVladimir Oltean VCAP_CORE_UPDATE_CTRL,
613c1c3993eSVladimir Oltean VCAP_CORE_MV_CFG,
614c1c3993eSVladimir Oltean /* VCAP_CORE_CACHE */
615c1c3993eSVladimir Oltean VCAP_CACHE_ENTRY_DAT,
616c1c3993eSVladimir Oltean VCAP_CACHE_MASK_DAT,
617c1c3993eSVladimir Oltean VCAP_CACHE_ACTION_DAT,
618c1c3993eSVladimir Oltean VCAP_CACHE_CNT_DAT,
619c1c3993eSVladimir Oltean VCAP_CACHE_TG_DAT,
62020968054SVladimir Oltean /* VCAP_CONST */
62120968054SVladimir Oltean VCAP_CONST_VCAP_VER,
62220968054SVladimir Oltean VCAP_CONST_ENTRY_WIDTH,
62320968054SVladimir Oltean VCAP_CONST_ENTRY_CNT,
62420968054SVladimir Oltean VCAP_CONST_ENTRY_SWCNT,
62520968054SVladimir Oltean VCAP_CONST_ENTRY_TG_WIDTH,
62620968054SVladimir Oltean VCAP_CONST_ACTION_DEF_CNT,
62720968054SVladimir Oltean VCAP_CONST_ACTION_WIDTH,
62820968054SVladimir Oltean VCAP_CONST_CNT_WIDTH,
62920968054SVladimir Oltean VCAP_CONST_CORE_CNT,
63020968054SVladimir Oltean VCAP_CONST_IF_CNT,
631c1c3993eSVladimir Oltean };
632c1c3993eSVladimir Oltean
6333007bc73SYangbo Lu enum ocelot_ptp_pins {
6343007bc73SYangbo Lu PTP_PIN_0,
6353007bc73SYangbo Lu PTP_PIN_1,
6363007bc73SYangbo Lu PTP_PIN_2,
6373007bc73SYangbo Lu PTP_PIN_3,
6385e256365SVladimir Oltean TOD_ACC_PIN
6395e256365SVladimir Oltean };
6405e256365SVladimir Oltean
6415e256365SVladimir Oltean enum ocelot_tag_prefix {
6425e256365SVladimir Oltean OCELOT_TAG_PREFIX_DISABLED = 0,
6435e256365SVladimir Oltean OCELOT_TAG_PREFIX_NONE,
6445e256365SVladimir Oltean OCELOT_TAG_PREFIX_SHORT,
6455e256365SVladimir Oltean OCELOT_TAG_PREFIX_LONG,
6465e256365SVladimir Oltean };
6475e256365SVladimir Oltean
6485e256365SVladimir Oltean struct ocelot;
649dfca93edSColin Foster struct device_node;
6505e256365SVladimir Oltean
6515e256365SVladimir Oltean struct ocelot_ops {
652319e4dd1SVladimir Oltean struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
653319e4dd1SVladimir Oltean int (*netdev_to_port)(struct net_device *dev);
6545e256365SVladimir Oltean int (*reset)(struct ocelot *ocelot);
655aa92d836SMaxim Kochetkov u16 (*wm_enc)(u16 value);
656703b7621SVladimir Oltean u16 (*wm_dec)(u16 value);
657703b7621SVladimir Oltean void (*wm_stat)(u32 val, u32 *inuse, u32 *maxuse);
65823e2c506SXiaoliang Yang void (*psfp_init)(struct ocelot *ocelot);
659a7e13edfSXiaoliang Yang int (*psfp_filter_add)(struct ocelot *ocelot, int port,
660a7e13edfSXiaoliang Yang struct flow_cls_offload *f);
66123e2c506SXiaoliang Yang int (*psfp_filter_del)(struct ocelot *ocelot, struct flow_cls_offload *f);
66223e2c506SXiaoliang Yang int (*psfp_stats_get)(struct ocelot *ocelot, struct flow_cls_offload *f,
66323e2c506SXiaoliang Yang struct flow_stats *stats);
6648abe1970SVladimir Oltean void (*cut_through_fwd)(struct ocelot *ocelot);
6658670dc33SXiaoliang Yang void (*tas_clock_adjust)(struct ocelot *ocelot);
666c6081914SVladimir Oltean void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
66725027c84SVladimir Oltean void (*update_stats)(struct ocelot *ocelot);
6685e256365SVladimir Oltean };
6695e256365SVladimir Oltean
67077043c37SXiaoliang Yang struct ocelot_vcap_policer {
67177043c37SXiaoliang Yang struct list_head pol_list;
67277043c37SXiaoliang Yang u16 base;
67377043c37SXiaoliang Yang u16 max;
67477043c37SXiaoliang Yang u16 base2;
67577043c37SXiaoliang Yang u16 max2;
67677043c37SXiaoliang Yang };
67777043c37SXiaoliang Yang
678aae4e500SVladimir Oltean struct ocelot_vcap_block {
679a56d7a34SVladimir Oltean struct list_head rules;
680a56d7a34SVladimir Oltean int count;
681a56d7a34SVladimir Oltean };
682a56d7a34SVladimir Oltean
68390e0aa8dSVladimir Oltean struct ocelot_bridge_vlan {
68490e0aa8dSVladimir Oltean u16 vid;
68590e0aa8dSVladimir Oltean unsigned long portmask;
6860da1a1c4SVladimir Oltean unsigned long untagged;
68790e0aa8dSVladimir Oltean struct list_head list;
68890e0aa8dSVladimir Oltean };
68990e0aa8dSVladimir Oltean
69062a22bcbSVladimir Oltean enum ocelot_port_tag_config {
69162a22bcbSVladimir Oltean /* all VLANs are egress-untagged */
69262a22bcbSVladimir Oltean OCELOT_PORT_TAG_DISABLED = 0,
69362a22bcbSVladimir Oltean /* all VLANs except the native VLAN and VID 0 are egress-tagged */
69462a22bcbSVladimir Oltean OCELOT_PORT_TAG_NATIVE = 1,
69562a22bcbSVladimir Oltean /* all VLANs except VID 0 are egress-tagged */
69662a22bcbSVladimir Oltean OCELOT_PORT_TAG_TRUNK_NO_VID0 = 2,
69762a22bcbSVladimir Oltean /* all VLANs are egress-tagged */
69862a22bcbSVladimir Oltean OCELOT_PORT_TAG_TRUNK = 3,
69962a22bcbSVladimir Oltean };
70062a22bcbSVladimir Oltean
7017d4b564dSXiaoliang Yang struct ocelot_psfp_list {
7027d4b564dSXiaoliang Yang struct list_head stream_list;
7037d4b564dSXiaoliang Yang struct list_head sfi_list;
7047d4b564dSXiaoliang Yang struct list_head sgi_list;
70525027c84SVladimir Oltean /* Serialize access to the lists */
70625027c84SVladimir Oltean struct mutex lock;
7077d4b564dSXiaoliang Yang };
7087d4b564dSXiaoliang Yang
709f59fd9caSVladimir Oltean enum ocelot_sb {
710f59fd9caSVladimir Oltean OCELOT_SB_BUF,
711f59fd9caSVladimir Oltean OCELOT_SB_REF,
712f59fd9caSVladimir Oltean OCELOT_SB_NUM,
713f59fd9caSVladimir Oltean };
714f59fd9caSVladimir Oltean
715f59fd9caSVladimir Oltean enum ocelot_sb_pool {
716f59fd9caSVladimir Oltean OCELOT_SB_POOL_ING,
717f59fd9caSVladimir Oltean OCELOT_SB_POOL_EGR,
718f59fd9caSVladimir Oltean OCELOT_SB_POOL_NUM,
719f59fd9caSVladimir Oltean };
720f59fd9caSVladimir Oltean
7210568c3bfSXiaoliang Yang /* MAC table entry types.
7220568c3bfSXiaoliang Yang * ENTRYTYPE_NORMAL is subject to aging.
7230568c3bfSXiaoliang Yang * ENTRYTYPE_LOCKED is not subject to aging.
7240568c3bfSXiaoliang Yang * ENTRYTYPE_MACv4 is not subject to aging. For IPv4 multicast.
7250568c3bfSXiaoliang Yang * ENTRYTYPE_MACv6 is not subject to aging. For IPv6 multicast.
7260568c3bfSXiaoliang Yang */
7270568c3bfSXiaoliang Yang enum macaccess_entry_type {
7280568c3bfSXiaoliang Yang ENTRYTYPE_NORMAL = 0,
7290568c3bfSXiaoliang Yang ENTRYTYPE_LOCKED,
7300568c3bfSXiaoliang Yang ENTRYTYPE_MACv4,
7310568c3bfSXiaoliang Yang ENTRYTYPE_MACv6,
7320568c3bfSXiaoliang Yang };
7330568c3bfSXiaoliang Yang
73445d0fcb5SVladimir Oltean enum ocelot_proto {
73545d0fcb5SVladimir Oltean OCELOT_PROTO_PTP_L2 = BIT(0),
73645d0fcb5SVladimir Oltean OCELOT_PROTO_PTP_L4 = BIT(1),
73745d0fcb5SVladimir Oltean };
73845d0fcb5SVladimir Oltean
739e6e12df6SVladimir Oltean #define OCELOT_QUIRK_PCS_PERFORMS_RATE_ADAPTATION BIT(0)
740e6e12df6SVladimir Oltean #define OCELOT_QUIRK_QSGMII_PORTS_MUST_BE_UP BIT(1)
741e6e12df6SVladimir Oltean
742961d8b69SVladimir Oltean struct ocelot_lag_fdb {
743961d8b69SVladimir Oltean unsigned char addr[ETH_ALEN];
744961d8b69SVladimir Oltean u16 vid;
745961d8b69SVladimir Oltean struct net_device *bond;
746961d8b69SVladimir Oltean struct list_head list;
747961d8b69SVladimir Oltean };
748961d8b69SVladimir Oltean
749ccb6ed42SVladimir Oltean struct ocelot_mirror {
750ccb6ed42SVladimir Oltean refcount_t refcount;
751ccb6ed42SVladimir Oltean int to;
752ccb6ed42SVladimir Oltean };
753ccb6ed42SVladimir Oltean
7546505b680SVladimir Oltean struct ocelot_mm_state {
7556505b680SVladimir Oltean enum ethtool_mm_verify_status verify_status;
7567bf4a5b0SVladimir Oltean bool tx_enabled;
7576505b680SVladimir Oltean bool tx_active;
758403ffc2cSVladimir Oltean u8 preemptible_tcs;
759403ffc2cSVladimir Oltean u8 active_preemptible_tcs;
7606505b680SVladimir Oltean };
7616505b680SVladimir Oltean
762c295f983SVladimir Oltean struct ocelot_port;
763c295f983SVladimir Oltean
7645e256365SVladimir Oltean struct ocelot_port {
7655e256365SVladimir Oltean struct ocelot *ocelot;
7665e256365SVladimir Oltean
76791c724cfSVladimir Oltean struct regmap *target;
7685e256365SVladimir Oltean
7696d0be600SVladimir Oltean struct net_device *bond;
7706d0be600SVladimir Oltean struct net_device *bridge;
7716d0be600SVladimir Oltean
772c295f983SVladimir Oltean struct ocelot_port *dsa_8021q_cpu;
773c295f983SVladimir Oltean
774c3e58a75SVladimir Oltean /* VLAN that untagged frames are classified to, on ingress */
775d4004422SVladimir Oltean const struct ocelot_bridge_vlan *pvid_vlan;
7765e256365SVladimir Oltean
7771c9017e4SVladimir Oltean struct tc_taprio_qopt_offload *taprio;
7781c9017e4SVladimir Oltean
779ee50d07cSVladimir Oltean phy_interface_t phy_mode;
78067c24049SVladimir Oltean
7816d0be600SVladimir Oltean struct sk_buff_head tx_skbs;
7827c588c3eSHoratiu Vultur
78345d0fcb5SVladimir Oltean unsigned int trap_proto;
78445d0fcb5SVladimir Oltean
7857c588c3eSHoratiu Vultur u16 mrp_ring_id;
786df291e54SVladimir Oltean
7876d0be600SVladimir Oltean u8 ptp_cmd;
7886d0be600SVladimir Oltean
7897e708760SVladimir Oltean u8 index;
7907e708760SVladimir Oltean
791df291e54SVladimir Oltean u8 stp_state;
7926d0be600SVladimir Oltean bool vlan_aware;
7936d0be600SVladimir Oltean bool is_dsa_8021q_cpu;
7946d0be600SVladimir Oltean bool learn_ena;
7956d0be600SVladimir Oltean
7966d0be600SVladimir Oltean bool lag_tx_active;
7976d0be600SVladimir Oltean
7986d0be600SVladimir Oltean int bridge_num;
7998abe1970SVladimir Oltean
8008abe1970SVladimir Oltean int speed;
8015e256365SVladimir Oltean };
8025e256365SVladimir Oltean
8035e256365SVladimir Oltean struct ocelot {
8045e256365SVladimir Oltean struct device *dev;
8056c30384eSVladimir Oltean struct devlink *devlink;
8066c30384eSVladimir Oltean struct devlink_port *devlink_ports;
8075e256365SVladimir Oltean
8085e256365SVladimir Oltean const struct ocelot_ops *ops;
8095e256365SVladimir Oltean struct regmap *targets[TARGET_MAX];
8105e256365SVladimir Oltean struct regmap_field *regfields[REGFIELD_MAX];
8115e256365SVladimir Oltean const u32 *const *map;
812d87b1c08SColin Foster struct list_head stats_regions;
8135e256365SVladimir Oltean
814*e83b49ecSVladimir Oltean spinlock_t inj_lock;
815*e83b49ecSVladimir Oltean spinlock_t xtr_lock;
816*e83b49ecSVladimir Oltean
817f59fd9caSVladimir Oltean u32 pool_size[OCELOT_SB_NUM][OCELOT_SB_POOL_NUM];
818f6fe01d6SVladimir Oltean int packet_buffer_size;
819f6fe01d6SVladimir Oltean int num_frame_refs;
82021ce7f3eSVladimir Oltean int num_mact_rows;
8215e256365SVladimir Oltean
8225e256365SVladimir Oltean struct ocelot_port **ports;
8235e256365SVladimir Oltean
8245e256365SVladimir Oltean u8 base_mac[ETH_ALEN];
8255e256365SVladimir Oltean
82690e0aa8dSVladimir Oltean struct list_head vlans;
827e42bd4edSVladimir Oltean struct list_head traps;
828961d8b69SVladimir Oltean struct list_head lag_fdbs;
8295e256365SVladimir Oltean
830edd2410bSVladimir Oltean /* Switches like VSC9959 have flooding per traffic class */
831edd2410bSVladimir Oltean int num_flooding_pgids;
832edd2410bSVladimir Oltean
83369df578cSVladimir Oltean /* In tables like ANA:PORT and the ANA:PGID:PGID mask,
83469df578cSVladimir Oltean * the CPU is located after the physical ports (at the
83569df578cSVladimir Oltean * num_phys_ports index).
83669df578cSVladimir Oltean */
8375e256365SVladimir Oltean u8 num_phys_ports;
8385e256365SVladimir Oltean
8390b912fc9SVladimir Oltean int npi;
8400b912fc9SVladimir Oltean
841cacea62fSVladimir Oltean enum ocelot_tag_prefix npi_inj_prefix;
842cacea62fSVladimir Oltean enum ocelot_tag_prefix npi_xtr_prefix;
8430b912fc9SVladimir Oltean
84454c31984SVladimir Oltean unsigned long bridges;
84554c31984SVladimir Oltean
8465e256365SVladimir Oltean struct list_head multicast;
847e5d1f896SVladimir Oltean struct list_head pgids;
8485e256365SVladimir Oltean
8491397a2ebSVladimir Oltean struct list_head dummy_rules;
8501397a2ebSVladimir Oltean struct ocelot_vcap_block block[3];
85177043c37SXiaoliang Yang struct ocelot_vcap_policer vcap_pol;
85220968054SVladimir Oltean struct vcap_props *vcap;
853ccb6ed42SVladimir Oltean struct ocelot_mirror *mirror;
854e0632940SVladimir Oltean
8557d4b564dSXiaoliang Yang struct ocelot_psfp_list psfp;
8567d4b564dSXiaoliang Yang
85796980ff7SVladimir Oltean /* Workqueue to check statistics for overflow */
8585e256365SVladimir Oltean struct delayed_work stats_work;
8595e256365SVladimir Oltean struct workqueue_struct *stats_queue;
86096980ff7SVladimir Oltean /* Lock for serializing access to the statistics array */
86196980ff7SVladimir Oltean spinlock_t stats_lock;
86296980ff7SVladimir Oltean u64 *stats;
8635e256365SVladimir Oltean
86496980ff7SVladimir Oltean /* Lock for serializing indirect access to STAT_VIEW registers */
86596980ff7SVladimir Oltean struct mutex stat_view_lock;
8662468346cSVladimir Oltean /* Lock for serializing access to the MAC table */
8672468346cSVladimir Oltean struct mutex mact_lock;
868009d30f1SVladimir Oltean /* Lock for serializing forwarding domain changes, including the
869009d30f1SVladimir Oltean * configuration of the Time-Aware Shaper, MAC Merge layer and
870009d30f1SVladimir Oltean * cut-through forwarding, on which it depends
871009d30f1SVladimir Oltean */
8728abe1970SVladimir Oltean struct mutex fwd_domain_lock;
8732468346cSVladimir Oltean
874ca0b272bSVladimir Oltean struct workqueue_struct *owq;
875ca0b272bSVladimir Oltean
8765e256365SVladimir Oltean u8 ptp:1;
877ab3f97a9SVladimir Oltean u8 mm_supported:1;
8785e256365SVladimir Oltean struct ptp_clock *ptp_clock;
8795e256365SVladimir Oltean struct ptp_clock_info ptp_info;
88052849bcfSVladimir Oltean unsigned int ptp_skbs_in_flight;
88152849bcfSVladimir Oltean /* Protects the 2-step TX timestamp ID logic */
88252849bcfSVladimir Oltean spinlock_t ts_id_lock;
8835e256365SVladimir Oltean /* Protects the PTP clock */
8845e256365SVladimir Oltean spinlock_t ptp_clock_lock;
885cc2d87bbSYangbo Lu struct ptp_pin_desc ptp_pins[OCELOT_PTP_PINS_NUM];
886753a026cSClément Léger
8876505b680SVladimir Oltean struct ocelot_mm_state *mm;
8886505b680SVladimir Oltean
889753a026cSClément Léger struct ocelot_fdma *fdma;
8905e256365SVladimir Oltean };
8915e256365SVladimir Oltean
892fc411eaaSVladimir Oltean struct ocelot_policer {
893fc411eaaSVladimir Oltean u32 rate; /* kilobit per second */
894fc411eaaSVladimir Oltean u32 burst; /* bytes */
895fc411eaaSVladimir Oltean };
896fc411eaaSVladimir Oltean
897d4c36765SVladimir Oltean #define ocelot_bulk_read(ocelot, reg, buf, count) \
898d4c36765SVladimir Oltean __ocelot_bulk_read_ix(ocelot, reg, 0, buf, count)
89940f3a5c8SColin Foster
90065c53595SColin Foster #define ocelot_read_ix(ocelot, reg, gi, ri) \
90165c53595SColin Foster __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
90265c53595SColin Foster #define ocelot_read_gix(ocelot, reg, gi) \
90365c53595SColin Foster __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi))
90465c53595SColin Foster #define ocelot_read_rix(ocelot, reg, ri) \
90565c53595SColin Foster __ocelot_read_ix(ocelot, reg, reg##_RSZ * (ri))
90665c53595SColin Foster #define ocelot_read(ocelot, reg) \
90765c53595SColin Foster __ocelot_read_ix(ocelot, reg, 0)
9085e256365SVladimir Oltean
90965c53595SColin Foster #define ocelot_write_ix(ocelot, val, reg, gi, ri) \
91065c53595SColin Foster __ocelot_write_ix(ocelot, val, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
91165c53595SColin Foster #define ocelot_write_gix(ocelot, val, reg, gi) \
91265c53595SColin Foster __ocelot_write_ix(ocelot, val, reg, reg##_GSZ * (gi))
91365c53595SColin Foster #define ocelot_write_rix(ocelot, val, reg, ri) \
91465c53595SColin Foster __ocelot_write_ix(ocelot, val, reg, reg##_RSZ * (ri))
9155e256365SVladimir Oltean #define ocelot_write(ocelot, val, reg) __ocelot_write_ix(ocelot, val, reg, 0)
9165e256365SVladimir Oltean
91765c53595SColin Foster #define ocelot_rmw_ix(ocelot, val, m, reg, gi, ri) \
91865c53595SColin Foster __ocelot_rmw_ix(ocelot, val, m, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
91965c53595SColin Foster #define ocelot_rmw_gix(ocelot, val, m, reg, gi) \
92065c53595SColin Foster __ocelot_rmw_ix(ocelot, val, m, reg, reg##_GSZ * (gi))
92165c53595SColin Foster #define ocelot_rmw_rix(ocelot, val, m, reg, ri) \
92265c53595SColin Foster __ocelot_rmw_ix(ocelot, val, m, reg, reg##_RSZ * (ri))
9235e256365SVladimir Oltean #define ocelot_rmw(ocelot, val, m, reg) __ocelot_rmw_ix(ocelot, val, m, reg, 0)
9245e256365SVladimir Oltean
92565c53595SColin Foster #define ocelot_field_write(ocelot, reg, val) \
92665c53595SColin Foster regmap_field_write((ocelot)->regfields[(reg)], (val))
92765c53595SColin Foster #define ocelot_field_read(ocelot, reg, val) \
92865c53595SColin Foster regmap_field_read((ocelot)->regfields[(reg)], (val))
92965c53595SColin Foster #define ocelot_fields_write(ocelot, id, reg, val) \
93065c53595SColin Foster regmap_fields_write((ocelot)->regfields[(reg)], (id), (val))
93165c53595SColin Foster #define ocelot_fields_read(ocelot, id, reg, val) \
93265c53595SColin Foster regmap_fields_read((ocelot)->regfields[(reg)], (id), (val))
933886e1387SVladimir Oltean
9343c0e37a9SVladimir Oltean #define ocelot_target_read_ix(ocelot, target, reg, gi, ri) \
9353c0e37a9SVladimir Oltean __ocelot_target_read_ix(ocelot, target, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
9363c0e37a9SVladimir Oltean #define ocelot_target_read_gix(ocelot, target, reg, gi) \
9373c0e37a9SVladimir Oltean __ocelot_target_read_ix(ocelot, target, reg, reg##_GSZ * (gi))
9383c0e37a9SVladimir Oltean #define ocelot_target_read_rix(ocelot, target, reg, ri) \
9393c0e37a9SVladimir Oltean __ocelot_target_read_ix(ocelot, target, reg, reg##_RSZ * (ri))
9403c0e37a9SVladimir Oltean #define ocelot_target_read(ocelot, target, reg) \
9413c0e37a9SVladimir Oltean __ocelot_target_read_ix(ocelot, target, reg, 0)
9423c0e37a9SVladimir Oltean
9433c0e37a9SVladimir Oltean #define ocelot_target_write_ix(ocelot, target, val, reg, gi, ri) \
9443c0e37a9SVladimir Oltean __ocelot_target_write_ix(ocelot, target, val, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
9453c0e37a9SVladimir Oltean #define ocelot_target_write_gix(ocelot, target, val, reg, gi) \
9463c0e37a9SVladimir Oltean __ocelot_target_write_ix(ocelot, target, val, reg, reg##_GSZ * (gi))
9473c0e37a9SVladimir Oltean #define ocelot_target_write_rix(ocelot, target, val, reg, ri) \
9483c0e37a9SVladimir Oltean __ocelot_target_write_ix(ocelot, target, val, reg, reg##_RSZ * (ri))
9493c0e37a9SVladimir Oltean #define ocelot_target_write(ocelot, target, val, reg) \
9503c0e37a9SVladimir Oltean __ocelot_target_write_ix(ocelot, target, val, reg, 0)
9513c0e37a9SVladimir Oltean
9525e256365SVladimir Oltean /* I/O */
9539ecd0579SVladimir Oltean u32 ocelot_port_readl(struct ocelot_port *port, enum ocelot_reg reg);
9549ecd0579SVladimir Oltean void ocelot_port_writel(struct ocelot_port *port, u32 val, enum ocelot_reg reg);
9559ecd0579SVladimir Oltean void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask,
9569ecd0579SVladimir Oltean enum ocelot_reg reg);
9579ecd0579SVladimir Oltean int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg,
9589ecd0579SVladimir Oltean u32 offset, void *buf, int count);
9599ecd0579SVladimir Oltean u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset);
9609ecd0579SVladimir Oltean void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg,
9615e256365SVladimir Oltean u32 offset);
9629ecd0579SVladimir Oltean void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask,
9639ecd0579SVladimir Oltean enum ocelot_reg reg, u32 offset);
9643c0e37a9SVladimir Oltean u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target,
9653c0e37a9SVladimir Oltean u32 reg, u32 offset);
9663c0e37a9SVladimir Oltean void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target,
9673c0e37a9SVladimir Oltean u32 val, u32 reg, u32 offset);
9685e256365SVladimir Oltean
96939e5308bSYangbo Lu /* Packet I/O */
970*e83b49ecSVladimir Oltean void ocelot_lock_inj_grp(struct ocelot *ocelot, int grp);
971*e83b49ecSVladimir Oltean void ocelot_unlock_inj_grp(struct ocelot *ocelot, int grp);
972*e83b49ecSVladimir Oltean void ocelot_lock_xtr_grp(struct ocelot *ocelot, int grp);
973*e83b49ecSVladimir Oltean void ocelot_unlock_xtr_grp(struct ocelot *ocelot, int grp);
974*e83b49ecSVladimir Oltean void ocelot_lock_xtr_grp_bh(struct ocelot *ocelot, int grp);
975*e83b49ecSVladimir Oltean void ocelot_unlock_xtr_grp_bh(struct ocelot *ocelot, int grp);
976137ffbc4SVladimir Oltean bool ocelot_can_inject(struct ocelot *ocelot, int grp);
977137ffbc4SVladimir Oltean void ocelot_port_inject_frame(struct ocelot *ocelot, int port, int grp,
978137ffbc4SVladimir Oltean u32 rew_op, struct sk_buff *skb);
979dd17e1e6SVladimir Oltean void ocelot_ifh_set_basic(void *ifh, struct ocelot *ocelot, int port,
980dd17e1e6SVladimir Oltean u32 rew_op, struct sk_buff *skb);
981924ee317SVladimir Oltean int ocelot_xtr_poll_frame(struct ocelot *ocelot, int grp, struct sk_buff **skb);
9820a6f17c6SVladimir Oltean void ocelot_drain_cpu_queue(struct ocelot *ocelot, int grp);
983b471a71eSClément Léger void ocelot_ptp_rx_timestamp(struct ocelot *ocelot, struct sk_buff *skb,
984b471a71eSClément Léger u64 timestamp);
985137ffbc4SVladimir Oltean
9865e256365SVladimir Oltean /* Hardware initialization */
9875e256365SVladimir Oltean int ocelot_regfields_init(struct ocelot *ocelot,
9885e256365SVladimir Oltean const struct reg_field *const regfields);
9895e256365SVladimir Oltean struct regmap *ocelot_regmap_init(struct ocelot *ocelot, struct resource *res);
990b67f5502SColin Foster int ocelot_reset(struct ocelot *ocelot);
9915e256365SVladimir Oltean int ocelot_init(struct ocelot *ocelot);
9925e256365SVladimir Oltean void ocelot_deinit(struct ocelot *ocelot);
9935e256365SVladimir Oltean void ocelot_init_port(struct ocelot *ocelot, int port);
994e5fb512dSVladimir Oltean void ocelot_deinit_port(struct ocelot *ocelot, int port);
9955e256365SVladimir Oltean
99636a0bf44SVladimir Oltean void ocelot_port_setup_dsa_8021q_cpu(struct ocelot *ocelot, int cpu);
99736a0bf44SVladimir Oltean void ocelot_port_teardown_dsa_8021q_cpu(struct ocelot *ocelot, int cpu);
998c295f983SVladimir Oltean void ocelot_port_assign_dsa_8021q_cpu(struct ocelot *ocelot, int port, int cpu);
999c295f983SVladimir Oltean void ocelot_port_unassign_dsa_8021q_cpu(struct ocelot *ocelot, int port);
1000c295f983SVladimir Oltean u32 ocelot_port_assigned_dsa_8021q_cpu_mask(struct ocelot *ocelot, int port);
100154c31984SVladimir Oltean
1002c6a9321bSColin Foster /* Watermark interface */
1003c6a9321bSColin Foster u16 ocelot_wm_enc(u16 value);
1004c6a9321bSColin Foster u16 ocelot_wm_dec(u16 wm);
1005c6a9321bSColin Foster void ocelot_wm_stat(u32 val, u32 *inuse, u32 *maxuse);
1006c6a9321bSColin Foster
10075e256365SVladimir Oltean /* DSA callbacks */
10085e256365SVladimir Oltean void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data);
10095e256365SVladimir Oltean void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data);
10105e256365SVladimir Oltean int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset);
1011776b71e5SVladimir Oltean void ocelot_port_get_stats64(struct ocelot *ocelot, int port,
1012776b71e5SVladimir Oltean struct rtnl_link_stats64 *stats);
1013e32036e1SVladimir Oltean void ocelot_port_get_pause_stats(struct ocelot *ocelot, int port,
1014e32036e1SVladimir Oltean struct ethtool_pause_stats *pause_stats);
1015ab3f97a9SVladimir Oltean void ocelot_port_get_mm_stats(struct ocelot *ocelot, int port,
1016ab3f97a9SVladimir Oltean struct ethtool_mm_stats *stats);
1017e32036e1SVladimir Oltean void ocelot_port_get_rmon_stats(struct ocelot *ocelot, int port,
1018e32036e1SVladimir Oltean struct ethtool_rmon_stats *rmon_stats,
1019e32036e1SVladimir Oltean const struct ethtool_rmon_hist_range **ranges);
1020e32036e1SVladimir Oltean void ocelot_port_get_eth_ctrl_stats(struct ocelot *ocelot, int port,
1021e32036e1SVladimir Oltean struct ethtool_eth_ctrl_stats *ctrl_stats);
1022e32036e1SVladimir Oltean void ocelot_port_get_eth_mac_stats(struct ocelot *ocelot, int port,
1023e32036e1SVladimir Oltean struct ethtool_eth_mac_stats *mac_stats);
1024e32036e1SVladimir Oltean void ocelot_port_get_eth_phy_stats(struct ocelot *ocelot, int port,
1025e32036e1SVladimir Oltean struct ethtool_eth_phy_stats *phy_stats);
10265e256365SVladimir Oltean int ocelot_get_ts_info(struct ocelot *ocelot, int port,
10275e256365SVladimir Oltean struct ethtool_ts_info *info);
10285e256365SVladimir Oltean void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs);
10293b95d1b2SVladimir Oltean int ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, bool enabled,
10303b95d1b2SVladimir Oltean struct netlink_ext_ack *extack);
10315e256365SVladimir Oltean void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state);
10328abe1970SVladimir Oltean u32 ocelot_get_bridge_fwd_mask(struct ocelot *ocelot, int src_port);
1033421741eaSVladimir Oltean int ocelot_port_pre_bridge_flags(struct ocelot *ocelot, int port,
1034421741eaSVladimir Oltean struct switchdev_brport_flags val);
1035421741eaSVladimir Oltean void ocelot_port_bridge_flags(struct ocelot *ocelot, int port,
1036421741eaSVladimir Oltean struct switchdev_brport_flags val);
1037978777d0SVladimir Oltean int ocelot_port_get_default_prio(struct ocelot *ocelot, int port);
1038978777d0SVladimir Oltean int ocelot_port_set_default_prio(struct ocelot *ocelot, int port, u8 prio);
1039978777d0SVladimir Oltean int ocelot_port_get_dscp_prio(struct ocelot *ocelot, int port, u8 dscp);
1040978777d0SVladimir Oltean int ocelot_port_add_dscp_prio(struct ocelot *ocelot, int port, u8 dscp, u8 prio);
1041978777d0SVladimir Oltean int ocelot_port_del_dscp_prio(struct ocelot *ocelot, int port, u8 dscp, u8 prio);
104254c31984SVladimir Oltean int ocelot_port_bridge_join(struct ocelot *ocelot, int port,
104354c31984SVladimir Oltean struct net_device *bridge, int bridge_num,
104454c31984SVladimir Oltean struct netlink_ext_ack *extack);
1045e4bd44e8SVladimir Oltean void ocelot_port_bridge_leave(struct ocelot *ocelot, int port,
10465e256365SVladimir Oltean struct net_device *bridge);
10475cad43a5SVladimir Oltean int ocelot_mact_flush(struct ocelot *ocelot, int port);
10485e256365SVladimir Oltean int ocelot_fdb_dump(struct ocelot *ocelot, int port,
10495e256365SVladimir Oltean dsa_fdb_dump_cb_t *cb, void *data);
105054c31984SVladimir Oltean int ocelot_fdb_add(struct ocelot *ocelot, int port, const unsigned char *addr,
105154c31984SVladimir Oltean u16 vid, const struct net_device *bridge);
105254c31984SVladimir Oltean int ocelot_fdb_del(struct ocelot *ocelot, int port, const unsigned char *addr,
105354c31984SVladimir Oltean u16 vid, const struct net_device *bridge);
1054961d8b69SVladimir Oltean int ocelot_lag_fdb_add(struct ocelot *ocelot, struct net_device *bond,
105554c31984SVladimir Oltean const unsigned char *addr, u16 vid,
105654c31984SVladimir Oltean const struct net_device *bridge);
1057961d8b69SVladimir Oltean int ocelot_lag_fdb_del(struct ocelot *ocelot, struct net_device *bond,
105854c31984SVladimir Oltean const unsigned char *addr, u16 vid,
105954c31984SVladimir Oltean const struct net_device *bridge);
10602f0402feSVladimir Oltean int ocelot_vlan_prepare(struct ocelot *ocelot, int port, u16 vid, bool pvid,
106101af940eSVladimir Oltean bool untagged, struct netlink_ext_ack *extack);
10625e256365SVladimir Oltean int ocelot_vlan_add(struct ocelot *ocelot, int port, u16 vid, bool pvid,
10635e256365SVladimir Oltean bool untagged);
10645e256365SVladimir Oltean int ocelot_vlan_del(struct ocelot *ocelot, int port, u16 vid);
1065f145922dSYangbo Lu int ocelot_hwstamp_get(struct ocelot *ocelot, int port, struct ifreq *ifr);
1066f145922dSYangbo Lu int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr);
1067682eaad9SYangbo Lu int ocelot_port_txtstamp_request(struct ocelot *ocelot, int port,
1068682eaad9SYangbo Lu struct sk_buff *skb,
1069682eaad9SYangbo Lu struct sk_buff **clone);
1070e23a7b3eSYangbo Lu void ocelot_get_txtstamp(struct ocelot *ocelot);
10710b912fc9SVladimir Oltean void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu);
10720b912fc9SVladimir Oltean int ocelot_get_max_mtu(struct ocelot *ocelot, int port);
1073fc411eaaSVladimir Oltean int ocelot_port_policer_add(struct ocelot *ocelot, int port,
1074fc411eaaSVladimir Oltean struct ocelot_policer *pol);
1075fc411eaaSVladimir Oltean int ocelot_port_policer_del(struct ocelot *ocelot, int port);
1076ccb6ed42SVladimir Oltean int ocelot_port_mirror_add(struct ocelot *ocelot, int from, int to,
1077ccb6ed42SVladimir Oltean bool ingress, struct netlink_ext_ack *extack);
1078ccb6ed42SVladimir Oltean void ocelot_port_mirror_del(struct ocelot *ocelot, int from, bool ingress);
107907d985eeSVladimir Oltean int ocelot_cls_flower_replace(struct ocelot *ocelot, int port,
108007d985eeSVladimir Oltean struct flow_cls_offload *f, bool ingress);
108107d985eeSVladimir Oltean int ocelot_cls_flower_destroy(struct ocelot *ocelot, int port,
108207d985eeSVladimir Oltean struct flow_cls_offload *f, bool ingress);
108307d985eeSVladimir Oltean int ocelot_cls_flower_stats(struct ocelot *ocelot, int port,
108407d985eeSVladimir Oltean struct flow_cls_offload *f, bool ingress);
1085209edf95SVladimir Oltean int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
108654c31984SVladimir Oltean const struct switchdev_obj_port_mdb *mdb,
108754c31984SVladimir Oltean const struct net_device *bridge);
1088209edf95SVladimir Oltean int ocelot_port_mdb_del(struct ocelot *ocelot, int port,
108954c31984SVladimir Oltean const struct switchdev_obj_port_mdb *mdb,
109054c31984SVladimir Oltean const struct net_device *bridge);
10918fe6832eSVladimir Oltean int ocelot_port_lag_join(struct ocelot *ocelot, int port,
10928fe6832eSVladimir Oltean struct net_device *bond,
10932e359b00SVladimir Oltean struct netdev_lag_upper_info *info,
10942e359b00SVladimir Oltean struct netlink_ext_ack *extack);
10958fe6832eSVladimir Oltean void ocelot_port_lag_leave(struct ocelot *ocelot, int port,
10968fe6832eSVladimir Oltean struct net_device *bond);
10978fe6832eSVladimir Oltean void ocelot_port_lag_change(struct ocelot *ocelot, int port, bool lag_tx_active);
1098eca70102SVladimir Oltean int ocelot_bond_get_id(struct ocelot *ocelot, struct net_device *bond);
10995e256365SVladimir Oltean
1100f59fd9caSVladimir Oltean int ocelot_devlink_sb_register(struct ocelot *ocelot);
1101f59fd9caSVladimir Oltean void ocelot_devlink_sb_unregister(struct ocelot *ocelot);
1102f59fd9caSVladimir Oltean int ocelot_sb_pool_get(struct ocelot *ocelot, unsigned int sb_index,
1103f59fd9caSVladimir Oltean u16 pool_index,
1104f59fd9caSVladimir Oltean struct devlink_sb_pool_info *pool_info);
1105f59fd9caSVladimir Oltean int ocelot_sb_pool_set(struct ocelot *ocelot, unsigned int sb_index,
1106f59fd9caSVladimir Oltean u16 pool_index, u32 size,
1107f59fd9caSVladimir Oltean enum devlink_sb_threshold_type threshold_type,
1108f59fd9caSVladimir Oltean struct netlink_ext_ack *extack);
1109f59fd9caSVladimir Oltean int ocelot_sb_port_pool_get(struct ocelot *ocelot, int port,
1110f59fd9caSVladimir Oltean unsigned int sb_index, u16 pool_index,
1111f59fd9caSVladimir Oltean u32 *p_threshold);
1112f59fd9caSVladimir Oltean int ocelot_sb_port_pool_set(struct ocelot *ocelot, int port,
1113f59fd9caSVladimir Oltean unsigned int sb_index, u16 pool_index,
1114f59fd9caSVladimir Oltean u32 threshold, struct netlink_ext_ack *extack);
1115f59fd9caSVladimir Oltean int ocelot_sb_tc_pool_bind_get(struct ocelot *ocelot, int port,
1116f59fd9caSVladimir Oltean unsigned int sb_index, u16 tc_index,
1117f59fd9caSVladimir Oltean enum devlink_sb_pool_type pool_type,
1118f59fd9caSVladimir Oltean u16 *p_pool_index, u32 *p_threshold);
1119f59fd9caSVladimir Oltean int ocelot_sb_tc_pool_bind_set(struct ocelot *ocelot, int port,
1120f59fd9caSVladimir Oltean unsigned int sb_index, u16 tc_index,
1121f59fd9caSVladimir Oltean enum devlink_sb_pool_type pool_type,
1122f59fd9caSVladimir Oltean u16 pool_index, u32 threshold,
1123f59fd9caSVladimir Oltean struct netlink_ext_ack *extack);
1124f59fd9caSVladimir Oltean int ocelot_sb_occ_snapshot(struct ocelot *ocelot, unsigned int sb_index);
1125f59fd9caSVladimir Oltean int ocelot_sb_occ_max_clear(struct ocelot *ocelot, unsigned int sb_index);
1126f59fd9caSVladimir Oltean int ocelot_sb_occ_port_pool_get(struct ocelot *ocelot, int port,
1127f59fd9caSVladimir Oltean unsigned int sb_index, u16 pool_index,
1128f59fd9caSVladimir Oltean u32 *p_cur, u32 *p_max);
1129f59fd9caSVladimir Oltean int ocelot_sb_occ_tc_port_bind_get(struct ocelot *ocelot, int port,
1130f59fd9caSVladimir Oltean unsigned int sb_index, u16 tc_index,
1131f59fd9caSVladimir Oltean enum devlink_sb_pool_type pool_type,
1132f59fd9caSVladimir Oltean u32 *p_cur, u32 *p_max);
1133f59fd9caSVladimir Oltean
1134dfca93edSColin Foster int ocelot_port_configure_serdes(struct ocelot *ocelot, int port,
1135dfca93edSColin Foster struct device_node *portnp);
1136dfca93edSColin Foster
113769f7f89cSColin Foster void ocelot_phylink_mac_config(struct ocelot *ocelot, int port,
113869f7f89cSColin Foster unsigned int link_an_mode,
113969f7f89cSColin Foster const struct phylink_link_state *state);
1140e6e12df6SVladimir Oltean void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port,
1141e6e12df6SVladimir Oltean unsigned int link_an_mode,
1142e6e12df6SVladimir Oltean phy_interface_t interface,
1143e6e12df6SVladimir Oltean unsigned long quirks);
1144e6e12df6SVladimir Oltean void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port,
1145e6e12df6SVladimir Oltean struct phy_device *phydev,
1146e6e12df6SVladimir Oltean unsigned int link_an_mode,
1147e6e12df6SVladimir Oltean phy_interface_t interface,
1148e6e12df6SVladimir Oltean int speed, int duplex,
1149e6e12df6SVladimir Oltean bool tx_pause, bool rx_pause,
1150e6e12df6SVladimir Oltean unsigned long quirks);
1151e6e12df6SVladimir Oltean
11520568c3bfSXiaoliang Yang int ocelot_mact_lookup(struct ocelot *ocelot, int *dst_idx,
11530568c3bfSXiaoliang Yang const unsigned char mac[ETH_ALEN],
11540568c3bfSXiaoliang Yang unsigned int vid, enum macaccess_entry_type *type);
11550568c3bfSXiaoliang Yang int ocelot_mact_learn_streamdata(struct ocelot *ocelot, int dst_idx,
11560568c3bfSXiaoliang Yang const unsigned char mac[ETH_ALEN],
11570568c3bfSXiaoliang Yang unsigned int vid,
11580568c3bfSXiaoliang Yang enum macaccess_entry_type type,
11590568c3bfSXiaoliang Yang int sfid, int ssid);
11600568c3bfSXiaoliang Yang
116128de0f9fSVladimir Oltean int ocelot_migrate_mdbs(struct ocelot *ocelot, unsigned long from_mask,
116228de0f9fSVladimir Oltean unsigned long to_mask);
116328de0f9fSVladimir Oltean
116477043c37SXiaoliang Yang int ocelot_vcap_policer_add(struct ocelot *ocelot, u32 pol_ix,
116577043c37SXiaoliang Yang struct ocelot_policer *pol);
116677043c37SXiaoliang Yang int ocelot_vcap_policer_del(struct ocelot *ocelot, u32 pol_ix);
116777043c37SXiaoliang Yang
116815f93f46SVladimir Oltean void ocelot_mm_irq(struct ocelot *ocelot);
11696505b680SVladimir Oltean int ocelot_port_set_mm(struct ocelot *ocelot, int port,
11706505b680SVladimir Oltean struct ethtool_mm_cfg *cfg,
11716505b680SVladimir Oltean struct netlink_ext_ack *extack);
11726505b680SVladimir Oltean int ocelot_port_get_mm(struct ocelot *ocelot, int port,
11736505b680SVladimir Oltean struct ethtool_mm_state *state);
1174aac80140SVladimir Oltean int ocelot_port_mqprio(struct ocelot *ocelot, int port,
1175aac80140SVladimir Oltean struct tc_mqprio_qopt_offload *mqprio);
11766505b680SVladimir Oltean
1177d8ea7ff3SHoratiu Vultur #if IS_ENABLED(CONFIG_BRIDGE_MRP)
1178d8ea7ff3SHoratiu Vultur int ocelot_mrp_add(struct ocelot *ocelot, int port,
1179d8ea7ff3SHoratiu Vultur const struct switchdev_obj_mrp *mrp);
1180d8ea7ff3SHoratiu Vultur int ocelot_mrp_del(struct ocelot *ocelot, int port,
1181d8ea7ff3SHoratiu Vultur const struct switchdev_obj_mrp *mrp);
1182d8ea7ff3SHoratiu Vultur int ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port,
1183d8ea7ff3SHoratiu Vultur const struct switchdev_obj_ring_role_mrp *mrp);
1184d8ea7ff3SHoratiu Vultur int ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port,
1185d8ea7ff3SHoratiu Vultur const struct switchdev_obj_ring_role_mrp *mrp);
1186d8ea7ff3SHoratiu Vultur #else
ocelot_mrp_add(struct ocelot * ocelot,int port,const struct switchdev_obj_mrp * mrp)1187d8ea7ff3SHoratiu Vultur static inline int ocelot_mrp_add(struct ocelot *ocelot, int port,
1188d8ea7ff3SHoratiu Vultur const struct switchdev_obj_mrp *mrp)
1189d8ea7ff3SHoratiu Vultur {
1190d8ea7ff3SHoratiu Vultur return -EOPNOTSUPP;
1191d8ea7ff3SHoratiu Vultur }
1192d8ea7ff3SHoratiu Vultur
ocelot_mrp_del(struct ocelot * ocelot,int port,const struct switchdev_obj_mrp * mrp)1193d8ea7ff3SHoratiu Vultur static inline int ocelot_mrp_del(struct ocelot *ocelot, int port,
1194d8ea7ff3SHoratiu Vultur const struct switchdev_obj_mrp *mrp)
1195d8ea7ff3SHoratiu Vultur {
1196d8ea7ff3SHoratiu Vultur return -EOPNOTSUPP;
1197d8ea7ff3SHoratiu Vultur }
1198d8ea7ff3SHoratiu Vultur
1199d8ea7ff3SHoratiu Vultur static inline int
ocelot_mrp_add_ring_role(struct ocelot * ocelot,int port,const struct switchdev_obj_ring_role_mrp * mrp)1200d8ea7ff3SHoratiu Vultur ocelot_mrp_add_ring_role(struct ocelot *ocelot, int port,
1201d8ea7ff3SHoratiu Vultur const struct switchdev_obj_ring_role_mrp *mrp)
1202d8ea7ff3SHoratiu Vultur {
1203d8ea7ff3SHoratiu Vultur return -EOPNOTSUPP;
1204d8ea7ff3SHoratiu Vultur }
1205d8ea7ff3SHoratiu Vultur
1206d8ea7ff3SHoratiu Vultur static inline int
ocelot_mrp_del_ring_role(struct ocelot * ocelot,int port,const struct switchdev_obj_ring_role_mrp * mrp)1207d8ea7ff3SHoratiu Vultur ocelot_mrp_del_ring_role(struct ocelot *ocelot, int port,
1208d8ea7ff3SHoratiu Vultur const struct switchdev_obj_ring_role_mrp *mrp)
1209d8ea7ff3SHoratiu Vultur {
1210d8ea7ff3SHoratiu Vultur return -EOPNOTSUPP;
1211d8ea7ff3SHoratiu Vultur }
1212d8ea7ff3SHoratiu Vultur #endif
1213d8ea7ff3SHoratiu Vultur
1214fec53f44SColin Foster void ocelot_pll5_init(struct ocelot *ocelot);
1215fec53f44SColin Foster
12165e256365SVladimir Oltean #endif
1217