Compare commits
No commits in common. "a49c474ee58739b2f299ca1a03fab5a9b75e54a5" and "6b40c9c790bfbe82aba58a9288804bbc19774f3c" have entirely different histories.
a49c474ee5
...
6b40c9c790
351
nicsensor.sh
351
nicsensor.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
SCRIPT_VERSION="1.7.5"
|
SCRIPT_VERSION="1.7.4"
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Project Feature Varible (Change as need)
|
# Project Feature Varible (Change as need)
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@ -133,6 +133,7 @@ INFO="Info"
|
|||||||
WARNING="Warning"
|
WARNING="Warning"
|
||||||
ERROR="Error"
|
ERROR="Error"
|
||||||
log="/tmp/nicsensor_debug.log"
|
log="/tmp/nicsensor_debug.log"
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Script Function Defination
|
# Script Function Defination
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@ -162,7 +163,6 @@ print_usage(){
|
|||||||
echo " - [slot] : 0 1 2 3 4 5 ..."
|
echo " - [slot] : 0 1 2 3 4 5 ..."
|
||||||
echo " - [slave] : chip slave address , please provide 7 bit address"
|
echo " - [slave] : chip slave address , please provide 7 bit address"
|
||||||
echo " - [command] : The i2c command which will set to the chip"
|
echo " - [command] : The i2c command which will set to the chip"
|
||||||
echo " 3) E.G. : ./nicsensor.sh pcie1 chip 0x10 'i2ctransfer -y 12 w1@0x10 0x00 r2'"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo " Function 4 - FRU Read and Wirte"
|
echo " Function 4 - FRU Read and Wirte"
|
||||||
echo " 1) Command Format : ./nicsensor.sh [slot] fru [slave] [option] [frudata]"
|
echo " 1) Command Format : ./nicsensor.sh [slot] fru [slave] [option] [frudata]"
|
||||||
@ -171,9 +171,6 @@ print_usage(){
|
|||||||
echo " - [slave] : chip slave address , please provide 7 bit address"
|
echo " - [slave] : chip slave address , please provide 7 bit address"
|
||||||
echo " - [option] : read/write, default to read"
|
echo " - [option] : read/write, default to read"
|
||||||
echo " - [frudata] : fru bin file which will write to eeprom, only for write option"
|
echo " - [frudata] : fru bin file which will write to eeprom, only for write option"
|
||||||
echo " 3) E.G. : ./nicsensor.sh pcie0 fru 0x57"
|
|
||||||
echo " : ./nicsensor.sh pcie0 fru 0x57 read"
|
|
||||||
echo " : ./nicsensor.sh pcie0 fru 0x57 write /tmp/fru.bin"
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,22 +391,10 @@ set_configuration_5280m7(){
|
|||||||
|
|
||||||
# set pca9641 address && I2C BUS
|
# set pca9641 address && I2C BUS
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
is_have_pca9641=0
|
is_have_pca9641=0
|
||||||
pca9548_slave="0x70"
|
pca9548_slave="0x70"
|
||||||
i2c_bus=3
|
i2c_bus=3
|
||||||
|
|
||||||
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"
|
|
||||||
else
|
|
||||||
format_print $WARNING "Unspecified card slot!"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# Case - PCIe
|
|
||||||
is_have_pca9641=1
|
is_have_pca9641=1
|
||||||
if [ $slot_number -le 2 ];then
|
if [ $slot_number -le 2 ];then
|
||||||
pca9641_slave="0x41"
|
pca9641_slave="0x41"
|
||||||
@ -420,7 +405,20 @@ set_configuration_5280m7(){
|
|||||||
pca9548_slave="0x72"
|
pca9548_slave="0x72"
|
||||||
i2c_bus=13
|
i2c_bus=13
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set pca9548 switch channel
|
||||||
|
if [ $nic_type = "ocp" ];then
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
format_print $WARNING "Unspecified card slot!"
|
||||||
|
fi
|
||||||
|
else
|
||||||
if [ $slot_number -eq 0 ];then
|
if [ $slot_number -eq 0 ];then
|
||||||
pca9548_channel="0x02"
|
pca9548_channel="0x02"
|
||||||
elif [ $slot_number -eq 1 ];then
|
elif [ $slot_number -eq 1 ];then
|
||||||
@ -441,190 +439,194 @@ set_configuration_5280m7(){
|
|||||||
|
|
||||||
set_configuration_5468m7(){
|
set_configuration_5468m7(){
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
||||||
format_print $INFO "Please check if script has update version"
|
format_print $INFO "Please check if script has update version"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
fi
|
||||||
# Case - PCIe
|
|
||||||
is_have_pca9641=1
|
|
||||||
if [ $slot_number -le 4 ];then
|
|
||||||
pca9641_slave="0x31"
|
|
||||||
pca9548_slave="0x70"
|
|
||||||
i2c_bus=13
|
|
||||||
else
|
|
||||||
pca9641_slave="0x42"
|
|
||||||
pca9548_slave="0x71"
|
|
||||||
i2c_bus=14
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $slot_number -eq 0 ];then
|
is_have_pca9641=1
|
||||||
pca9548_channel="0x01"
|
|
||||||
elif [ $slot_number -eq 1 ];then
|
# set pca9641 address && I2C BUS
|
||||||
pca9548_channel="0x02"
|
if [ $slot_number -le 4 ];then
|
||||||
elif [ $slot_number -eq 2 ];then
|
pca9641_slave="0x31"
|
||||||
pca9548_channel="0x04"
|
pca9548_slave="0x70"
|
||||||
elif [ $slot_number -eq 3 ];then
|
i2c_bus=13
|
||||||
pca9548_channel="0x08"
|
else
|
||||||
elif [ $slot_number -eq 4 ];then
|
pca9641_slave="0x42"
|
||||||
pca9548_channel="0x10"
|
pca9548_slave="0x71"
|
||||||
elif [ $slot_number -eq 5 ];then
|
i2c_bus=14
|
||||||
pca9548_channel="0x01"
|
fi
|
||||||
elif [ $slot_number -eq 6 ];then
|
|
||||||
pca9548_channel="0x02"
|
# set pca9548 switch channel
|
||||||
elif [ $slot_number -eq 7 ];then
|
if [ $slot_number -eq 0 ];then
|
||||||
pca9548_channel="0x04"
|
pca9548_channel="0x01"
|
||||||
elif [ $slot_number -eq 8 ];then
|
elif [ $slot_number -eq 1 ];then
|
||||||
pca9548_channel="0x08"
|
pca9548_channel="0x02"
|
||||||
elif [ $slot_number -eq 9 ];then
|
elif [ $slot_number -eq 2 ];then
|
||||||
pca9548_channel="0x10"
|
pca9548_channel="0x04"
|
||||||
elif [ $slot_number -eq 10 ];then
|
elif [ $slot_number -eq 3 ];then
|
||||||
pca9548_channel="0x20"
|
pca9548_channel="0x08"
|
||||||
else
|
elif [ $slot_number -eq 4 ];then
|
||||||
format_print $WARNING "Unspecified card slot!"
|
pca9548_channel="0x10"
|
||||||
fi
|
elif [ $slot_number -eq 5 ];then
|
||||||
|
pca9548_channel="0x01"
|
||||||
|
elif [ $slot_number -eq 6 ];then
|
||||||
|
pca9548_channel="0x02"
|
||||||
|
elif [ $slot_number -eq 7 ];then
|
||||||
|
pca9548_channel="0x04"
|
||||||
|
elif [ $slot_number -eq 8 ];then
|
||||||
|
pca9548_channel="0x08"
|
||||||
|
elif [ $slot_number -eq 9 ];then
|
||||||
|
pca9548_channel="0x10"
|
||||||
|
elif [ $slot_number -eq 10 ];then
|
||||||
|
pca9548_channel="0x20"
|
||||||
|
else
|
||||||
|
format_print $WARNING "Unspecified card slot!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_configuration_donghu(){
|
set_configuration_donghu(){
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
||||||
format_print $INFO "Please check if script has update version"
|
format_print $INFO "Please check if script has update version"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
|
||||||
# Case - PCIe
|
|
||||||
is_have_pca9641=0
|
|
||||||
i2c_bus=3
|
|
||||||
pca9548_slave="0x70"
|
|
||||||
if [ $slot_number -eq 0 ];then
|
|
||||||
pca9548_channel="0x80"
|
|
||||||
elif [ $slot_number -eq 1 ];then
|
|
||||||
pca9548_channel="0x40"
|
|
||||||
elif [ $slot_number -eq 2 ];then
|
|
||||||
pca9548_channel="0x20"
|
|
||||||
elif [ $slot_number -eq 3 ];then
|
|
||||||
pca9548_channel="0x10"
|
|
||||||
elif [ $slot_number -eq 4 ];then
|
|
||||||
pca9548_channel="0x08"
|
|
||||||
elif [ $slot_number -eq 5 ];then
|
|
||||||
pca9548_channel="0x04"
|
|
||||||
elif [ $slot_number -eq 6 ];then
|
|
||||||
pca9548_channel="0x02"
|
|
||||||
elif [ $slot_number -eq 7 ];then
|
|
||||||
pca9548_channel="0x01"
|
|
||||||
else
|
|
||||||
format_print $WARNING "Unspecified card slot!"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
is_have_pca9641=0
|
||||||
|
|
||||||
|
i2c_bus=3
|
||||||
|
pca9548_slave="0x70"
|
||||||
|
# set pca9548 switch channel
|
||||||
|
if [ $slot_number -eq 0 ];then
|
||||||
|
pca9548_channel="0x80"
|
||||||
|
elif [ $slot_number -eq 1 ];then
|
||||||
|
pca9548_channel="0x40"
|
||||||
|
elif [ $slot_number -eq 2 ];then
|
||||||
|
pca9548_channel="0x20"
|
||||||
|
elif [ $slot_number -eq 3 ];then
|
||||||
|
pca9548_channel="0x10"
|
||||||
|
elif [ $slot_number -eq 4 ];then
|
||||||
|
pca9548_channel="0x08"
|
||||||
|
elif [ $slot_number -eq 5 ];then
|
||||||
|
pca9548_channel="0x04"
|
||||||
|
elif [ $slot_number -eq 6 ];then
|
||||||
|
pca9548_channel="0x02"
|
||||||
|
elif [ $slot_number -eq 7 ];then
|
||||||
|
pca9548_channel="0x01"
|
||||||
|
else
|
||||||
|
format_print $WARNING "Unspecified card slot!"
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_configuration_yichun(){
|
set_configuration_yichun(){
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
||||||
format_print $INFO "Please check if script has update version"
|
format_print $INFO "Please check if script has update version"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
is_have_pca9641=0
|
||||||
|
pca9548_slave="0x74"
|
||||||
|
|
||||||
|
# set pca9548 switch channel
|
||||||
|
if [ $slot_number -eq 0 ];then
|
||||||
|
i2c_bus=12
|
||||||
|
pca9548_channel="0x02"
|
||||||
|
elif [ $slot_number -eq 1 ];then
|
||||||
|
i2c_bus=13
|
||||||
|
pca9548_channel="0x02"
|
||||||
|
elif [ $slot_number -eq 2 ];then
|
||||||
|
i2c_bus=14
|
||||||
|
pca9548_channel="0x02"
|
||||||
else
|
else
|
||||||
# Case - PCIe
|
format_print $WARNING "Unspecified card slot!"
|
||||||
is_have_pca9641=0
|
|
||||||
pca9548_slave="0x74"
|
|
||||||
if [ $slot_number -eq 0 ];then
|
|
||||||
i2c_bus=12
|
|
||||||
pca9548_channel="0x02"
|
|
||||||
elif [ $slot_number -eq 1 ];then
|
|
||||||
i2c_bus=13
|
|
||||||
pca9548_channel="0x02"
|
|
||||||
elif [ $slot_number -eq 2 ];then
|
|
||||||
i2c_bus=14
|
|
||||||
pca9548_channel="0x02"
|
|
||||||
else
|
|
||||||
format_print $WARNING "Unspecified card slot!"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_configuration_qiandaohu(){
|
set_configuration_qiandaohu(){
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
||||||
format_print $INFO "Please check if script has update version"
|
format_print $INFO "Please check if script has update version"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
is_have_pca9641=0
|
||||||
|
|
||||||
|
if [ $slot_number -le 7 ];then
|
||||||
|
i2c_bus=3
|
||||||
|
pca9548_slave=0x70
|
||||||
else
|
else
|
||||||
# Case - PCIe
|
i2c_bus=6
|
||||||
is_have_pca9641=0
|
pca9548_slave=0x71
|
||||||
if [ $slot_number -le 7 ];then
|
fi
|
||||||
i2c_bus=3
|
|
||||||
pca9548_slave=0x70
|
# set pca9548 switch channel
|
||||||
else
|
if [ $slot_number -eq 0 ];then
|
||||||
i2c_bus=6
|
pca9548_channel="0x08"
|
||||||
pca9548_slave=0x71
|
elif [ $slot_number -eq 1 ];then
|
||||||
fi
|
pca9548_channel="0x04"
|
||||||
if [ $slot_number -eq 0 ];then
|
elif [ $slot_number -eq 2 ];then
|
||||||
pca9548_channel="0x08"
|
pca9548_channel="0x01"
|
||||||
elif [ $slot_number -eq 1 ];then
|
elif [ $slot_number -eq 3 ];then
|
||||||
pca9548_channel="0x04"
|
pca9548_channel="0x02"
|
||||||
elif [ $slot_number -eq 2 ];then
|
elif [ $slot_number -eq 4 ];then
|
||||||
pca9548_channel="0x01"
|
pca9548_channel="0x80"
|
||||||
elif [ $slot_number -eq 3 ];then
|
elif [ $slot_number -eq 5 ];then
|
||||||
pca9548_channel="0x02"
|
pca9548_channel="0x40"
|
||||||
elif [ $slot_number -eq 4 ];then
|
elif [ $slot_number -eq 6 ];then
|
||||||
pca9548_channel="0x80"
|
pca9548_channel="0x10"
|
||||||
elif [ $slot_number -eq 5 ];then
|
elif [ $slot_number -eq 7 ];then
|
||||||
pca9548_channel="0x40"
|
pca9548_channel="0x20"
|
||||||
elif [ $slot_number -eq 6 ];then
|
elif [ $slot_number -eq 8 ];then
|
||||||
pca9548_channel="0x10"
|
pca9548_channel="0x08"
|
||||||
elif [ $slot_number -eq 7 ];then
|
elif [ $slot_number -eq 9 ];then
|
||||||
pca9548_channel="0x20"
|
pca9548_channel="0x04"
|
||||||
elif [ $slot_number -eq 8 ];then
|
elif [ $slot_number -eq 10 ];then
|
||||||
pca9548_channel="0x08"
|
pca9548_channel="0x01"
|
||||||
elif [ $slot_number -eq 9 ];then
|
elif [ $slot_number -eq 11 ];then
|
||||||
pca9548_channel="0x04"
|
pca9548_channel="0x02"
|
||||||
elif [ $slot_number -eq 10 ];then
|
else
|
||||||
pca9548_channel="0x01"
|
format_print $WARNING "Unspecified card slot!"
|
||||||
elif [ $slot_number -eq 11 ];then
|
|
||||||
pca9548_channel="0x02"
|
|
||||||
else
|
|
||||||
format_print $WARNING "Unspecified card slot!"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
set_configuration_5688m7(){
|
set_configuration_5688m7(){
|
||||||
if [ $nic_type = "ocp" ];then
|
if [ $nic_type = "ocp" ];then
|
||||||
# Case - OCP
|
|
||||||
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
format_print $ERROR "Unsupport OCP Nic on $server_type"
|
||||||
format_print $INFO "Please check if script has update version"
|
format_print $INFO "Please check if script has update version"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
is_have_pca9641=1
|
||||||
|
pca9641_slave="0x31"
|
||||||
|
i2c_bus=12
|
||||||
|
|
||||||
|
if [ $slot_number -le 3 ];then
|
||||||
|
pca9548_slave=0x71
|
||||||
else
|
else
|
||||||
# Case - PCIe
|
pca9548_slave=0x72
|
||||||
is_have_pca9641=1
|
fi
|
||||||
pca9641_slave="0x31"
|
|
||||||
i2c_bus=12
|
# set pca9548 switch channel
|
||||||
if [ $slot_number -le 3 ];then
|
if [ $slot_number -eq 0 ];then
|
||||||
pca9548_slave=0x71
|
pca9548_channel="0x01"
|
||||||
else
|
elif [ $slot_number -eq 1 ];then
|
||||||
pca9548_slave=0x72
|
pca9548_channel="0x02"
|
||||||
fi
|
elif [ $slot_number -eq 2 ];then
|
||||||
if [ $slot_number -eq 0 ];then
|
pca9548_channel="0x04"
|
||||||
pca9548_channel="0x01"
|
elif [ $slot_number -eq 3 ];then
|
||||||
elif [ $slot_number -eq 1 ];then
|
pca9548_channel="0x08"
|
||||||
pca9548_channel="0x02"
|
elif [ $slot_number -eq 4 ];then
|
||||||
elif [ $slot_number -eq 2 ];then
|
pca9548_channel="0x01"
|
||||||
pca9548_channel="0x04"
|
elif [ $slot_number -eq 5 ];then
|
||||||
elif [ $slot_number -eq 3 ];then
|
pca9548_channel="0x02"
|
||||||
pca9548_channel="0x08"
|
elif [ $slot_number -eq 6 ];then
|
||||||
elif [ $slot_number -eq 4 ];then
|
pca9548_channel="0x04"
|
||||||
pca9548_channel="0x01"
|
elif [ $slot_number -eq 7 ];then
|
||||||
elif [ $slot_number -eq 5 ];then
|
pca9548_channel="0x08"
|
||||||
pca9548_channel="0x02"
|
else
|
||||||
elif [ $slot_number -eq 6 ];then
|
format_print $WARNING "Unspecified card slot!"
|
||||||
pca9548_channel="0x04"
|
|
||||||
elif [ $slot_number -eq 7 ];then
|
|
||||||
pca9548_channel="0x08"
|
|
||||||
else
|
|
||||||
format_print $WARNING "Unspecified card slot!"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -739,6 +741,9 @@ read_emc1413_channel_value(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_emc1413(){
|
process_emc1413(){
|
||||||
|
# emc1413 no need to init
|
||||||
|
|
||||||
|
# get chip emc1413 value
|
||||||
read_emc1413_channel_value
|
read_emc1413_channel_value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -836,6 +841,8 @@ read_adc128_channel_value(){
|
|||||||
process_adc128(){
|
process_adc128(){
|
||||||
# check if chip adc128 need init
|
# check if chip adc128 need init
|
||||||
check_adc128_init
|
check_adc128_init
|
||||||
|
|
||||||
|
# get chip adc128 value
|
||||||
read_adc128_channel_value
|
read_adc128_channel_value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -960,6 +967,10 @@ read_ina3221_channel_value(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_ina3221(){
|
process_ina3221(){
|
||||||
|
|
||||||
|
# ina3221 no need to init first
|
||||||
|
|
||||||
|
# get chip ina3221 value
|
||||||
read_ina3221_channel_value
|
read_ina3221_channel_value
|
||||||
}
|
}
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@ -1035,6 +1046,9 @@ read_tmp468_value(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_tmp468(){
|
process_tmp468(){
|
||||||
|
# tmp112 no need to init firsts
|
||||||
|
|
||||||
|
# get chip tmp112 value
|
||||||
read_tmp468_value
|
read_tmp468_value
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1094,6 +1108,9 @@ read_tmp112_value(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_tmp112(){
|
process_tmp112(){
|
||||||
|
# tmp112 no need to init firsts
|
||||||
|
|
||||||
|
# get chip tmp112 value
|
||||||
read_tmp112_value
|
read_tmp112_value
|
||||||
}
|
}
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@ -1101,6 +1118,7 @@ process_tmp112(){
|
|||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# do a customization command
|
# do a customization command
|
||||||
write_read_chip(){
|
write_read_chip(){
|
||||||
|
|
||||||
# Modify i2c cmd which write to cpld if need
|
# Modify i2c cmd which write to cpld if need
|
||||||
cmd_wr=$option_data
|
cmd_wr=$option_data
|
||||||
res_wr=`$cmd_wr`
|
res_wr=`$cmd_wr`
|
||||||
@ -1111,6 +1129,9 @@ write_read_chip(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_chip(){
|
process_chip(){
|
||||||
|
|
||||||
|
# cpld no need to init first
|
||||||
|
|
||||||
# write and read cpld
|
# write and read cpld
|
||||||
write_read_chip
|
write_read_chip
|
||||||
}
|
}
|
||||||
@ -1225,6 +1246,8 @@ write_fru(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_fru(){
|
process_fru(){
|
||||||
|
# fru no need to init first
|
||||||
|
|
||||||
# write and read fru
|
# write and read fru
|
||||||
if [ "$option_data" = "write" ];then
|
if [ "$option_data" = "write" ];then
|
||||||
write_fru
|
write_fru
|
||||||
@ -1445,7 +1468,7 @@ debug_user_defined_detect(){
|
|||||||
format_print $INFO "Detect by user-defined"
|
format_print $INFO "Detect by user-defined"
|
||||||
|
|
||||||
# default execute
|
# default execute
|
||||||
format_print $INFO "Default detect on the default i2c: $i2c_bus"
|
format_print $INFO "Default detect on the current i2c"
|
||||||
i2cdetect -y $i2c_bus
|
i2cdetect -y $i2c_bus
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1486,7 +1509,7 @@ start_detect_device(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Start Execute Script(main)
|
# Start Execute Script
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
pre_exec_hook
|
pre_exec_hook
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user