Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Celestica] Add Celestica Silverstone-X platform deb dependency files #12158

Merged
merged 2 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{'name': 'PSU2_Temp3', 'temp': 'na'}, # 12
{'name': 'TEMP_SW_U52', 'temp': 'na'}, # 13
{'name': 'TEMP_SW_U16', 'temp': 'na'}, # 14
{'name': 'I89_CORE_Temp', 'temp': 'na'}, # 15
{'name': 'I91_CORE_Temp', 'temp': 'na'}, # 15
{'name': 'I89_AVDD_Temp', 'temp': 'na'}, # 16
{'name': 'QSFP_DD_Temp1', 'temp': 'na'}, # 17
{'name': 'QSFP_DD_Temp2', 'temp': 'na'}, # 18
Expand Down Expand Up @@ -72,7 +72,7 @@
"max": {"B2F": NULL_VAL, "F2B": 58}, "high_critical_threshold": {"B2F": NULL_VAL, "F2B": 62}},
"TEMP_SW_U16": {"low_critical_threshold": NULL_VAL, "min": NULL_VAL,
"max": NULL_VAL, "high_critical_threshold": NULL_VAL},
"I89_CORE_Temp": {"low_critical_threshold": NULL_VAL, "min": NULL_VAL,
"I91_CORE_Temp": {"low_critical_threshold": NULL_VAL, "min": NULL_VAL,
"max": NULL_VAL, "high_critical_threshold": 125},
"I89_AVDD_Temp": {"low_critical_threshold": NULL_VAL, "min": NULL_VAL,
"max": NULL_VAL, "high_critical_threshold": 125},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#!/bin/bash

### BEGIN INIT INFO
# Provides: setup-board
# Required-Start: $portmap
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Setup SilverStone-x board.
### END INIT INFO
HAVE_BMC=0
if [[ -e "/dev/ipmi0" || -e "/dev/ipmi/0" || -e "/dev/ipmidev/0" ]]; then
# if BMC exists, fan control strategy is owned by BMC and no need to implement here.
HAVE_BMC=1
fi

case "$1" in
start)
echo -n "Setting up board... "

modprobe i2c-dev
modprobe i2c-i801
modprobe ipmi_devintf
modprobe fpga_device
modprobe fpga_system
modprobe i2c_switchcpld
modprobe fpga_i2c_ocores
modprobe fpga_xcvr
modprobe lpc_basecpld
modprobe mc24lc64t
modprobe optoe
if [ $HAVE_BMC -eq 0 ]; then
modprobe pmbus
modprobe pmbus_core
modprobe industrialio
modprobe lm75
modprobe platform_fan
modprobe platform_psu
modprobe ucd90120
modprobe ucd90160
modprobe mp2975
modprobe mcp3425_smbus
modprobe tps536c7

echo 24lc64t 0x50 > /sys/bus/i2c/devices/i2c-6/new_device
echo 24lc64t 0x50 > /sys/bus/i2c/devices/i2c-3/new_device
echo 24lc64t 0x57 > /sys/bus/i2c/devices/i2c-3/new_device
echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-7/new_device
echo 24c02 0x51 > /sys/bus/i2c/devices/i2c-7/new_device

devname=`cat /sys/bus/i2c/devices/i2c-9/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo platform_fan 0x0d > /sys/bus/i2c/devices/i2c-9/new_device
echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-9/new_device
fi
devname=`cat /sys/bus/i2c/devices/i2c-7/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo platform_psu 0x59 > /sys/bus/i2c/devices/i2c-7/new_device
echo platform_psu 0x58 > /sys/bus/i2c/devices/i2c-7/new_device
fi

devname=`cat /sys/bus/i2c/devices/i2c-4/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo ucd90160 0x34 > /sys/bus/i2c/devices/i2c-4/new_device
echo ucd90120 0x35 > /sys/bus/i2c/devices/i2c-4/new_device
echo tps536c7 0x6c > /sys/bus/i2c/devices/i2c-4/new_device
fi

devname=`cat /sys/bus/i2c/devices/i2c-5/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo mp2975 0x70 > /sys/bus/i2c/devices/i2c-5/new_device
echo mp2975 0x76 > /sys/bus/i2c/devices/i2c-5/new_device
echo mp2975 0x7b > /sys/bus/i2c/devices/i2c-5/new_device
fi

devname=`cat /sys/bus/i2c/devices/i2c-8/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo mcp3425_smbus 0x68 > /sys/bus/i2c/devices/i2c-8/new_device
echo lm75b 0x48 > /sys/bus/i2c/devices/i2c-8/new_device
echo lm75b 0x49 > /sys/bus/i2c/devices/i2c-8/new_device
echo lm75b 0x4a > /sys/bus/i2c/devices/i2c-8/new_device
fi

i=58
devname=`cat /sys/bus/i2c/devices/i2c-"$i"/name`
if [[ $devname == *'mux'* ]]; then
echo 24lc64t 0x50 > /sys/bus/i2c/devices/i2c-"$i"/new_device
echo lm75b 0x48 > /sys/bus/i2c/devices/i2c-"$i"/new_device
echo lm75b 0x49 > /sys/bus/i2c/devices/i2c-"$i"/new_device
fi
fi

# Instantiate TLV EEPROM device on I801/ISMT bus
devname=`cat /sys/bus/i2c/devices/i2c-0/name`
if [[ $devname == 'SMBus'* ]]; then
echo 24lc64t 0x56 > /sys/bus/i2c/devices/i2c-0/new_device
fi
devname=`cat /sys/bus/i2c/devices/i2c-10/name`
if [[ $devname == 'fpga-xiic-i2c' ]]; then
echo switchboard 0x30 > /sys/bus/i2c/devices/i2c-10/new_device
echo switchboard 0x31 > /sys/bus/i2c/devices/i2c-10/new_device

fi

# bus 12~43 for 32 qsfp ports and 44 for sfp1 45 for sfp2
for i in {12..43}; do
devname=`cat /sys/bus/i2c/devices/i2c-"$i"/name`
if [[ $devname == *'mux'* ]]; then
echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-"$i"/new_device
port=`expr $i - 11`
echo qsfp$port > /sys/bus/i2c/devices/i2c-"$i"/"$i"-0050/port_name
fi
done
for i in {44..45}; do
devname=`cat /sys/bus/i2c/devices/i2c-"$i"/name`
if [[ $devname == *'mux'* ]]; then
echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-"$i"/new_device
port=`expr $i - 43`
echo sfp$port > /sys/bus/i2c/devices/i2c-"$i"/"$i"-0050/port_name
fi
done

decode-syseeprom --init 2> /dev/null &

/bin/sh /usr/local/bin/platform_api_mgnt.sh init

echo "done."
;;

stop)
rmmod optoe
rmmod mc24lc64t
rmmod lpc_basecpld
rmmod fpga_xcvr
rmmod i2c_switchcpld
rmmod fpga_system
rmmod fpga_i2c_ocores
rmmod fpga_device
rmmod ipmi_devintf
rmmod i2c-dev
if [ $HAVE_BMC -eq 0 ]; then
rmmod platform_fan
rmmod platform_psu
rmmod ucd90120
rmmod ucd90160
rmmod mp2975
rmmod mcp3425_smbus
rmmod tps536c7
rmmod lm75
rmmod pmbus
rmmod pmbus_core
rmmod industrialio
fi
rmmod i2c_mux_pca954x
rmmod i2c-i801
echo "done."
;;

force-reload|restart)
echo "Not supported"
;;

*)
echo "Usage: /etc/init.d/platform-modules-silverstone-x.init {start|stop}"
exit 1
;;
esac

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
silverstone-x/scripts/sensors usr/bin
silverstone-x/scripts/platform_sensors.py usr/local/bin
silverstone-x/cfg/silverstone-x-modules.conf etc/modules-load.d
silverstone-x/systemd/platform-modules-silverstone-x.service lib/systemd/system
silverstone-x/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-cel_silverstone-x-r0
silverstone-x/systemd/fancontrol/fancontrol-B2F usr/share/sonic/device/x86_64-cel_silverstone-x-r0
silverstone-x/systemd/fancontrol/fancontrol-F2B usr/share/sonic/device/x86_64-cel_silverstone-x-r0
silverstone-x/systemd/fancontrol/fancontrol.sh etc/init.d
silverstone-x/systemd/fancontrol/fancontrol.service lib/systemd/system
silverstone-x/systemd/fancontrol/fancontrol usr/local/bin
services/platform_api/platform_api_mgnt.sh usr/local/bin

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
for i in $(seq 1 5); do
ret=$(depmod -a)
if [ -n "$ret" ]; then
break
fi
sleep 2
echo "run depmod again"
done
systemctl enable platform-modules-silverstone-x.service
systemctl start platform-modules-silverstone-x.service
systemctl enable fancontrol.service
systemctl start fancontrol.service

/usr/local/bin/platform_api_mgnt.sh install
/etc/init.d/fancontrol.sh install