aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/reg.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/reg.h94
1 files changed, 91 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 0c5237264e3e..bb77e2207804 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -1044,6 +1044,92 @@ static inline void mlxsw_reg_sftr_pack(char *payload,
1044 mlxsw_reg_sftr_port_mask_set(payload, port, 1); 1044 mlxsw_reg_sftr_port_mask_set(payload, port, 1);
1045} 1045}
1046 1046
1047/* SFDF - Switch Filtering DB Flush
1048 * --------------------------------
1049 * The switch filtering DB flush register is used to flush the FDB.
1050 * Note that FDB notifications are flushed as well.
1051 */
1052#define MLXSW_REG_SFDF_ID 0x2013
1053#define MLXSW_REG_SFDF_LEN 0x14
1054
1055static const struct mlxsw_reg_info mlxsw_reg_sfdf = {
1056 .id = MLXSW_REG_SFDF_ID,
1057 .len = MLXSW_REG_SFDF_LEN,
1058};
1059
1060/* reg_sfdf_swid
1061 * Switch partition ID.
1062 * Access: Index
1063 */
1064MLXSW_ITEM32(reg, sfdf, swid, 0x00, 24, 8);
1065
1066enum mlxsw_reg_sfdf_flush_type {
1067 MLXSW_REG_SFDF_FLUSH_PER_SWID,
1068 MLXSW_REG_SFDF_FLUSH_PER_FID,
1069 MLXSW_REG_SFDF_FLUSH_PER_PORT,
1070 MLXSW_REG_SFDF_FLUSH_PER_PORT_AND_FID,
1071 MLXSW_REG_SFDF_FLUSH_PER_LAG,
1072 MLXSW_REG_SFDF_FLUSH_PER_LAG_AND_FID,
1073};
1074
1075/* reg_sfdf_flush_type
1076 * Flush type.
1077 * 0 - All SWID dynamic entries are flushed.
1078 * 1 - All FID dynamic entries are flushed.
1079 * 2 - All dynamic entries pointing to port are flushed.
1080 * 3 - All FID dynamic entries pointing to port are flushed.
1081 * 4 - All dynamic entries pointing to LAG are flushed.
1082 * 5 - All FID dynamic entries pointing to LAG are flushed.
1083 * Access: RW
1084 */
1085MLXSW_ITEM32(reg, sfdf, flush_type, 0x04, 28, 4);
1086
1087/* reg_sfdf_flush_static
1088 * Static.
1089 * 0 - Flush only dynamic entries.
1090 * 1 - Flush both dynamic and static entries.
1091 * Access: RW
1092 */
1093MLXSW_ITEM32(reg, sfdf, flush_static, 0x04, 24, 1);
1094
1095static inline void mlxsw_reg_sfdf_pack(char *payload,
1096 enum mlxsw_reg_sfdf_flush_type type)
1097{
1098 MLXSW_REG_ZERO(sfdf, payload);
1099 mlxsw_reg_sfdf_flush_type_set(payload, type);
1100 mlxsw_reg_sfdf_flush_static_set(payload, true);
1101}
1102
1103/* reg_sfdf_fid
1104 * FID to flush.
1105 * Access: RW
1106 */
1107MLXSW_ITEM32(reg, sfdf, fid, 0x0C, 0, 16);
1108
1109/* reg_sfdf_system_port
1110 * Port to flush.
1111 * Access: RW
1112 */
1113MLXSW_ITEM32(reg, sfdf, system_port, 0x0C, 0, 16);
1114
1115/* reg_sfdf_port_fid_system_port
1116 * Port to flush, pointed to by FID.
1117 * Access: RW
1118 */
1119MLXSW_ITEM32(reg, sfdf, port_fid_system_port, 0x08, 0, 16);
1120
1121/* reg_sfdf_lag_id
1122 * LAG ID to flush.
1123 * Access: RW
1124 */
1125MLXSW_ITEM32(reg, sfdf, lag_id, 0x0C, 0, 10);
1126
1127/* reg_sfdf_lag_fid_lag_id
1128 * LAG ID to flush, pointed to by FID.
1129 * Access: RW
1130 */
1131MLXSW_ITEM32(reg, sfdf, lag_fid_lag_id, 0x08, 0, 10);
1132
1047/* SLDR - Switch LAG Descriptor Register 1133/* SLDR - Switch LAG Descriptor Register
1048 * ----------------------------------------- 1134 * -----------------------------------------
1049 * The switch LAG descriptor register is populated by LAG descriptors. 1135 * The switch LAG descriptor register is populated by LAG descriptors.
@@ -1701,20 +1787,20 @@ MLXSW_ITEM32(reg, pmlp, width, 0x00, 0, 8);
1701 * Module number. 1787 * Module number.
1702 * Access: RW 1788 * Access: RW
1703 */ 1789 */
1704MLXSW_ITEM32_INDEXED(reg, pmlp, module, 0x04, 0, 8, 0x04, 0, false); 1790MLXSW_ITEM32_INDEXED(reg, pmlp, module, 0x04, 0, 8, 0x04, 0x00, false);
1705 1791
1706/* reg_pmlp_tx_lane 1792/* reg_pmlp_tx_lane
1707 * Tx Lane. When rxtx field is cleared, this field is used for Rx as well. 1793 * Tx Lane. When rxtx field is cleared, this field is used for Rx as well.
1708 * Access: RW 1794 * Access: RW
1709 */ 1795 */
1710MLXSW_ITEM32_INDEXED(reg, pmlp, tx_lane, 0x04, 16, 2, 0x04, 16, false); 1796MLXSW_ITEM32_INDEXED(reg, pmlp, tx_lane, 0x04, 16, 2, 0x04, 0x00, false);
1711 1797
1712/* reg_pmlp_rx_lane 1798/* reg_pmlp_rx_lane
1713 * Rx Lane. When rxtx field is cleared, this field is ignored and Rx lane is 1799 * Rx Lane. When rxtx field is cleared, this field is ignored and Rx lane is
1714 * equal to Tx lane. 1800 * equal to Tx lane.
1715 * Access: RW 1801 * Access: RW
1716 */ 1802 */
1717MLXSW_ITEM32_INDEXED(reg, pmlp, rx_lane, 0x04, 24, 2, 0x04, 24, false); 1803MLXSW_ITEM32_INDEXED(reg, pmlp, rx_lane, 0x04, 24, 2, 0x04, 0x00, false);
1718 1804
1719static inline void mlxsw_reg_pmlp_pack(char *payload, u8 local_port) 1805static inline void mlxsw_reg_pmlp_pack(char *payload, u8 local_port)
1720{ 1806{
@@ -3121,6 +3207,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
3121 return "SFGC"; 3207 return "SFGC";
3122 case MLXSW_REG_SFTR_ID: 3208 case MLXSW_REG_SFTR_ID:
3123 return "SFTR"; 3209 return "SFTR";
3210 case MLXSW_REG_SFDF_ID:
3211 return "SFDF";
3124 case MLXSW_REG_SLDR_ID: 3212 case MLXSW_REG_SLDR_ID:
3125 return "SLDR"; 3213 return "SLDR";
3126 case MLXSW_REG_SLCR_ID: 3214 case MLXSW_REG_SLCR_ID: