Skip to content

Commit 62b0e92

Browse files
idoschdavem330
authored andcommitted
mlxsw: reg: Add high and low temperature thresholds
The ASIC has the ability to generate events whenever a sensor indicates the temperature goes above or below its high or low thresholds, respectively. In new firmware versions the firmware enforces a minimum of 5 degrees Celsius difference between both thresholds. Make the driver conform to this requirement. Note that this is required even when the events are disabled, as in certain systems interrupts are generated via GPIO based on these thresholds. Fixes: 85926f8 ("mlxsw: reg: Add definition of temperature management registers") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1cf098b commit 62b0e92

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlxsw

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5827,6 +5827,29 @@ MLXSW_ITEM32(reg, mtmp, mtr, 0x08, 30, 1);
58275827
*/
58285828
MLXSW_ITEM32(reg, mtmp, max_temperature, 0x08, 0, 16);
58295829

5830+
/* reg_mtmp_tee
5831+
* Temperature Event Enable.
5832+
* 0 - Do not generate event
5833+
* 1 - Generate event
5834+
* 2 - Generate single event
5835+
* Access: RW
5836+
*/
5837+
MLXSW_ITEM32(reg, mtmp, tee, 0x0C, 30, 2);
5838+
5839+
#define MLXSW_REG_MTMP_THRESH_HI 0x348 /* 105 Celsius */
5840+
5841+
/* reg_mtmp_temperature_threshold_hi
5842+
* High threshold for Temperature Warning Event. In 0.125 Celsius.
5843+
* Access: RW
5844+
*/
5845+
MLXSW_ITEM32(reg, mtmp, temperature_threshold_hi, 0x0C, 0, 16);
5846+
5847+
/* reg_mtmp_temperature_threshold_lo
5848+
* Low threshold for Temperature Warning Event. In 0.125 Celsius.
5849+
* Access: RW
5850+
*/
5851+
MLXSW_ITEM32(reg, mtmp, temperature_threshold_lo, 0x10, 0, 16);
5852+
58305853
#define MLXSW_REG_MTMP_SENSOR_NAME_SIZE 8
58315854

58325855
/* reg_mtmp_sensor_name
@@ -5843,6 +5866,8 @@ static inline void mlxsw_reg_mtmp_pack(char *payload, u8 sensor_index,
58435866
mlxsw_reg_mtmp_sensor_index_set(payload, sensor_index);
58445867
mlxsw_reg_mtmp_mte_set(payload, max_temp_enable);
58455868
mlxsw_reg_mtmp_mtr_set(payload, max_temp_reset);
5869+
mlxsw_reg_mtmp_temperature_threshold_hi_set(payload,
5870+
MLXSW_REG_MTMP_THRESH_HI);
58465871
}
58475872

58485873
static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp,

0 commit comments

Comments
 (0)