Lines Matching +full:gpio +full:- +full:wo +full:- +full:state

1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */
29 #define MLXSW_REG_LEN(type) MLXSW_REG(type)->len
30 #define MLXSW_REG_ZERO(type, payload) memset(payload, 0, MLXSW_REG(type)->len)
32 /* SGCR - Switch General Configuration Register
33 * --------------------------------------------
55 /* SPAD - Switch Physical Address Register
56 * ---------------------------------------
72 /* SSPR - Switch System Port Record Register
73 * -----------------------------------------
82 * Master - if set, then the record describes the master system port.
104 * Currently, only single-ASIC configurations are supported, so we default to
118 /* SFDAT - Switch Filtering Database Aging Time
119 * --------------------------------------------
136 * Min - 10 seconds
137 * Max - 1,000,000 seconds
150 /* SFD - Switch Filtering Database
151 * -------------------------------
183 /* Add/modify. Aged-out records cannot be added. This command removes
189 * the learning notification and aged-out notifications
190 * of the {MAC, VID/FID}. The response provides current (pre-removal)
191 * entries as non-aged-out.
309 * Valid only if local port is a non-stacking port. Must be 0 if multichannel
318 * 0 - Do not update VID.
319 * 1 - Set VID.
320 * For Spectrum-2 when set_vid=0 and smpe_valid=1, the smpe will modify the vid.
330 * For SwitchX and SwitchX-2:
331 * - Dynamic entries (policy 2,3) use FID
332 * - Static entries (policy 0) use VID
333 * - When independent learning is configured, VID=FID
398 * 0 - Do not update VID.
399 * 1 - Set VID.
400 * For Spectrum-2 when set_vid=0 and smpe_valid=1, the smpe will modify the vid.
410 * For SwitchX and SwitchX-2:
411 * - Dynamic entries (policy 2,3) use FID
412 * - Static entries (policy 0) use VID
413 * - When independent learning is configured, VID=FID
431 * LAG Identifier - pointer into the LAG descriptor table.
457 * Multicast port group index - index into the port group table.
475 * Multicast identifier - global identifier that represents the multicast
580 /* SFN - Switch FDB Notification Register
581 * -------------------------------------------
607 * Request: Number of learned notifications and aged-out notification
636 /* Aged-out MAC address on a regular port. */
638 /* Aged-out MAC address on a LAG port. */
642 /* Aged-out unicast tunnel record. */
760 /* SPMS - Switch Port MSTP/RSTP State Register
761 * -------------------------------------------
762 * Configures the spanning tree state of a physical port.
783 * Spanning tree state of each VLAN ID (VID) of the local port.
784 * 0 - Do not change spanning tree state (used only when writing).
785 * 1 - Discarding. No learning or forwarding to/from this port (default).
786 * 2 - Learning. Port is learning, but not forwarding.
787 * 3 - Forwarding. Port is learning and forwarding.
790 MLXSW_ITEM_BIT_ARRAY(reg, spms, state, 0x04, 0x400, 2);
799 enum mlxsw_reg_spms_state state) in mlxsw_reg_spms_vid_pack() argument
801 mlxsw_reg_spms_state_set(payload, vid, state); in mlxsw_reg_spms_vid_pack()
804 /* SPVID - Switch Port VID
805 * -----------------------
815 * Reserved when SwitchX/-2 or Spectrum-1.
837 * Reserved when Spectrum-1.
845 * 0: ether_type0 - (default)
847 * 2: ether_type2 - Reserved when Spectrum-1, supported by Spectrum-2
869 /* SPVM - Switch Port VLAN Membership
870 * ----------------------------------
895 * Access: WO
935 * Untagged - port is an untagged member - egress transmission uses untagged
955 int size = vid_end - vid_begin + 1; in mlxsw_reg_spvm_pack()
970 /* SPAFT - Switch Port Acceptable Frame Types
971 * ------------------------------------------
1023 /* SFGC - Switch Flooding Group Configuration
1024 * ------------------------------------------
1060 * Note: SwitchX-2 only supports 802.1Q mode.
1076 * Note: FID offset and FID types are not supported in SwitchX-2.
1121 /* SFDF - Switch Filtering DB Flush
1122 * --------------------------------
1150 * 0 - All SWID dynamic entries are flushed.
1151 * 1 - All FID dynamic entries are flushed.
1152 * 2 - All dynamic entries pointing to port are flushed.
1153 * 3 - All FID dynamic entries pointing to port are flushed.
1154 * 4 - All dynamic entries pointing to LAG are flushed.
1155 * 5 - All FID dynamic entries pointing to LAG are flushed.
1156 * 6 - All entries of type "Unicast Tunnel" or "Multicast Tunnel" are
1158 * 7 - All entries of type "Unicast Tunnel" or "Multicast Tunnel" are
1166 * 0 - Flush only dynamic entries.
1167 * 1 - Flush both dynamic and static entries.
1210 /* SLDR - Switch LAG Descriptor Register
1211 * -----------------------------------------
1214 * max_lag-1.
1222 /* Indicates a creation of a new LAG-ID, lag_id must be valid */
1260 * For Add / Remove operations - indicates the number of ports in the list.
1291 /* SLCR - Switch LAG Configuration 2 Register
1292 * -------------------------------------------
1338 /* SMAC - for IPv4 and IPv6 packets */
1340 /* SMAC - for non-IP packets */
1345 /* DMAC - for IPv4 and IPv6 packets */
1347 /* DMAC - for non-IP packets */
1352 /* Ethertype - for IPv4 and IPv6 packets */
1354 /* Ethertype - for non-IP packets */
1359 /* VLAN ID - for IPv4 and IPv6 packets */
1361 /* VLAN ID - for non-IP packets */
1378 /* SID - FCoE source ID */
1380 /* DID - FCoE destination ID */
1382 /* OXID - FCoE originator exchange ID */
1384 /* Destination QP number - for RoCE packets */
1411 /* SLCOR - Switch LAG Collector Register
1412 * -------------------------------------
1450 * Valid range is from 0 to cap_max_lag_members-1
1495 /* SPMLR - Switch Port MAC Learning Register
1496 * -----------------------------------------
1525 * 0 - Learning disabled.
1526 * 2 - Learning enabled.
1527 * 3 - Security mode.
1545 /* SVFA - Switch VID to FID Allocation Register
1546 * --------------------------------------------
1577 * 0 - VID to FID
1578 * 1 - {Port, VID} to FID
1581 * Note: Reserved for SwitchX-2.
1590 * Note: Reserved for SwitchX-2.
1610 * Note: Reserved for SwitchX-2.
1618 * Note: Reserved for SwitchX-2.
1632 * 0 - Ingress RIF is not valid, no ingress RIF assigned.
1633 * 1 - Ingress RIF valid.
1643 * Range is 0..cap_max_router_interfaces-1.
1692 /* SPVTR - Switch Port VLAN Stacking Register
1693 * ------------------------------------------
1706 * Note: Reserved when SwitchX/-2 or Spectrum-1.
1745 * Note: for SwitchX/-2 the DEI is not affected.
1747 * 1: use C-VLAN PCP and DEI.
1764 * Ingress Port VLAN-ID Mode.
1778 * Egress Port VLAN-ID Mode.
1780 * Access: WO
1795 /* SVPE - Switch Virtual-Port Enabling Register
1796 * --------------------------------------------
1814 * 0 - Disable, VLAN mode (VID to FID).
1815 * 1 - Enable, Virtual port mode ({Port, VID} to FID).
1828 /* SFMR - Switch FID Management Register
1829 * -------------------------------------
1844 * 0 - Create or edit FID.
1845 * 1 - Destroy FID.
1846 * Access: WO
1857 * Router sub-port flooding table.
1858 * 0 - Regular flooding table.
1859 * 1 - Router sub-port flooding table. For this FID the flooding is per
1860 * router-sub-port local_port. Must not be set for a FID which is not a
1861 * router-sub-port and must be set prior to enabling the relevant RIF.
1870 * 0 - type_0.
1871 * 1 - type_1.
1881 * the table is of type FID-Offset. Otherwise, this field is reserved.
1915 * FID. When unified bridge model is used, it configures only the FID->VNI,
1916 * the VNI->FID is done by SVFA.
1923 * 0 - Ingress RIF is not valid, no ingress RIF assigned.
1924 * 1 - Ingress RIF valid.
1934 * Range is 0..cap_max_router_interfaces-1.
1946 * Spectrum-1.
1952 * Range is 0..cap_max_rmpe-1
1956 * Spectrum-1.
1978 /* SPVMLR - Switch Port VLAN MAC Learning Register
1979 * -----------------------------------------------
2007 * 0 - Disable learning for {Port, VID}.
2008 * 1 - Enable learning for {Port, VID}.
2025 int num_rec = vid_end - vid_begin + 1; in mlxsw_reg_spvmlr_pack()
2040 /* SPFSR - Switch Port FDB Security Register
2041 * -----------------------------------------
2073 /* SPVC - Switch Port VLAN Classification Register
2074 * -----------------------------------------------
2171 /* SPEVET - Switch Port Egress VLAN EtherType
2172 * ------------------------------------------
2191 * 0: ether_type0 - (default)
2206 /* SMPE - Switch Multicast Port to Egress VID
2207 * ------------------------------------------
2209 * {egress_port, SMPE index} -> {VID}.
2225 * Range is 0..cap_max_rmpe-1.
2245 /* SMID-V2 - Switch Multicast ID Version 2 Register
2246 * ------------------------------------------------
2263 * Multicast identifier - global identifier that represents the multicast group
2274 * Note: Reserved when legacy bridge model is used and on Spectrum-2.
2282 * Note: Reserved when legacy bridge model is used and on Spectrum-2.
2294 * Access: WO
2310 /* CWTP - Congetion WRED ECN TClass Profile
2311 * ----------------------------------------
2377 #define MLXSW_REG_CWTP_PROFILE_TO_INDEX(profile) (profile - 1)
2390 /* CWTPM - Congestion WRED ECN TClass and Pool Mapping
2391 * ---------------------------------------------------
2414 * 0 - Disable
2415 * 1 - Enable
2422 * 0 - Disable
2423 * 1 - Enable
2453 * Non-TCP Green Profile.
2461 * Non-TCP Yellow Profile.
2469 * Non-TCP Red Profile.
2495 /* PGCR - Policy-Engine General Configuration Register
2496 * ---------------------------------------------------
2497 * This register configures general Policy-Engine settings.
2517 /* PPBT - Policy-Engine Port Binding Table
2518 * ---------------------------------------
2553 * group - When set, the binding is of an ACL group. When cleared,
2579 /* PACL - Policy-Engine ACL Register
2580 * ---------------------------------
2597 * Range 0 .. cap_max_acl_regions - 1
2621 /* PAGT - Policy-Engine ACL Group Table
2622 * ------------------------------------
2646 * An identifier (numbered from 0..cap_max_acl_groups-1) representing
2653 * Multi-ACL
2654 * 0 - This ACL is the last ACL in the multi-ACL
2655 * 1 - This ACL is part of a multi-ACL
2683 /* PTAR - Policy-Engine TCAM Allocation Register
2684 * ---------------------------------------------
2715 * For Spectrum and Spectrum-2, this is always type 2 - "flexible"
2716 * Access: WO
2722 MLXSW_REG_PTAR_KEY_TYPE_FLEX2 = 0x51, /* Spectrum-2 */
2727 * Access: WO
2735 * Allowed range 1 .. cap_max_rules-1
2737 * Access: WO
2743 * Range 0 .. cap_max_regions-1
2763 * Access: WO
2793 /* PPRR - Policy-Engine Port Range Register
2794 * ----------------------------------------
2840 * Range is 0..cap_max_acl_l4_port_range-1.
2865 /* PPBS - Policy-Engine Policy Based Switching Register
2866 * ----------------------------------------------------
2895 /* PRCR - Policy-Engine Rules Copy Register
2896 * ----------------------------------------
2930 * Access: WO
2971 /* PEFA - Policy-Engine Extended Flexible Action Register
2972 * ------------------------------------------------------
3007 * Action-set to perform when rule is matched.
3029 /* PEMRBT - Policy-Engine Multicast Router Binding Table Register
3030 * --------------------------------------------------------------
3033 * This register is not supported by SwitchX/-2 and Spectrum.
3052 * Range 0..cap_max_acl_groups-1
3066 /* PTCE-V2 - Policy-Engine TCAM Entry Register Version 2
3067 * -----------------------------------------------------
3071 * by SwitchX and SwitchX-2.
3100 * for new entries - Note write with v = 0 will delete the entry.
3120 * Priority of the rule, higher values win. The range is 1..cap_kvd_size-1.
3123 * between regions in a multi-region).
3145 * mask- in the same size as key. A bit that is set directs the TCAM
3173 /* PERPT - Policy-Engine ERP Table Register
3174 * ----------------------------------------
3184 * Range 0 .. cap_max_erp_table_banks - 1
3191 * Range is 0 .. cap_max_erp_table_bank_size - 1
3209 * 0 - The eRP is used only if bloom filter state is set for the given
3211 * 1 - The eRP is used regardless of bloom filter state.
3225 * Range is 0 .. cap_max_erp_table_banks - 1
3232 * Range is 0 .. cap_max_erp_table_bank_size - 1
3251 * 0 - A-TCAM will ignore the bit in key
3252 * 1 - A-TCAM will compare the bit in key
3285 /* PERAR - Policy-Engine Region Association Register
3286 * -------------------------------------------------
3297 * Range 0 .. cap_max_regions-1
3310 * Range 0 .. cap_max_regions-1
3326 /* PTCE-V3 - Policy-Engine TCAM Entry Register Version 3
3327 * -----------------------------------------------------
3328 * This register is a new version of PTCE-V2 in order to support the
3329 * A-TCAM. This register is not supported by SwitchX/-2 and Spectrum.
3362 * For Spectrum-2 range is 1..cap_kvd_size - 1
3391 * num_key_blocks * 36 - 8. Reserved when delta_mask = 0.
3398 * 0 - Ignore relevant bit in delta_value
3399 * 1 - Compare relevant bit in delta_value
3417 * 0 - NEED: Do a lookup using the eRP.
3418 * 1 - PRUNE: Do not perform a lookup using the eRP.
3420 * Note: In Spectrum-2, a region of 8 key blocks must be set to either
3427 * Pruning on C-TCAM. Used for reducing lookups.
3428 * 0 - NEED: Do a lookup in the C-TCAM.
3429 * 1 - PRUNE: Do not perform a lookup in the C-TCAM.
3437 * 0 - SINGLE: The large_entry_key_id is not currently in use.
3440 * 1 - NON_SINGLE: The large_entry_key_id is currently in use.
3443 * Access: WO
3452 * Range is 0..cap_max_pe_large_key_id - 1
3459 * Range is 0..cap_max_kvd_action_sets - 1
3488 /* PERCR - Policy-Engine Region Configuration Register
3489 * ---------------------------------------------------
3500 * Range 0..cap_max_regions-1
3506 * Ignore prune_vector by other A-TCAM rules. Used e.g., for a new rule.
3512 * Ignore prune_ctcam by other A-TCAM rules. Used e.g., for a new rule.
3519 * 0 - Bloom filter is used (default)
3520 * 1 - Bloom filter is bypassed. The bypass is an OR condition of
3528 * (both A-TCAM and C-TCAM). When there are no eRPs
3543 /* PERERP - Policy-Engine Region eRP Register
3544 * ------------------------------------------
3555 * Range 0..cap_max_regions-1
3561 * C-TCAM lookup enable. Reserved when erpt_pointer_valid = 0.
3574 * Range 0..cap_max_erp_table_banks-1
3582 * Range 0..cap_max_erp_table_size-1
3629 /* PEABFE - Policy-Engine Algorithmic Bloom Filter Entries Register
3630 * ----------------------------------------------------------------
3651 * Bloom filter state
3652 * 0 - Clear
3653 * 1 - Set
3662 * Range 0..cap_max_erp_table_banks-1
3671 * Range 0..2^cap_max_bf_log-1
3684 u8 state, u8 bank, u32 bf_index) in mlxsw_reg_peabfe_rec_pack() argument
3690 mlxsw_reg_peabfe_bf_entry_state_set(payload, rec_index, state); in mlxsw_reg_peabfe_rec_pack()
3695 /* IEDR - Infrastructure Entry Delete Register
3696 * ----------------------------------------------------
3756 /* QPTS - QoS Priority Trust State Register
3757 * ----------------------------------------
3780 * Trust state for a given port.
3794 /* QPCR - QoS Policer Configuration Register
3795 * -----------------------------------------
3796 * The QPCR register is used to create policers - that limit
3836 * 0 - packets
3837 * 1 - bytes
3849 * 1 - 10^3
3850 * 0 - 10^6
3960 /* QTCT - QoS Switch Traffic Class Table
3961 * -------------------------------------
4010 /* QEEC - QoS ETS Element Configuration Register
4011 * ---------------------------------------------
4035 * 0 - Port
4036 * 1 - Group
4037 * 2 - Subgroup
4038 * 3 - Traffic Class
4060 * 0 - Disable
4061 * 1 - Enable
4073 * Supported only on Spectrum-1
4085 * 0 - Bytes mode
4086 * 1 - Packets mode
4108 * 0 - Disable
4109 * 1 - Enable
4115 #define MLXSW_REG_QEEC_MAS_DIS ((1u << 31) - 1) /* Kbps */
4128 * 0 - Disable
4129 * 1 - Enable
4137 * 0 - Strict priority
4138 * 1 - DWRR
4156 * For Spectrum-1: Range is: 5..25
4157 * For Spectrum-2: Range is: 11..25
4189 /* QRWE - QoS ReWrite Enable
4190 * -------------------------
4227 /* QPDSM - QoS Priority to DSCP Mapping
4228 * ------------------------------------
4249 * Access: WO
4266 * Access: WO
4283 * Access: WO
4315 /* QPDP - QoS Port DSCP to Priority Mapping Register
4316 * -------------------------------------------------
4318 * default Switch Priority and Color are used for frames where the trust state
4347 /* QPDPM - QoS Port DSCP to Priority Mapping Register
4348 * --------------------------------------------------
4372 * Access: WO
4398 /* QTCTM - QoS Switch Traffic Class Table is Multicast-Aware Register
4399 * ------------------------------------------------------------------
4434 /* QPSC - QoS PTP Shaper Configuration Register
4435 * --------------------------------------------
4437 * Supported only on Spectrum-1.
4458 * The base-time-interval for updating the shapers tokens (for all hierarchies).
4466 * The base-time-interval for updating the shapers tokens (for all hierarchies).
4490 * Access: WO
4496 * For non-split ports: range 1..112
4540 /* PMLP - Ports Module to Local Port Register
4541 * ------------------------------------------
4550 * 0 - Tx value is used for both Tx and Rx.
4551 * 1 - Rx value is taken from a separte field.
4563 * 0 - Unmap local port.
4564 * 1 - Lane 0 is used.
4565 * 2 - Lanes 0 and 1 are used.
4566 * 4 - Lanes 0, 1, 2 and 3 are used.
4567 * 8 - Lanes 0-7 are used.
4582 * In case of non-modular system only slot_index = 0 is available.
4606 /* PMTU - Port MTU Register
4607 * ------------------------
4657 /* PTYS - Port Type and Speed Register
4658 * -----------------------------------
4662 * until the port transitions from down to up state.
4671 * 0 - Device doesn't support AN disable.
4672 * 1 - Device supports AN disable.
4688 * 0 - Infiniband.
4689 * 1 - Fibre Channel.
4690 * 2 - Ethernet.
4853 /* PPAD - Port Physical Address Register
4854 * -------------------------------------
4865 * 1: single_mac - mac of the local_port
4877 * If single_base_mac = 0 - base MAC address, mac[7:0] is reserved.
4878 * If single_base_mac = 1 - the per port MAC address
4891 /* PAOS - Ports Administrative and Operational Status Register
4892 * -----------------------------------------------------------
4916 * Port administrative state (the desired state of the port):
4917 * 1 - Up.
4918 * 2 - Down.
4919 * 3 - Up once. This means that in case of link failure, the port won't go
4920 * into polling mode, but will wait to be re-enabled by software.
4921 * 4 - Disabled by system. Can only be set by hardware.
4927 * Port operational state (the current state):
4928 * 1 - Up.
4929 * 2 - Down.
4930 * 3 - Down by port failure. This means that the device will not let the
4937 * Admin state update enabled.
4938 * Access: WO
4945 * Access: WO
4950 * Event generation on operational state change:
4951 * 0 - Do not generate event.
4952 * 1 - Generate Event.
4953 * 2 - Generate Single Event.
4971 /* PFCC - Ports Flow Control Configuration Register
4972 * ------------------------------------------------
4988 * 0 - Local port number.
4989 * 1 - IB / label port number.
4996 * 0 - No capability of sending Pause and PFC frames to higher layers.
4997 * 1 - Device has capability of sending Pause and PFC frames to higher
5005 * 0 - Pause and PFC frames are handled by the port (default).
5006 * 1 - Pause and PFC frames are handled by the port and also sent to
5014 * 0 - Disabled. Generate / ignore Pause frames based on pptx / pprtx.
5015 * 1 - Enabled. When auto-negotiation is performed, set the Pause policy
5016 * based on the auto-negotiation resolution.
5019 * Note: The auto-negotiation advertisement is set according to pptx and
5027 * Access: WO
5034 * Access: WO
5040 * 0 - Never generate Pause frames (default).
5041 * 1 - Generate Pause frames according to Rx buffer threshold.
5048 * 0 - Never generate Pause frames.
5049 * 1 - Generate Pause frames according to Rx buffer threshold.
5055 * Priority based flow control policy on Tx[7:0]. Per-priority bit mask:
5056 * 0 - Never generate priority Pause frames on the specified priority
5058 * 1 - Generate priority Pause frames according to Rx buffer threshold on
5068 * 0 - Ignore received Pause frames (default).
5069 * 1 - Respect received Pause frames.
5076 * 0 - Ignore received Pause frames.
5077 * 1 - Respect received Pause frames.
5083 * Priority based flow control policy on Rx[7:0]. Per-priority bit mask:
5084 * 0 - Ignore incoming priority Pause frames on the specified priority
5086 * 1 - Respect incoming priority Pause frames on the specified priority.
5107 /* PPCNT - Ports Performance Counters Register
5108 * -------------------------------------------
5136 * 0 - Local port number
5137 * 1 - IB port number
5190 * Priority for counter set that support per priority, valid values: 0-7.
5192 * valid values: 0- cap_max_tclass-1 .
5626 /* PPTB - Port Prio To Buffer Register
5627 * -----------------------------------
5643 * 0 - Map both unicast and multicast packets to the same buffer.
5644 * 1 - Map only unicast packets.
5645 * 2 - Map only multicast packets.
5648 * Note: SwitchX-2 only supports the first option.
5689 * Note: In SwitchX-2 this field must be mapped to buffer 8. Reserved for
5719 /* PBMC - Port Buffer Management Control Register
5720 * ----------------------------------------------
5737 * timer (time for the peer port to pause in quota-512 bit time).
5744 * state. Using the same units as xoff_timer_value above (in quota-512 bit
5754 * 0 - Lossless
5755 * 1 - Lossy
5829 /* PSPA - Port Switch Partition Allocation
5830 * ---------------------------------------
5866 /* PMAOS - Ports Module Administrative and Operational Status
5867 * ----------------------------------------------------------
5877 * Note: Setting reset while module is plugged-in will result in transition to
5878 * "initializing" operational state.
5906 * Module administrative state (the desired state of the module).
5914 * Admin state update enable.
5915 * If this bit is set, admin state will be updated based on admin_state field.
5917 * Access: WO
5925 * Access: WO
5936 * Event Generation on operational state change.
5948 /* PPLR - Port Physical Loopback Register
5949 * --------------------------------------
5984 /* PMTDB - Port Module To local DataBase Register
5985 * ----------------------------------------------
5986 * The PMTDB register allows to query the possible module<->local port
6047 /* PMECR - Ports Mapping Event Configuration Register
6048 * --------------------------------------------------
6066 * Access: WO
6074 * Access: WO
6110 /* PMPE - Port Module Plug/Unplug Event Register
6111 * ---------------------------------------------
6113 * A change in the module’s state will generate an event only if the change
6114 * happens after arming the event mechanism. Any changes to the module state
6154 /* PDDR - Port Diagnostics Database Register
6155 * -----------------------------------------
6204 /* PMMP - Port Module Memory Map Properties Register
6205 * -------------------------------------------------
6227 * When set, will keep eeprom_override values after plug-out event.
6234 * 0 - Allow write
6235 * 1 - Ignore write
6238 * Access: WO
6260 /* PLLP - Port Local port to Label Port mapping Register
6261 * -----------------------------------------------------
6307 /* PMTM - Port Module Type Mapping Register
6308 * ----------------------------------------
6359 /* HTGT - Host Trap Group Table
6360 * ----------------------------
6418 MLXSW_REG_HTGT_TRAP_GROUP_MAX = __MLXSW_REG_HTGT_TRAP_GROUP_MAX - 1
6452 * 0 - Trap to CPU.
6453 * 1 - Trap to CPU and mirror to a mirroring agent.
6454 * 2 - Mirror to a mirroring agent and do not trap to CPU.
6474 * Supported values are 0-7, with 7 represnting the highest priority.
6477 * Note: In SwitchX-2 this field is ignored and the priority value is replaced
6525 /* HPKT - Host Packet Trap
6526 * -----------------------
6562 * 0 - No action. Forward to CPU based on switching rules.
6563 * 1 - Trap to CPU (CPU receives sole copy).
6564 * 2 - Mirror to CPU (CPU receives a replica of the packet).
6565 * 3 - Discard.
6566 * 4 - Soft discard (allow other traps to act on the packet).
6567 * 5 - Trap and soft discard (allow other traps to overwrite this trap).
6568 * 6 - Trap to CPU (CPU receives sole copy) and count it as error.
6569 * 15 - Restore the firmware's default action.
6600 * Ignored by SwitchX-2.
6601 * 0 - Keep factory defaults.
6602 * 1 - Do not use control buffer for this trap ID.
6603 * 2 - Use control buffer for this trap ID.
6622 /* RGCR - Router General Configuration Register
6623 * --------------------------------------------
6652 * 0 - Preserve the value of Switch Priority and packet color.
6653 * 1 - Recalculate the value of Switch Priority and packet color.
6656 * Note: Not supported by SwitchX and SwitchX-2.
6662 * 0 - Preserve the value of pcp_rewrite_en.
6663 * 2 - Disable PCP rewrite.
6664 * 3 - Enable PCP rewrite.
6667 * Note: Not supported by SwitchX and SwitchX-2.
6673 * 0 - Activity will be set when an entry is hit (default).
6674 * 1 - Activity will not be set when an entry is hit.
6676 * Bit 0 - Disable activity bit in Router Algorithmic LPM Unicast Entry
6678 * Bit 1 - Disable activity bit in Router Algorithmic LPM Unicast Host
6683 * Note: Not supported by SwitchX, SwitchX-2 and Switch-IB.
6695 /* RITR - Router Interface Table Register
6696 * --------------------------------------
6741 /* Sub-port interface. */
6760 * 0 - Create or edit RIF.
6761 * 1 - Delete RIF.
6762 * Reserved for SwitchX-2. For Spectrum, editing of interface properties
6763 * is not supported. An interface must be deleted and re-created in order
6765 * Access: WO
6779 * Not supported in SwitchX-2.
6788 * Not supported in SwitchX-2.
6810 * Loop-back filter enable for unicast packets.
6811 * If the flag is set then loop-back filter for unicast packets is
6813 * loop-back filtering.
6851 * Note: Reserved for RIF types other than VLAN, FID and Sub-port.
6858 * Note: Reserved for RIF types other than VLAN, FID and Sub-port.
6876 * Note: Reserved when legacy bridge model is used and on Spectrum-1.
6891 /* Sub-port Interface */
6909 * Used to connect the eRIF to a bridge if eRIF-ACL has modified the DMAC or
6930 /* IPinIP generic - used for Spectrum-2 underlay RIF */
6966 * Range is 0..cap_max_virtual_routers-1.
6967 * Reserved for Spectrum-2.
6998 * - Error and Discard counters.
6999 * - Unicast, Multicast and Broadcast counters. Sharing the
7150 /* RTAR - Router TCAM Allocation Register
7151 * --------------------------------------
7166 * Access: WO
7177 * Access: WO
7186 * Access: WO
7201 /* RATR - Router Adjacency Table Register
7202 * --------------------------------------
7203 * The RATR register is used to configure the Router Adjacency (next-hop)
7273 * Reserved for SwitchX/-2.
7277 * Reserved for SwitchX/-2.
7290 * For SwitchX and SwitchX-2, the adjacency table is linear and
7298 * Range is 0 .. cap_max_router_interfaces - 1
7330 * Trap-ID is RTR_EGRESS0 or RTR_EGRESS1.
7337 * MAC address of the destination next-hop.
7438 /* RDPM - Router DSCP to Priority Mapping
7439 * --------------------------------------
7448 MLXSW_REG_RDPM_LEN - \
7458 -MLXSW_REG_RDPM_DSCP_ENTRY_REC_LEN, 0x00, false);
7465 -MLXSW_REG_RDPM_DSCP_ENTRY_REC_LEN, 0x00, false);
7474 /* RICNT - Router Interface Counter Register
7475 * -----------------------------------------
7493 * - Error and Discard counters.
7494 * - Unicast, Multicast and Broadcast counters. Sharing the
7568 * A count of non-errored frames that do not pass the router checks.
7582 * for non-errored frames that do not pass the router checks.
7597 /* RRCR - Router Rules Copy Register Layout
7598 * ----------------------------------------
7614 * Access: WO
7626 * Access: WO
7656 /* RALTA - Router Algorithmic LPM Tree Allocation Register
7657 * -------------------------------------------------------
7667 * 0 - allocate a tree
7668 * 1 - deallocate a tree
7686 * An identifier (numbered from 1..cap_shspm_max_trees-1) representing
7688 * Note that tree_id 0 is allocated for a default-route tree.
7703 /* RALST - Router Algorithmic LPM Structure Tree Register
7704 * ------------------------------------------------------
7720 * For a default-route tree configure 0xff
7726 * Tree identifier numbered from 1..(cap_shspm_max_trees-1).
7738 * Note that tree_id 0 is allocated for a default-route tree, bins are 0xff
7746 * Note that tree_id 0 is allocated for a default-route tree, bins are 0xff
7768 int bin_index = bin_number - 1; in mlxsw_reg_ralst_bin_pack()
7775 /* RALTB - Router Algorithmic LPM Tree Binding Register
7776 * ----------------------------------------------------
7786 * Range is 0..cap_max_virtual_routers-1
7799 * Tree identifier numbered from 1..(cap_shspm_max_trees-1).
7815 /* RALUE - Router Algorithmic LPM Unicast Entry Register
7816 * -----------------------------------------------------
7875 * Range is 0..cap_max_virtual_routers-1
7887 * This field is valid for update opcode, otherwise - reserved.
7889 * Access: WO
7920 * Note - for Marker entries, the action_type and action fields are reserved.
7945 * on a remote subnet connected through a next-hop router,
7976 * Points to the first entry of the group-based ECMP.
7985 * The valid range is 1-64, 512, 1024, 2048 and 4096.
8095 /* RAUHT - Router Algorithmic LPM Unicast Host Table Register
8096 * ----------------------------------------------------------
8188 * Trap-ID is RTR_EGRESS0 or RTR_EGRESS1.
8248 /* RALEU - Router Algorithmic LPM ECMP Update Register
8249 * ---------------------------------------------------
8267 * Range is 0..cap_max_virtual_routers-1
8286 * Access: WO
8292 * Access: WO
8312 /* RAUHTD - Router Algorithmic LPM Unicast Host Table Dump Register
8313 * ----------------------------------------------------------------
8337 * Bit0 - filter by activity: entry_a
8338 * Bit3 - filter by entry rip: entry_rif
8377 * 0 - IPv4
8378 * 1 - IPv6
8403 * 0 - 1 valid entry
8404 * 1 - 2 valid entries
8405 * 2 - 3 valid entries
8406 * 3 - 4 valid entries
8415 * 0 - IPv4
8416 * 1 - IPv6
8486 /* RTDP - Routing Tunnel Decap Properties Register
8487 * -----------------------------------------------
8516 * Valid range is from 0 to cap_max_router_interfaces - 1
8565 * - A packet received as IPinIP (without GRE) will always pass.
8566 * - A packet received as IPinGREinIP without a key will not pass the check.
8567 * - A packet received as IPinGREinIP with a key will pass the check only if the
8641 /* RIPS - Router IP version Six Register
8642 * -------------------------------------
8672 /* RATRAD - Router Adjacency Table Activity Dump Register
8673 * ------------------------------------------------------
8697 * Spectrum-1: 32-64, 512, 1024, 2048, 4096
8698 * Spectrum-2/3: 32-128, 256, 512, 1024, 2048, 4096
8726 /* RIGR-V2 - Router Interface Group Register Version 2
8727 * ---------------------------------------------------
8765 * Range 0 .. max_mid - 1
8774 * Note that low-entries must be set if high-entries are set. For
8777 * Index can be from 0 to cap_mc_erif_list_entries-1
8784 * Valid range is from 0 to cap_max_router_interfaces - 1
8785 * Index can be from 0 to MLXSW_REG_RIGR2_MAX_ERIFS - 1
8808 /* RECR-V2 - Router ECMP Configuration Version 2 Register
8809 * ------------------------------------------------------
8817 * Per-port configuration
8943 /* RMFT-V2 - Router Multicast Forwarding Table Version 2 Register
8944 * --------------------------------------------------------------
8972 * entries - Note write with v (Valid) 0 will delete the entry.
8999 * Virtual Router ID. Range from 0..cap_max_virtual_routers-1
9053 * action-set pointed from here are as follows:
9114 /* REIV - Router Egress Interface to VID Register
9115 * ----------------------------------------------
9116 * The REIV register maps {eRIF, egress_port} -> VID.
9119 * (for unicast/multicast/port-base multicast), regardless of eRIF type and
9136 * Port page - elport_record[0] is 256*port_page.
9143 * Range is 0..cap_max_router_interfaces-1.
9150 * 0 - Do not update the entry.
9151 * 1 - Update the entry.
9172 /* MFCR - Management Fan Control Register
9173 * --------------------------------------
9232 /* MFSC - Management Fan Speed Control Register
9233 * --------------------------------------------
9262 /* MFSM - Management Fan Speed Measurement
9263 * ---------------------------------------
9290 /* MFSL - Management Fan Speed Limit Register
9291 * ------------------------------------------
9294 * defined for both under-speed and over-speed.
9338 /* FORE - Fan Out of Range Event Register
9339 * --------------------------------------
9367 /* MTCAP - Management Temperature Capabilities
9368 * -------------------------------------------
9384 /* MTMP - Management Temperature
9385 * -----------------------------
9405 * 64-127 of sensor_index are mapped to the SFP+/QSFP modules sequentially
9433 * Max Temperature Enable - enables measuring the max temperature on a sensor.
9439 * Max Temperature Reset - clears the value of the max temperature register.
9440 * Access: WO
9453 * 0 - Do not generate event
9454 * 1 - Generate event
9455 * 2 - Generate single event
9530 /* MTWE - Management Temperature Warning Event
9531 * -------------------------------------------
9547 /* MTBR - Management Temperature Bulk Register
9548 * -------------------------------------------
9568 * Base sensors index to access (0 - ASIC sensor, 1-63 - ambient sensors,
9569 * 64-127 are mapped to the SFP+/QSFP modules sequentially).
9628 /* MCIA - Management Cable Info Access
9629 * -----------------------------------
9740 /* This is used to access the optional upper pages (1-3) in the QSFP+
9741 * memory map. Page 1 is available on offset 256 through 383, page 2 -
9742 * on offset 384 through 511, page 3 - on offset 512 through 639.
9744 #define MLXSW_REG_MCIA_PAGE_GET(off) (((off) - \
9761 /* MPAT - Monitoring Port Analyzer Table
9762 * -------------------------------------
9798 * 0: CONFIGURED - QoS parameters (Switch Priority, and encapsulation
9800 * 1: MAINTAIN - QoS parameters (Switch Priority, Color) are the
9853 /* Remote SPAN - Ethernet VLAN
9854 * - - - - - - - - - - - - - -
9863 /* Encapsulated Remote SPAN - Ethernet L2
9864 * - - - - - - - - - - - - - - - - - - -
9889 /* Encapsulated Remote SPAN - Ethernet L3
9890 * - - - - - - - - - - - - - - - - - - -
9905 * Encapsulation header Time-to-Live/HopLimit.
9985 /* MPAR - Monitoring Port Analyzer Register
9986 * ----------------------------------------
10031 * Reserved when Spectrum-1.
10049 /* MGIR - Management General Information Register
10050 * ----------------------------------------------
10065 * When set, latency-TLV is supported.
10071 * When set, string-TLV is supported.
10115 /* MRSR - Management Reset and Shutdown Register
10116 * ---------------------------------------------
10127 * 0 - do nothing
10128 * 1 - software reset
10129 * Access: WO
10139 /* MLCR - Management LED Control Register
10140 * --------------------------------------
10158 * 0x0 - Will turn off the beacon.
10159 * 0xFFFF - Will turn on the beacon until explicitly turned off.
10180 /* MCION - Management Cable IO and Notifications Register
10181 * ------------------------------------------------------
10220 /* MTPPS - Management Pulse Per Second Register
10221 * --------------------------------------------
10258 * the external GPIO pin.
10277 /* MTUTC - Management UTC Register
10278 * -------------------------------
10302 * 10^9 HW clocks for 1 HW second. Range is from -50,000,000 to +50,000,000.
10303 * In Spectrum-2, the field is reversed, positive values mean to decrease the
10313 * Access: WO
10319 * Range 0..(10^9-1)
10321 * Reserved on Spectrum-1.
10322 * Access: WO
10329 * Range is from -32768 to +32767.
10331 * Reserved on Spectrum-1.
10332 * Access: WO
10348 /* MCQI - Management Component Query Information
10349 * ---------------------------------------------
10431 /* MCC - Management Component Control
10432 * ----------------------------------
10465 * Access: WO
10477 * Current FSM state
10486 * Access: WO
10513 /* MCDA - Management Component Data Access
10514 * ---------------------------------------
10564 /* MCAM - Management Capabilities Mask Register
10565 * --------------------------------------------
10604 * #0-#31 and so on, so the access to the bits is simpler using bit array per
10637 /* MPSC - Monitoring Packet Sampling Configuration Register
10638 * --------------------------------------------------------
10677 /* MGPC - Monitoring General Purpose Counter Set Register
10732 /* MPRS - Monitoring Parsing State Register
10733 * ----------------------------------------
10735 * policy-engine and routing.
10745 * rules, traps, hash, etc. Default is 96 bytes. Reserved when SwitchX-2.
10752 * Bit 0 - Enable parsing of NVE of types VxLAN, VxLAN-GPE, GENEVE and
10753 * NVGRE. Default is enabled. Reserved when SwitchX-2.
10775 /* MOGCR - Monitoring Global Configuration Register
10776 * ------------------------------------------------
10787 * Reserved when IB switches and when SwitchX/-2, Spectrum-2
10796 * Reserved when IB switches and when SwitchX/-2, Spectrum-2
10804 * Reserved when SwitchX/-2, Switch-IB/2, Spectrum-1 and Quantum.
10809 /* MPAGR - Monitoring Port Analyzer Global Register
10810 * ------------------------------------------------
10812 * Note: This register is not supported by current FW versions for Spectrum-1.
10862 /* MOMTE - Monitoring Mirror Trigger Enable Register
10863 * -------------------------------------------------
10911 /* MTPPPC - Time Precision Packet Port Configuration
10912 * -------------------------------------------------
10916 * Reserved when Spectrum-2.
10948 /* MTPPTR - Time Precision Packet Timestamping Reading
10949 * ---------------------------------------------------
10955 * Reserved when Spectrum-2.
11025 * For Spectrum-1 the PLL clock is 156.25Mhz and PLL clock time is 6.4nSec.
11057 /* MTPTPT - Monitoring Precision Time Protocol Trap Register
11058 * ---------------------------------------------------------
11080 * non-sufficient condition since need to enable also per port. See MTPPPC.
11095 /* MTPCPC - Monitoring Time Precision Correction Port Configuration Register
11096 * -------------------------------------------------------------------------
11105 * 0: config is global. When reading - the local_port is 1.
11127 * Bitwise vector of PTP message types to update correction-field at ingress.
11136 * Bitwise vector of PTP message types to update correction-field at egress.
11156 /* MFGD - Monitoring FW General Debug Register
11157 * -------------------------------------------
11165 * 0 - don't check FW fatal (default)
11166 * 1 - check FW fatal - enable MFDE trap
11172 * Access: WO
11176 /* MGPIR - Management General Peripheral Information Register
11177 * ----------------------------------------------------------
11257 /* MBCT - Management Binary Code Transfer Register
11258 * -----------------------------------------------
11275 * Access: WO
11288 * Access: WO
11294 * Access: WO
11301 * Access: WO
11312 /* Error - trying to erase INI while it being used. */
11333 * FSM state.
11342 * Access: WO
11378 /* MDDT - Management DownStream Device Tunneling Register
11379 * ------------------------------------------------------
11401 * Read size in D-Words.
11407 * Write size in D-Words.
11452 int len = reg->len + MLXSW_REG_MDDT_PRM_REGISTER_HEADER_LEN; in mlxsw_reg_mddt_pack()
11455 len = MLXSW_REG_MDDT_LEN - MLXSW_REG_MDDT_PAYLOAD_OFFSET; in mlxsw_reg_mddt_pack()
11461 mlxsw_reg_mddt_register_id_set(payload, reg->id); in mlxsw_reg_mddt_pack()
11467 /* MDDQ - Management DownStream Device Query Register
11468 * --------------------------------------------------
11536 * can be sent from the switch ASIC to the line-card CPLD over Shift-Register.
11561 * Major user-configured version number of the current INI file.
11568 * User-configured version number of the current INI file.
11640 * Sub-minor FW version number.
11691 /* MDDC - Management DownStream Device Control Register
11692 * ----------------------------------------------------
11727 /* MFDE - Monitoring FW Debug Register
11728 * -----------------------------------
11744 /* Unexpected state with possible systemic failure */
11746 /* Unexpected state without systemic failure */
11802 * EMAD - register id, MAD - attibute id
11814 * 0 - New event
11815 * 1 - Old event, occurred before MFGD activation.
11833 * 0 - New event
11834 * 1 - Old event, occurred before MFGD activation.
11845 /* reg_mfde_fw_assert_var0-4
11868 * 0 - New event
11869 * 1 - Old event, occurred before MFGD activation.
11888 * A generated one-to-one identifier which is specific per-assert.
11912 /* TNGCR - Tunneling NVE General Configuration Register
11913 * ----------------------------------------------------
11971 /* Flow label is static. In Spectrum this means '0'. Spectrum-2
12009 * Spectrum uses LAG hash (SLCRv2). Spectrum-2 uses ECMP hash (RECRv2).
12046 * Reserved when Spectrum-2. See TNPC.
12053 * Reserved when Spectrum-2.
12096 /* TNUMT - Tunneling NVE Underlay Multicast Table Register
12097 * -------------------------------------------------------
12179 /* TNQCR - Tunneling NVE QoS Configuration Register
12180 * ------------------------------------------------
12191 * 0 - Copy the DSCP from the overlay (inner) IP header to the underlay
12193 * 1 - Set the DSCP field as TNQDR.dscp
12204 /* TNQDR - Tunneling NVE QoS Default Register
12205 * ------------------------------------------
12233 /* TNEEM - Tunneling NVE Encapsulation ECN Mapping Register
12234 * --------------------------------------------------------
12263 /* TNDEM - Tunneling NVE Decapsulation ECN Mapping Register
12264 * --------------------------------------------------------
12294 * 0 - No trap due to decap ECN
12295 * 1 - Trap enable with trap_id
12319 /* TNPC - Tunnel Port Configuration Register
12320 * -----------------------------------------
12357 /* TIGCR - Tunneling IPinIP General Configuration Register
12358 * -------------------------------------------------------
12387 /* TIEEM - Tunneling IPinIP Encapsulation ECN Mapping Register
12388 * -----------------------------------------------------------
12417 /* TIDEM - Tunneling IPinIP Decapsulation ECN Mapping Register
12418 * -----------------------------------------------------------
12448 * 0 - No trap due to decap ECN
12449 * 1 - Trap enable with trap_id
12473 /* SBPR - Shared Buffer Pools Register
12474 * -----------------------------------
12543 /* SBCM - Shared Buffer Class Management Register
12544 * ----------------------------------------------
12546 * and configuration according to Port-PG, including the binding to pool
12563 * PG buffer - Port PG (dir=ingress) / traffic class (dir=egress)
12564 * For PG buffer: range is 0..cap_max_pg_buffers - 1
12565 * For traffic class: range is 0..cap_max_tclass - 1
12595 * When the pool associated to the port-pg/tclass is configured to
12597 * When the pool associated to the port-pg/tclass is configured to
12601 * i: (1/128)*2^(i-1), for i=1..14
12609 * Association of the port-priority to a pool.
12629 /* SBPM - Shared Buffer Port Management Register
12630 * ---------------------------------------------
12632 * and configuration according to Port-Pool, including the definition
12688 * When the pool associated to the port-pg/tclass is configured to
12690 * When the pool associated to the port-pg/tclass is configured to
12694 * i: (1/128)*2^(i-1), for i=1..14
12720 /* SBMM - Shared Buffer Multicast Management Register
12721 * --------------------------------------------------
12723 * and configuration for MC packets according to Switch-Priority, including
12744 * When the pool associated to the port-pg/tclass is configured to
12746 * When the pool associated to the port-pg/tclass is configured to
12750 * i: (1/128)*2^(i-1), for i=1..14
12757 * Association of the port-priority to a pool.
12772 /* SBSR - Shared Buffer Status Register
12773 * ------------------------------------
12775 * Port-Pool. Note that this register enables reading a large amount of data.
12822 * Range is 0..cap_max_pg_buffers - 1
12841 * Range is 0..cap_max_tclass - 1
12877 /* SBIB - Shared Buffer Internal Buffer Register
12878 * ---------------------------------------------
12899 * Allowed range is 0 to (cap_max_headroom_size - 1)
13076 if (reg_info->id == reg_id) in mlxsw_reg_id_str()
13077 return reg_info->name; in mlxsw_reg_id_str()
13082 /* PUDE - Port Up / Down Event
13083 * ---------------------------
13084 * Reports the operational state change of a port.
13101 * Port administrative state (the desired state).
13102 * 1 - Up.
13103 * 2 - Down.
13104 * 3 - Up once. This means that in case of link failure, the port won't go
13105 * into polling mode, but will wait to be re-enabled by software.
13106 * 4 - Disabled by system. Can only be set by hardware.
13112 * Port operatioanl state.
13113 * 1 - Up.
13114 * 2 - Down.
13115 * 3 - Down by port failure. This means that the device will not let the