meta-fii: meta-mori: Add setup for firmware verification

Firmware of an older stage board will not be allowed on a
current stage board. During the flashing process, AC cycles
are prevented.

Overview of Changes:
1.)mori-lib.sh
-Modify to add definitions that will be used for AC power cycle
 delay.

2.)init_once.sh
-Modify to no longer use HPM_STBY_RST_N.

3.)mori-fw-ver.service
-Modify to wait until fw verification process is finished to prevent
 failed version retrieval.

Signed-off-by: Kyle Nieman <kyle.nieman@fii-na.com>
Change-Id: Idd5a9613bc3e1086dd44e2579b5cb56108d430d0
diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw-ver.service b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw-ver.service
index b0a6618..b744464 100644
--- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw-ver.service
+++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw-ver.service
@@ -1,5 +1,7 @@
 [Unit]
 Description=Firmware Version Daemon
+Wants=host-powerctrl.service
+After=host-powerctrl.service
 
 [Service]
 RemainAfterExit=yes
diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-lib.sh b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-lib.sh
index 47b704e..9c443bf 100644
--- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-lib.sh
+++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-lib.sh
@@ -76,6 +76,15 @@
   set_gpio_ctrl RST_BIOS_EEPROM0_N 1
 }
 
+function Does_File_Exist() {
+  local FILE=$1
+
+  if [[ ! -f "${FILE}" ]]; then
+    echo "${FILE} file does not exist" >&2
+    return 1
+  fi
+}
+
 # Start definitions
 
 # I2C Definitions
@@ -88,3 +97,7 @@
 I2C_CPU_EEPROM=(19 50)
 I2C_STBUCK=(33 74)
 I2C_HOTSWAP_CTRL=(25 1f)
+
+# File Path Definition
+# File path used to prevent hotswapping
+RST_LOCK_FILE="/etc/FW_FLASH_ONGOING"
diff --git a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-boot/init_once.sh b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-boot/init_once.sh
index 4ee4701..8df2272 100644
--- a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-boot/init_once.sh
+++ b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-boot/init_once.sh
@@ -15,7 +15,7 @@
 }
 
 set_mux_default
-set_gpio_ctrl HPM_STBY_RST_N 1
+
 sleep 5
 set_gpio_ctrl S0_BMC_OK 1