Skip to content

Commit

Permalink
Add PDB board support for new
Browse files Browse the repository at this point in the history
SN2201, SKU:HI168

Add PDB board support for new SN2201, SKU:HI168 in hw-mgmt package.

Signed-off-by: Claud Chang <[email protected]>
  • Loading branch information
Claud Chang authored and sholeksandr committed Aug 30, 2024
1 parent f8cda90 commit b93183d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
8 changes: 8 additions & 0 deletions usr/etc/hw-management-sensors/sn2201_sensors.conf
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ bus "i2c-3" "i2c-1-mux (chan_id 1)"
label power2 "PSU-1 12V Rail Pwr(out)"
ignore power3

chip "lm5066i-i2c-*-15"
label in1 "Hotswap Rail(vin)"
ignore in2
label in3 "Hotswap Rail(vout)"
label temp1 "Hotswap MOS temp"
label power1 "Hotswap Rail pwr(in)"
label curr1 "Hotswap Rail curr(in)"

bus "i2c-4" "i2c-1-mux (chan_id 2)"
chip "pmbus-i2c-4-58"
label in1 "PSU-2 220V Rail(in)"
Expand Down
41 changes: 41 additions & 0 deletions usr/etc/hw-management-thermal/tc_config_msn2201_busbar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "msn2201",
"dmin" : {
"C2P": {
"untrusted": {"-127:20": 30, "21:25": 40, "26:30": 50, "31:35": 60, "36:40": 70, "41:120": 80},
"fan_err": {
"tacho": {"-127:120": 50},
"present": {"-127:120": 50},
"direction": {"-127:125": 50}
},
"sensor_read_error" : {"-127:120": 50}
},
"P2C": {
"untrusted":{"-127:15": 30, "16:20": 40, "21:25": 50, "26:30": 60, "31:35": 70, "36:40": 80, "41:120": 90},
"fan_err": {
"tacho": {"-127:120": 50},
"present": {"-127:120": 50},
"direction": {"-127:120": 50}
},
"sensor_read_error":{"-127:20": 20, "21:30": 30, "31:40": 40, "41:120": 50}
}
},
"fan_trend" : {
"C2P": {
"0" : {"rpm_min":1983, "rpm_max":22000, "slope": 227, "pwm_min" : 10, "pwm_max_reduction" : 10, "rpm_tolerance" : 30},
"1" : {"rpm_min":1983, "rpm_max":22000, "slope": 227, "pwm_min" : 10, "pwm_max_reduction" : 10, "rpm_tolerance" : 30}},
"P2C": {
"0" : {"rpm_min":1983, "rpm_max":22000, "slope": 227, "pwm_min" : 10, "pwm_max_reduction" : 10, "rpm_tolerance" : 30},
"1" : {"rpm_min":1983, "rpm_max":22000, "slope": 227, "pwm_min" : 10, "pwm_max_reduction" : 10, "rpm_tolerance" : 30}}
},
"dev_parameters" : {
"asic\\d*": {"pwm_min": 20, "pwm_max" : 100, "val_min":"!70000", "val_max":"!105000", "poll_time": 3, "sensor_read_error":70},
"(cpu_pack|cpu_core\\d+)": {"pwm_min": 20, "pwm_max" : 100, "val_min": "!70000", "val_max": "!95000", "poll_time": 3, "sensor_read_error":70},
"module\\d+": {"pwm_min": 20, "pwm_max" : 100, "val_min":60000, "val_max":80000, "poll_time": 20},
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
},
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "sensor_amb", "sodimm1", "voltmon2"]
}
5 changes: 4 additions & 1 deletion usr/lib/udev/rules.d/50-hw-management-events.rules
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,16 @@ SUBSYSTEM=="i2c", DEVPATH=="/devices/pci0000:00/0000:00:*.*/0000:0[1-4]:00.0/i2c
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/0000:00:*.*/0000:0[1-4]:00.0/i2c-*/*-*/hwmon/hwmon*", ACTION=="add", RUN+="/usr/bin/hw-management-chassis-events.sh add voltmonX %S %p"
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/0000:00:*.*/0000:0[1-4]:00.0/i2c-*/*-*/hwmon/hwmon*", ACTION=="remove", RUN+="/usr/bin/hw-management-chassis-events.sh rm voltmonX %S %p"

# SN2201 voltage controllers 1. powr1014, 2. ir35223
# SN2201 voltage controllers 1. powr1014, 2. ir35223 3. lm5066i
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0037/hwmon/hwmon*", ACTION=="add", RUN+="/usr/bin/hw-management-chassis-events.sh add voltmon1 %S %p"
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0037/hwmon/hwmon*", ACTION=="remove", RUN+="/usr/bin/hw-management-chassis-events.sh rm voltmon1 %S %p"

SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0040/hwmon/hwmon*", ACTION=="add", RUN+="/usr/bin/hw-management-chassis-events.sh add voltmon2 %S %p"
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0040/hwmon/hwmon*", ACTION=="remove", RUN+="/usr/bin/hw-management-chassis-events.sh rm voltmon2 %S %p"

SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0015/hwmon/hwmon*", ACTION=="add", RUN+="/usr/bin/hw-management-chassis-events.sh add pmbus %S %p"
SUBSYSTEM=="hwmon", DEVPATH=="/devices/pci0000:00/*/NVSN2201:*/i2c_mlxcpld*/i2c-*/i2c-*/*-0015/hwmon/hwmon*", ACTION=="remove", RUN+="/usr/bin/hw-management-chassis-events.sh rm pmbus %S %p"

# Power-converters and hotswap devices. They are supported by generic pmbus driver. Exact name is found from devtree file.
SUBSYSTEM=="hwmon", DEVPATH=="/devices/platform/mlxplat/i2c_mlxcpld*/i2c-*/i2c-*/*-0010/hwmon/hwmon*", ACTION=="add", RUN+="/usr/bin/hw-management-chassis-events.sh add pmbus %S %p"
SUBSYSTEM=="hwmon", DEVPATH=="/devices/platform/mlxplat/i2c_mlxcpld*/i2c-*/i2c-*/*-0010/hwmon/hwmon*", ACTION=="remove", RUN+="/usr/bin/hw-management-chassis-events.sh rm pmbus %S %p"
Expand Down
15 changes: 12 additions & 3 deletions usr/usr/bin/hw-management.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,6 @@ sn2201_specific()
thermal_type=$thermal_type_t11
i2c_asic_bus_default=6
hotplug_fans=4
hotplug_pwrs=2
hotplug_psus=2
echo 1 > $config_path/fan_dir_eeprom
echo 22000 > $config_path/fan_max_speed
echo 2200 > $config_path/fan_min_speed
Expand All @@ -1984,8 +1982,19 @@ sn2201_specific()
sed -i "s/label temp8/label temp$id0/g" $lm_sensors_configs_path/sn2201_sensors.conf
sed -i "s/label temp14/label temp$id1/g" $lm_sensors_configs_path/sn2201_sensors.conf
lm_sensors_config="$lm_sensors_configs_path/sn2201_sensors.conf"
thermal_control_config="$thermal_control_configs_path/tc_config_msn2201.json"
echo 13 > $config_path/reset_attr_num
# WA for mux idle state issue.
echo -2 > /sys/devices/pci0000\:00/0000\:00\:1f.0/NVSN2201\:00/i2c_mlxcpld.1/i2c-1/1-0070/idle_state
if [ "$sku" == "HI168" ]; then
hotplug_pwrs=0
hotplug_psus=0
psu_count=0
thermal_control_config="$thermal_control_configs_path/tc_config_msn2201_busbar.json"
else
hotplug_pwrs=2
hotplug_psus=2
thermal_control_config="$thermal_control_configs_path/tc_config_msn2201.json"
fi
}

p2317_specific()
Expand Down

0 comments on commit b93183d

Please sign in to comment.