meta-ampere: power control: refactor host power control
Refactor the Mt.Jade Host power control operations to support Altra
CPU following the Altra SoC BMC Interface specification which still
satisfying the OpenBMC power control framework.
Tested: check the below cases and ensure Host state report correctly:
1. Run "reboot" from Host Linux. Check the Host is graceful
shutdown, then SYS_RESET is asserted and the Host is booted.
2. Run "shutdown" from Host Linux. Check the Host is graceful
shutdown then the chassis power is turned OFF.
3. Run "ipmitool chassis power soft". Check the Host is graceful
shutdown
4. Execute Redfish GracefulShutdown. Check the Host is graceful
shutdown then the chassis power is turned OFF.
5. Execute Redfish GracefulRestart. Check the Host is graceful
shutdown then turned ON.
6. Check other IPMI chassis power and Redfish Reset actions work.
Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com>
Change-Id: I3a9716f37d7e80bdc1a1d0422e561c8fc51ad040
diff --git a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
index f8e2954..4a44d1b 100644
--- a/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
+++ b/meta-ampere/meta-common/recipes-ac01/host/ampere-hostctrl.bb
@@ -14,12 +14,9 @@
S = "${WORKDIR}"
SRC_URI = " \
- file://ampere-host-reset.service \
file://ampere_power_util.sh \
- file://ampere-chassis-poweron.service \
- file://ampere-host-reset-ack.service \
- file://ampere-host-force-reset.service \
- file://ampere-host-power-cycle.service \
+ file://ampere-host-force-reset@.service \
+ file://ampere-host-shutdown-ack@.service \
"
DEPENDS = "systemd virtual/obmc-gpio-monitor"
@@ -27,37 +24,16 @@
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = " \
- ampere-host-reset.service \
- ampere-chassis-poweron.service \
- ampere-host-reset-ack.service \
- ampere-host-force-reset.service \
- ampere-host-power-cycle.service \
+ ampere-host-force-reset@.service \
+ ampere-host-shutdown-ack@.service \
"
-# host power control
-# Force the power cycle target to run the ampere power cycle
-HOST_REBOOT_SVC = "ampere-host-power-cycle.service"
-HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target"
-HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
-
-# overwrite the host reset to graceful reset
-HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service"
-HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target"
-HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
# overwrite force reboot
-HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service"
+HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service"
HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
-# chassis power control
-CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service"
-CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
-CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
-
TMPL = "phosphor-gpio-monitor@.service"
INSTFMT = "phosphor-gpio-monitor@{0}.service"
TGT = "multi-user.target"