From fd98c8d0d9f64e8ef37e45afe9edf4c3b8e0fe8d Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Thu, 20 Jun 2024 16:25:09 +0200 Subject: [PATCH] nitropad-nx: use standard shutdown/reboot commands This commit effectively reverts commits a1c13ff and 902866cc. There is no need for this special EC-based poweroff command. See more details in issue linked below. Fixes: https://github.com/Dasharo/dasharo-issues/issues/711 Signed-off-by: Maciej Pijanowski --- initrd/bin/nitropad-shutdown.sh | 36 --------------------------------- initrd/bin/poweroff | 5 ----- initrd/bin/reboot | 5 ----- 3 files changed, 46 deletions(-) delete mode 100755 initrd/bin/nitropad-shutdown.sh diff --git a/initrd/bin/nitropad-shutdown.sh b/initrd/bin/nitropad-shutdown.sh deleted file mode 100755 index e449bc31..00000000 --- a/initrd/bin/nitropad-shutdown.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/ash - -# Method to access IT5570 IO Depth 2 registers -it5570_i2ec() { - # TODO: Use /dev/port instead of iotools - - # Address high byte - iotools io_write8 0x2e 0x2e - iotools io_write8 0x2f 0x11 - iotools io_write8 0x2e 0x2f - iotools io_write8 0x2f $(($2>>8 & 0xff)) - - # Address low byte - iotools io_write8 0x2e 0x2e - iotools io_write8 0x2f 0x10 - iotools io_write8 0x2e 0x2f - iotools io_write8 0x2f $(($2 & 0xff)) - - # Data - iotools io_write8 0x2e 0x2e - iotools io_write8 0x2f 0x12 - iotools io_write8 0x2e 0x2f - - case $1 in - "r") - iotools io_read8 0x2f - ;; - "w") - iotools io_write8 0x2f "$3" - ;; - esac -} - -# shut down using EC external watchdog reset -it5570_i2ec w 0x1f01 0x20 -it5570_i2ec w 0x1f07 0x01 diff --git a/initrd/bin/poweroff b/initrd/bin/poweroff index a27da23b..ef4bdf86 100755 --- a/initrd/bin/poweroff +++ b/initrd/bin/poweroff @@ -8,11 +8,6 @@ if [ "$CONFIG_TPM" = "y" ]; then tpmr shutdown fi -# Run special EC-based poweroff for Nitropad-Nxx -if [ "$CONFIG_BOARD" = "nitropad-nv41" ] || [ "$CONFIG_BOARD" = "nitropad-ns50" ]; then - /bin/nitropad-shutdown.sh -fi - # Sync all mounted filesystems echo s > /proc/sysrq-trigger diff --git a/initrd/bin/reboot b/initrd/bin/reboot index 26255f12..358931e9 100755 --- a/initrd/bin/reboot +++ b/initrd/bin/reboot @@ -17,11 +17,6 @@ if [ "$CONFIG_TPM" = "y" ]; then tpmr shutdown fi -# Run special EC-based poweroff for Nitropad-Nxx -if [ "$CONFIG_BOARD" = "nitropad-nv41" ] || [ "$CONFIG_BOARD" = "nitropad-ns50" ]; then - /bin/nitropad-shutdown.sh -fi - # Sync all mounted filesystems echo s > /proc/sysrq-trigger