[platform/cel]: Fixed iSMT SMBUS conflict in Seastone-DX010. (#6889)
#### Why I did it - The iSMT SMBUS I2c bus number conflicts in different kernel versions. #### How I did it - Add I2cbus number detector for iSMT bus - Replace iSMT bus number in fancontrol config
This commit is contained in:
parent
94c524276a
commit
37fc4d4afb
@ -39,35 +39,31 @@ start)
|
|||||||
modprobe leds-dx010
|
modprobe leds-dx010
|
||||||
modprobe lm75
|
modprobe lm75
|
||||||
|
|
||||||
found=0
|
# Detect iSMT SMBus
|
||||||
for devnum in 0 1; do
|
ismt_bus=$(i2cdetect -l | grep 'SMBus iSMT' | cut -c5)
|
||||||
devname=`cat /sys/bus/i2c/devices/i2c-${devnum}/name`
|
|
||||||
# iSMT adapter can be at either dffd0000 or dfff0000
|
|
||||||
if [[ $devname == 'SMBus iSMT adapter at '* ]]; then
|
|
||||||
found=1
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
[ $found -eq 0 ] && echo "cannot find iSMT" && exit 1
|
[ -z $ismt_bus ] && echo "cannot find iSMT" && exit 1
|
||||||
|
|
||||||
i2cset -y ${devnum} 0x70 0x10 0x00 0x01 i
|
# Update the iSMT bus number in the fancontrol configuration.
|
||||||
|
sed -i "s/13.0\/i2c-[0-9]/13.0\/i2c-$ismt_bus/g" /usr/share/sonic/device/x86_64-cel_seastone-r0/fancontrol
|
||||||
|
|
||||||
|
i2cset -y ${ismt_bus} 0x70 0x10 0x00 0x01 i
|
||||||
|
|
||||||
# Attach PCA9541 Ox70 Master Selector
|
# Attach PCA9541 Ox70 Master Selector
|
||||||
chmod 755 /sys/bus/i2c/devices/i2c-${devnum}/new_device
|
chmod 755 /sys/bus/i2c/devices/i2c-${ismt_bus}/new_device
|
||||||
echo pca9541 0x70 > /sys/bus/i2c/devices/i2c-${devnum}/new_device
|
echo pca9541 0x70 > /sys/bus/i2c/devices/i2c-${ismt_bus}/new_device
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Attach PCA9548 0x71 Channel Extender for Main Board
|
# Attach PCA9548 0x71 Channel Extender for Main Board
|
||||||
echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-${devnum}/new_device
|
echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-${ismt_bus}/new_device
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Attach PCA9548 0x73 Channel Extender for CPU Board
|
# Attach PCA9548 0x73 Channel Extender for CPU Board
|
||||||
echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-${devnum}/new_device
|
echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-${ismt_bus}/new_device
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Attach PCA9548 0x77 Channel Extender for Fan's EEPROMs
|
# Attach PCA9548 0x77 Channel Extender for Fan's EEPROMs
|
||||||
echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-${devnum}/new_device
|
echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-${ismt_bus}/new_device
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Attach syseeprom
|
# Attach syseeprom
|
||||||
|
Reference in New Issue
Block a user