meta-quanta: Add hotswap ordering

We want it to be possible to order units prior to the powercycle event
if state needs to be persisted prior to a powercycle.

We can also remove the time_delay functionality as this is now provided
globally by the gbmc-psu-hardreset.target.

Change-Id: I15b33e120be0246dd821d0dfe9d61b5aae7d1492
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service
index 054b2fe..b95cafa 100644
--- a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service
+++ b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/hotswap-power-cycle.service
@@ -1,9 +1,9 @@
 [Unit]
 Description=Power Cycle by Hotswap Controller
+After=gbmc-psu-hardreset.target
 
 [Service]
 Type=oneshot
-EnvironmentFile=-/run/psu_timedelay
 ExecStart=/usr/bin/tray_powercycle.sh
 
 [Install]
diff --git a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh
index 01c52de..e22dd20 100644
--- a/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh
+++ b/meta-quanta/meta-gbs/recipes-gbs/hotswap-power-cycle/files/tray_powercycle.sh
@@ -25,13 +25,6 @@
 }
 
 main() {
-  # Sleep PSU_HARDRESET_DELAY seconds
-  local psu_delay=$((PSU_HARDRESET_DELAY))
-  if ((psu_delay > 0)); then
-    echo "Sleeping ${psu_delay} seconds before PSU hard reset!"
-    sleep "${psu_delay}"
-  fi
-
   # Stop phosphor-hwmon so that ADM1272 powercycle doesn't happen
   # in the middle of an i2c transaction and stuck the bus low
   stop_phosphor_hwmon
diff --git a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/hotswap-power-cycle/files/hotswap-power-cycle.service b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/hotswap-power-cycle/files/hotswap-power-cycle.service
index a682eb2..d1082a7 100644
--- a/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/hotswap-power-cycle/files/hotswap-power-cycle.service
+++ b/meta-quanta/meta-olympus-nuvoton/recipes-olympus-nuvoton/hotswap-power-cycle/files/hotswap-power-cycle.service
@@ -1,13 +1,10 @@
 [Unit]
 Description=Power Cycle by Hotswap Controller
+After=gbmc-psu-hardreset.target
 
 [Service]
-EnvironmentFile=/run/psu_timedelay
-ExecStartPre=sleep $PSU_HARDRESET_DELAY
-ExecStart= i2cset -f -y 8 0x11 0xd9
-Restart=no
 Type=oneshot
-RemainAfterExit=true
+ExecStart= i2cset -f -y 8 0x11 0xd9
 
 [Install]
 WantedBy=gbmc-psu-hardreset.target