nicsensor/docs/readme_old.txt
2025-04-14 11:01:11 +08:00

152 lines
6.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 重要说明 : 脚本仅用于M7服务器带有i2c standard tool工具的BMC使用
### 仅限用于实验室调试使用
### 大纲
一、脚本使用方法
1.1 修改项目专属配置(必做)
1.2 增加脚本可执行权限
1.3 脚本命令格式
1.4 特殊命令
1.4.1 Detect命令
1.4.2 fru命令
1.4.3 读取芯片寄存器
1.5 debug模式
二、服务器PCIE槽位和PCA9548的channel关系
三、M7 sysadmin用户 SSH打开方法
四、常见问题
### 正文
一、脚本使用方法 Version1.5
1.1、修改项目专属配置
针对不同项目,请先修改脚本中的部分变量(ADC128电压传感器的分压系数,INA3221的分流精密电阻阻值)
针对不同服务器产品,请对应修改server_type变量, 当前支持设置的服务器型号:
5280m7
5468m7
5688m7
donghu
yichun
qiandaohu
1.2、增加脚本可执行权限
在脚本目录下执行命令: chmod +x ./nicsensor.sh
1.3、脚本命令格式
./nicsensor.sh <pcie_slot> <chip_type> <chip_slave>
参数说明:
pcie_slot : 网卡所在的PCIE槽位, 填数字0,1,2,3,4,5
chip_type : 传感器芯片的类型, emc1413,adc128,ina3221,tmp468,tmp112
chip_slave: 传感器芯片的I2C地址(7bit)
举例说明:读取PCIE 1 上网卡的adc128芯片, 芯片slave地址为0x1f
./nicsensor.sh 1 adc128 0x1f
如果需要读取OCP 0上网卡的adc128芯片则命令需要写为:
./nicsensor.sh ocp0 adc128 0x1f
1.4、特殊命令
1.4.1 Detect命令
扫描服务器的PCIE slot 0 - 5上所有的I2C设备
命令: ./nicsensor.sh detect
如果需要扫描OCP上的I2C设备执行:
./nicsensor.sh detect ocp
1.4.2 fru命令
命令: ./nicsensor.sh <pcie_slot> fru <chip_slave> read
举例说明:读取板卡的EEPROM中的FRU(0x57)
- ./nicsensor.sh 5 fru 0x57 read
命令: ./nicsensor.sh <pcie_slot> fru <chip_slave> write <fru.bin>
举例说明:写入板卡的EEPROM中的FRU(0x57)
- ./nicsensor.sh 5 fru 0x57 write fru.bin
1.4.3 读取芯片寄存器
命令: ./nicsensor.sh <pcie_slot> chip <chip_slave> <i2c_cmd>
举例说明: 读取cpld的寄存器 0x00 ,读2个byte
- ./nicsensor.sh 5 chip 0x10 "i2ctransfer -y 13 w1@0x10 0x00 r2"
1.5、DEBUG模式
可通过配置脚本中的 DEBUG_MODE 变量(In Srcipt Line:112)来使用debug模式,在debug模式下,不会执行选通
9641,9548的操作,仅执行读取传感器的操作,因此启用debug模式后需要手动配置的变量有:
i2c_bus
二、服务器PCIE槽位和PCA9548的channel关系
5280M7的PCIE槽位和PCA9548/9546没有确定的对应关系,取决于使用的riser卡.根据一般情况选择的Riser卡, 对应
情况如下:
PCIE 0 = i2c bus 12 , 9548channel1(0x02)
PCIE 1 = i2c bus 12 , 9548channel2(0x04)
PCIE 2 = i2c bus 12 , 9548channel3(0x08)
PCIE 3 = i2c bus 13 , 9548channel1(0x02)
PCIE 4 = i2c bus 13 , 9548channel2(0x04)
PCIE 5 = i2c bus 13 , 9548channel3(0x08)
5468M7的PCIE槽位和PCA9548/9546的对应关系:
PCIE 0 = i2c bus 13 , 9548channel0(0x01)
PCIE 1 = i2c bus 13 , 9548channel1(0x02)
PCIE 2 = i2c bus 13 , 9548channel2(0x04)
PCIE 3 = i2c bus 13 , 9548channel3(0x08)
PCIE 4 = i2c bus 13 , 9548channel4(0x10)
PCIE 5 = i2c bus 14 , 9548channel0(0x01)
PCIE 6 = i2c bus 14 , 9548channel1(0x02)
PCIE 7 = i2c bus 14 , 9548channel2(0x04)
PCIE 8 = i2c bus 14 , 9548channel3(0x08)
PCIE 9 = i2c bus 14 , 9548channel4(0x10)
PCIE 10 = i2c bus 14 , 9548channel5(0x20)
针对不同服务器产品,请对应修改server_type变量,当前支持的服务器类型:
5280m7
5468m7
三、M7 sysadmin用户 SSH打开方法
5280M7服务器默认不开启SSH, 且串口通常有较多干扰打印, 因此推荐使用SSH来执行脚本, 刷新BMC镜像后需要重新配置
1、打开M7 BMC的串口, 可通过串口线或者IPMI SOL带外登入
使用IPMI SOL的前提环境: 可与BMC网络连接, 且电脑上有ipmitool工具
SOL登陆方法:
(1) 将SOL串口源切换到BMC:
ipmitool -I lanplus -H <bmcip> -U admin -P admin raw 0x3c 0x2c 0x02 0x01
(2) 打开SOL:
ipmitool -I lanplus -H <bmcip> -U admin -P admin sol activate
备注: <bmcip> 为目标BMC的ip地址, 请自行更改为对应的ip地址
2、登录进入bmc的linux系统
bmc linux系统的默认用户名/密码 : sysadmin/superuser
3、在BMC的linux系统下执行命令
(1) cp /etc/defconfig/ssh_server_config_with_sysadmin /etc/ssh/sshd_config
(2) /etc/init.d/ssh restart
执行完毕后就可以使用ssh登录BMC了
四、常见问题
1、脚本执行时出现大量的 Error
由于M7服务器的I2C设计有PCA9641作为I2C仲裁器, 脚本执行过程中可能会被9641强行断开I2C连接, 造成大量的
脚本Error, 这种情况在实际运行中是不可避免的, 直接重新执行脚本即可
2、不建议使用该脚本进行压力测试
由于BMC shell的版本非常原始, 没有集成高级的命令行工具, 因此处理数值时采用了复杂的脚本逻辑进行执行, 处
理效率较低。另外由于9641芯片的存在, 不能保证压力测试的正常执行。