fix(script : nicsensor.sh)fix some comments
This commit is contained in:
parent
89aae7feb0
commit
87e0d2b00a
@ -1,9 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# 支持测试的传感器芯片 emc1413 ina3221 adc128
|
|
||||||
# 支持通过 chip 参数直接做I2C命令透传来访问芯片寄存器
|
|
||||||
# 支持通过 fru 参数读取FRU十六进制内容
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Project Feature Varible (按照项目需要修改)
|
# Project Feature Varible (按照项目需要修改)
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
@ -109,7 +105,6 @@ REG_ina3221_bus3="0x06"
|
|||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Global Varible (请勿随意修改)
|
# Global Varible (请勿随意修改)
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
# DEBUG MODE=0 : Disable debug mode
|
# DEBUG MODE=0 : Disable debug mode
|
||||||
# =1 : Enable debug mode
|
# =1 : Enable debug mode
|
||||||
# 启用debug模式后需要手动配置 i2c_bus
|
# 启用debug模式后需要手动配置 i2c_bus
|
||||||
@ -161,7 +156,7 @@ print_usage(){
|
|||||||
echo ""
|
echo ""
|
||||||
echo " To Auto detect i2c slave on server, please use:"
|
echo " To Auto detect i2c slave on server, please use:"
|
||||||
echo " ./nicsensor.sh detect"
|
echo " ./nicsensor.sh detect"
|
||||||
echo " This function now only support on server 5280m7, 5468m7, donghu, qiandaohu"
|
echo " This function now only support on server 5280m7, 5468m7, donghu, yichun, qiandaohu"
|
||||||
echo ""
|
echo ""
|
||||||
echo " If want to read/write chip register, use the below format"
|
echo " If want to read/write chip register, use the below format"
|
||||||
echo " ./nicsensor.sh [slot] chip [slave] [i2c_command]"
|
echo " ./nicsensor.sh [slot] chip [slave] [i2c_command]"
|
||||||
@ -321,6 +316,7 @@ set_configuration_yichun(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 根据qiandaohu pcie slot 和 i2c 对对应关系调整变量
|
||||||
set_configuration_qiandaohu(){
|
set_configuration_qiandaohu(){
|
||||||
is_have_pca9641=0
|
is_have_pca9641=0
|
||||||
|
|
||||||
@ -768,7 +764,7 @@ process_ina3221(){
|
|||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# CHIP
|
# CHIP
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# 临时支持CHIP读取寄存器
|
# 透传i2c命令到设备上
|
||||||
write_read_chip(){
|
write_read_chip(){
|
||||||
|
|
||||||
# Modify i2c cmd which write to cpld if need
|
# Modify i2c cmd which write to cpld if need
|
||||||
@ -825,7 +821,6 @@ parse_fru_write_data(){
|
|||||||
}'`
|
}'`
|
||||||
}
|
}
|
||||||
|
|
||||||
# 支持FRU读取
|
|
||||||
read_fru(){
|
read_fru(){
|
||||||
|
|
||||||
res_fru=`i2ctransfer -y $i2c_bus w2@$chip_slave $fru_offset r256`
|
res_fru=`i2ctransfer -y $i2c_bus w2@$chip_slave $fru_offset r256`
|
||||||
@ -860,7 +855,7 @@ read_fru(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 20240926 支持写板卡FRU
|
# todo 未测试功能
|
||||||
write_fru(){
|
write_fru(){
|
||||||
|
|
||||||
i2c_write_byte=$(($fru_write_size+2))
|
i2c_write_byte=$(($fru_write_size+2))
|
||||||
@ -926,7 +921,6 @@ start_get_sensor(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 在 5280m7 上扫描每个pcie slot下的I2C设备
|
# 在 5280m7 上扫描每个pcie slot下的I2C设备
|
||||||
# 详细对应关系参阅 readme.txt 第二节
|
|
||||||
detect_on_5280m7(){
|
detect_on_5280m7(){
|
||||||
# 从9641获取I2C控制权
|
# 从9641获取I2C控制权
|
||||||
i2c_bus=12
|
i2c_bus=12
|
||||||
@ -963,7 +957,6 @@ detect_on_5280m7(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
# 在 5468m7 上扫描每个pcie slot下的I2C设备
|
# 在 5468m7 上扫描每个pcie slot下的I2C设备
|
||||||
# 详细对应关系参阅 readme.txt 第二节
|
|
||||||
detect_on_5468m7(){
|
detect_on_5468m7(){
|
||||||
# 从9641获取I2C控制权
|
# 从9641获取I2C控制权
|
||||||
i2c_bus=13
|
i2c_bus=13
|
||||||
@ -1075,6 +1068,7 @@ detect_on_yichun(){
|
|||||||
i2cdetect -y $i2c_bus
|
i2cdetect -y $i2c_bus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 在 qiandaohu 上扫描每个pcie slot下的I2C设备
|
||||||
detect_on_qiandaohu(){
|
detect_on_qiandaohu(){
|
||||||
i2c_bus=3
|
i2c_bus=3
|
||||||
format_print $INFO "PCIe slot 0 : bus3 9548channel 3"
|
format_print $INFO "PCIe slot 0 : bus3 9548channel 3"
|
||||||
@ -1127,8 +1121,8 @@ detect_on_qiandaohu(){
|
|||||||
i2cdetect -y $i2c_bus
|
i2cdetect -y $i2c_bus
|
||||||
}
|
}
|
||||||
|
|
||||||
# 搜索服务器所有PCIE插槽的I2C设备信息,当前仅支持特定Riser卡上的设备
|
# 搜索服务器所有PCIE插槽的I2C设备信息,仅支持特定Riser卡上的设备
|
||||||
# change list : 20240912-支持服务器器型号5280m7,5468m7
|
# 一些服务器上由于riser卡不同可能导致对应关系不同
|
||||||
start_detect_device(){
|
start_detect_device(){
|
||||||
|
|
||||||
# debug mode下进行detect操作仅对当前链路进行detect
|
# debug mode下进行detect操作仅对当前链路进行detect
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user