diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index b01c802f08..7043da9fe1 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -225,11 +225,10 @@ if [ ! -e /host/machine.conf ]; then grub_installation_needed="TRUE" fi + migrate_nos_configuration umount /mnt/onie-boot fi -migrate_nos_configuration - . /host/machine.conf program_console_speed diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index cac4ffbf65..4770ac7c2c 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -1,6 +1,6 @@ s6100/scripts/iom_power_*.sh usr/local/bin s6100/scripts/s6100_platform.sh usr/local/bin -s6100/scripts/s6100_i2c_enumeration.sh usr/local/bin +s6100/scripts/s6100_platform_startup.sh usr/local/bin s6100/scripts/s6100_bitbang_reset.sh usr/local/bin s6100/scripts/pcisysfs.py usr/bin common/dell_i2c_utils.sh usr/local/bin @@ -33,7 +33,7 @@ s6100/systemd/s6100-ssd-monitor.service etc/systemd/system s6100/systemd/s6100-ssd-monitor.timer etc/systemd/system s6100/systemd/s6100-ssd-upgrade-status.service etc/systemd/system s6100/systemd/s6100-reboot-cause.service etc/systemd/system -s6100/systemd/s6100-i2c-enumerate.service etc/systemd/system +s6100/systemd/s6100-platform-startup.service etc/systemd/system s6100/scripts/s6100_serial_getty_monitor etc/monit/conf.d common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin index 683dcc6733..20a5d8cf5a 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin @@ -8,4 +8,4 @@ fi io_rd_wr.py --set --val 40 --offset 0x131 io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 0B --offset 211; io_rd_wr.py --set --val aa --offset 213 -/usr/local/bin/s6100_i2c_enumeration.sh deinit & > /dev/null +/usr/local/bin/s6100_platform_startup.sh deinit & > /dev/null diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin index 4ccfecdfe2..84b525fe6b 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/reboot_plugin @@ -5,4 +5,4 @@ if [[ -d /sys/devices/platform/SMF.512/hwmon/ ]]; then echo 0xcc > mb_poweron_reason fi -/usr/local/bin/s6100_i2c_enumeration.sh deinit & > /dev/null +/usr/local/bin/s6100_platform_startup.sh deinit & > /dev/null diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index 2afa571aa8..15763bbc9e 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh @@ -2,20 +2,6 @@ #platform init script for Dell S6100 -install_python_api_package() { - device="/usr/share/sonic/device" - platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) - rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) -} - -remove_python_api_package() { - rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) - if [ $? -eq 0 ]; then - rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null) - fi -} - - if [[ "$1" == "init" ]]; then pericom="/sys/bus/pci/devices/0000:08:00.0" @@ -38,30 +24,31 @@ if [[ "$1" == "init" ]]; then systemctl start --no-block s6100-ssd-upgrade-status.service - is_fast_warm=$(cat /proc/cmdline | grep SONIC_BOOT_TYPE | wc -l) + case "$(cat /proc/cmdline)" in + *SONIC_BOOT_TYPE=warm*) + TYPE='warm' + ;; + *SONIC_BOOT_TYPE=fastfast*) + TYPE='fastfast' + ;; + *SONIC_BOOT_TYPE=fast*|*fast-reboot*) + TYPE='fast' + ;; + *SONIC_BOOT_TYPE=soft*) + TYPE='soft' + ;; + *) + TYPE='cold' + esac - if [[ "$is_fast_warm" == "1" ]]; then - systemctl start --no-block s6100-i2c-enumerate.service + if [[ "$TYPE" == "cold" ]]; then + systemctl start s6100-platform-startup.service else - systemctl start s6100-i2c-enumerate.service + systemctl start --no-block s6100-platform-startup.service fi - echo -2 > /sys/bus/i2c/drivers/pca954x/0-0070/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/4-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/6-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/6-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/7-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/7-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/8-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/8-0072/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/9-0071/idle_state - echo -2 > /sys/bus/i2c/drivers/pca954x/9-0072/idle_state - - install_python_api_package - monit reload - elif [[ "$1" == "deinit" ]]; then - /usr/local/bin/s6100_i2c_enumeration.sh deinit + /usr/local/bin/s6100_platform_startup.sh deinit modprobe -r dell_s6100_lpc modprobe -r dell_s6100_iom_cpld @@ -69,7 +56,6 @@ elif [[ "$1" == "deinit" ]]; then modprobe -r i2c-dev modprobe -r dell_ich modprobe -r nvram - remove_python_api_package else echo "s6100_platform : Invalid option !" fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh similarity index 89% rename from platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh rename to platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh index d00fec233e..d6f6d74cf2 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh @@ -1,9 +1,22 @@ #!/bin/bash -### DellEMC S6100 I2C MUX Enumeration script +### DellEMC S6100 Platform Startup script source dell_i2c_utils.sh +install_python_api_package() { + device="/usr/share/sonic/device" + platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) +} + +remove_python_api_package() { + rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) + if [ $? -eq 0 ]; then + rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null) + fi +} + init_devnum() { found=0 for devnum in 0 1; do @@ -292,6 +305,20 @@ if [[ "$1" == "init" ]]; then switch_board_qsfp_lpmode "disable" /usr/local/bin/s6100_bitbang_reset.sh xcvr_presence_interrupts "enable" + + echo -2 > /sys/bus/i2c/drivers/pca954x/0-0070/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/4-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/6-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/6-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/7-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/7-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/8-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/8-0072/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/9-0071/idle_state + echo -2 > /sys/bus/i2c/drivers/pca954x/9-0072/idle_state + + install_python_api_package + monit reload elif [[ "$1" == "deinit" ]]; then xcvr_presence_interrupts "disable" switch_board_sfp "delete_device" @@ -302,4 +329,6 @@ elif [[ "$1" == "deinit" ]]; then switch_board_qsfp "delete_device" switch_board_qsfp_mux "delete_device" cpu_board_mux "delete_device" + + remove_python_api_package fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service deleted file mode 100644 index c634828319..0000000000 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Dell S6100 I2C MUX Enumeration -Before=pmon.service -DefaultDependencies=no - -[Service] -Type=oneshot -ExecStart=/usr/local/bin/s6100_i2c_enumeration.sh init -RemainAfterExit=no - -[Install] -WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service new file mode 100644 index 0000000000..d7a40f4303 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Dell S6100 Platform Startup Service +Before=pmon.service determine-reboot-cause.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/s6100_platform_startup.sh init +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target