From af5c649a4029927233880476b25c67e1719bb755 Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Wed, 19 Feb 2025 13:55:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(master=20:=20nicsensor.sh)=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9=E6=9C=8D=E5=8A=A1=E5=99=A85688m7=E7=9A=84I2C?= =?UTF-8?q?=E6=8B=93=E6=89=91=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nicsensor.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/nicsensor.sh b/nicsensor.sh index 3f4df95..8b6c87f 100755 --- a/nicsensor.sh +++ b/nicsensor.sh @@ -57,7 +57,7 @@ TMP112_Sensor_name="Temperature" fru_offset="0x00 0x00" Support_Sensor_List="emc1413, adc128, ina3221, tmp468, tmp112" -Support_Server_List="5280m7, 5468m7, donghu, yichun, qiandaohu" +Support_Server_List="5280m7, 5468m7, 5688m7, donghu, yichun, qiandaohu" # Which server will use this script server_type="5280m7" @@ -134,7 +134,7 @@ ina3221_ch2_volt="0" ina3221_ch0_current="0" ina3221_ch1_current="0" ina3221_ch2_current="0" -SCRIPT_VERSION="1.4 Standard" +SCRIPT_VERSION="1.4 Rev1" fru_file_name=$option_data2 fru_write_size=0 @@ -416,6 +416,39 @@ set_configuration_qiandaohu(){ fi } +set_configuration_5688m7(){ + is_have_pca9641=1 + pca9641_slave="0x41" + i2c_bus=13 + + if [ $slot_number -le 3 ];then + pca9548_slave=0x71 + else + pca9548_slave=0x72 + fi + + # set pca9548 switch channel + if [ $slot_number -eq 0 ];then + pca9548_channel="0x01" + elif [ $slot_number -eq 1 ];then + pca9548_channel="0x02" + elif [ $slot_number -eq 2 ];then + pca9548_channel="0x04" + elif [ $slot_number -eq 3 ];then + pca9548_channel="0x08" + elif [ $slot_number -eq 4 ];then + pca9548_channel="0x01" + elif [ $slot_number -eq 5 ];then + pca9548_channel="0x02" + elif [ $slot_number -eq 6 ];then + pca9548_channel="0x04" + elif [ $slot_number -eq 7 ];then + pca9548_channel="0x08" + else + format_print $WARNING "Unspecified card slot!" + fi +} + # Get nic type and slot number parse_nic_slot(){ fullname=0 @@ -469,6 +502,9 @@ set_configuration(){ "qiandaohu") set_configuration_qiandaohu ;; + "5688m7") + set_configuration_5688m7 + ;; *) format_print $ERROR "Error: Unsupport Server Type !!! - $server_type" format_print $INFO "Support list: $Support_Server_List" @@ -1248,6 +1284,21 @@ detect_on_qiandaohu(){ do_i2c_detect 6 0x71 0x08 3 11 } +detect_on_5688m7(){ + i2c_bus=13 + pca9641_slave=0x41 + get_pca9641_control + + do_i2c_detect $i2c_bus 0x71 0x01 0 0 + do_i2c_detect $i2c_bus 0x71 0x02 1 1 + do_i2c_detect $i2c_bus 0x71 0x04 2 2 + do_i2c_detect $i2c_bus 0x71 0x08 3 3 + do_i2c_detect $i2c_bus 0x72 0x01 0 4 + do_i2c_detect $i2c_bus 0x72 0x02 1 5 + do_i2c_detect $i2c_bus 0x72 0x04 2 6 + do_i2c_detect $i2c_bus 0x72 0x08 3 7 +} + debug_user_defined_detect(){ format_print $INFO "Detect by user-defined" @@ -1282,6 +1333,9 @@ start_detect_device(){ "qiandaohu") detect_on_qiandaohu ;; + "5688m7") + detect_on_5688m7 + ;; *) format_print $ERROR "Unsupport Server Type - $server_type" format_print $INFO "Support list : $Support_Server_List"