[DellEMC-Z9332f] Fix platform issues (#6250)
[DellEMC-Z9332f] Fix platform issues * Change to optoe driver * fix API 2.0 issues * Support reboot reason
This commit is contained in:
parent
feb4b04cdc
commit
2f1445e6f1
@ -58,7 +58,7 @@ switch_board_qsfp() {
|
|||||||
"new_device")
|
"new_device")
|
||||||
for ((i=10;i<=41;i++));
|
for ((i=10;i<=41;i++));
|
||||||
do
|
do
|
||||||
echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
|
echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ switch_board_sfp() {
|
|||||||
"new_device")
|
"new_device")
|
||||||
for ((i=1;i<=2;i++));
|
for ((i=1;i<=2;i++));
|
||||||
do
|
do
|
||||||
echo sff8436 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
|
echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-$i/$1
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -99,13 +99,14 @@ switch_board_sfp() {
|
|||||||
|
|
||||||
#Modsel 64 ports to applicable QSFP type modules
|
#Modsel 64 ports to applicable QSFP type modules
|
||||||
#This enables the adapter to respond for i2c commands
|
#This enables the adapter to respond for i2c commands
|
||||||
|
#Low Power mode enabled by default
|
||||||
switch_board_modsel() {
|
switch_board_modsel() {
|
||||||
resource="/sys/bus/pci/devices/0000:09:00.0/resource0"
|
resource="/sys/bus/pci/devices/0000:09:00.0/resource0"
|
||||||
for ((i=1;i<=32;i++));
|
for ((i=1;i<=32;i++));
|
||||||
do
|
do
|
||||||
port_addr=$(( 16384 + ((i - 1) * 16)))
|
port_addr=$(( 16384 + ((i - 1) * 16)))
|
||||||
hex=$( printf "0x%x" $port_addr )
|
hex=$( printf "0x%x" $port_addr )
|
||||||
/usr/bin/pcisysfs.py --set --offset $hex --val 0x10 --res $resource > /dev/null 2>&1
|
/usr/bin/pcisysfs.py --set --offset $hex --val 0x50 --res $resource > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,6 +167,18 @@ remove_python_api_package() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_reboot_cause() {
|
||||||
|
REBOOT_REASON_FILE="/host/reboot-cause/platform/reboot_reason"
|
||||||
|
|
||||||
|
mkdir -p $(dirname $REBOOT_REASON_FILE)
|
||||||
|
|
||||||
|
# Handle First Boot into software version with reboot cause determination support
|
||||||
|
if [[ ! -e $REBOOT_REASON_FILE ]]; then
|
||||||
|
echo "0" > $REBOOT_REASON_FILE
|
||||||
|
else
|
||||||
|
/usr/sbin/i2cget -y 5 0x0d 0x06 > $REBOOT_REASON_FILE
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
init_devnum
|
init_devnum
|
||||||
@ -174,7 +187,7 @@ if [ "$1" == "init" ]; then
|
|||||||
modprobe i2c-dev
|
modprobe i2c-dev
|
||||||
modprobe i2c-mux-pca954x force_deselect_on_exit=1
|
modprobe i2c-mux-pca954x force_deselect_on_exit=1
|
||||||
modprobe ipmi_devintf
|
modprobe ipmi_devintf
|
||||||
modprobe ipmi_si
|
modprobe ipmi_si kipmid_max_busy_us=1000
|
||||||
modprobe cls-i2c-ocore
|
modprobe cls-i2c-ocore
|
||||||
modprobe cls-switchboard
|
modprobe cls-switchboard
|
||||||
modprobe mc24lc64t
|
modprobe mc24lc64t
|
||||||
@ -186,6 +199,8 @@ if [ "$1" == "init" ]; then
|
|||||||
install_python_api_package
|
install_python_api_package
|
||||||
# /usr/bin/qsfp_irq_enable.py
|
# /usr/bin/qsfp_irq_enable.py
|
||||||
platform_firmware_versions
|
platform_firmware_versions
|
||||||
|
get_reboot_cause
|
||||||
|
echo 1000 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us
|
||||||
|
|
||||||
elif [ "$1" == "deinit" ]; then
|
elif [ "$1" == "deinit" ]; then
|
||||||
sys_eeprom "delete_device"
|
sys_eeprom "delete_device"
|
||||||
|
@ -1 +1,2 @@
|
|||||||
__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "psu", "thermal", "fan", "fan_drawer"]
|
__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "psu", "thermal", "fan", "fan_drawer"]
|
||||||
|
from sonic_platform import *
|
||||||
|
@ -235,7 +235,7 @@ class Chassis(ChassisBase):
|
|||||||
A string containing the MAC address in the format
|
A string containing the MAC address in the format
|
||||||
'XX:XX:XX:XX:XX:XX'
|
'XX:XX:XX:XX:XX:XX'
|
||||||
"""
|
"""
|
||||||
return self._eeprom.base_mac_addr('')
|
return self._eeprom.base_mac_addr()
|
||||||
|
|
||||||
def get_serial_number(self):
|
def get_serial_number(self):
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user