clear host volatile section on chassis poweron

When using istep to boot a openpower based system, the flow is to issue
a "obmcutil chassison" and then boot the system using the istep tool.
istep does not use the host-start targets so therefore the host volatile
data is not cleared.

To ensure the data is always cleared, add the services to the
chassis-poweron target. The services need to remain within the host
start targets to handle warm reboot scenarios.

A normal "obmcutil poweron" will run both the host and chassis targets
but due to them being started at the same time (and letting systemd
figure out the ordering), the volatiles services will each only be run
once so there is no extra execution due to this commit. If a user were
to just issue a "obmcutil chassison" and then follow that with a
"obmcutil poweron" then the services would be run a second time. This
scenario is a debug only type situation and the extra second to re-run
the services would have very minimal impact.

There is a desire to move services from requires to wants relationships.
That was not done here because of the undefined behavior seen by the
host when this data is not cleared. The required behaviors is to fail
the power on or host start if these services fail.

Tested:
- Verified services were in obmc-chassis-poweron@0.target.requires
- Verified services were run as expected issuing a chassison
- Verified boot of system worked as expected and services were only
  executed once during "obmcutil poweron"

(From meta-openpower rev: 9a967ec383a6f0d0a7e3d7a61d48b35c8aaf8f1c)

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I5ea6ef27cd29d488fa3b7b3bf93a73f1112d1120
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-openpower/classes/openpower-software-manager-ubi.bbclass b/meta-openpower/classes/openpower-software-manager-ubi.bbclass
index 7167b88..dc20d5d 100644
--- a/meta-openpower/classes/openpower-software-manager-ubi.bbclass
+++ b/meta-openpower/classes/openpower-software-manager-ubi.bbclass
@@ -12,6 +12,12 @@
         obmc-flash-bios-check-clearvolatile@.service \
         "
 
+# To handle warm reboot scenarios, the checking and clearing of
+# the volatile section must occur in both the chassis and host
+# targets
+
+# Host target installation - only clear if going through
+# full host start target
 ENABLE_CLEAR_VOLATILE_TMPL = "obmc-flash-bios-enable-clearvolatile@.service"
 HOST_START_TGTFMT = "obmc-host-start@{0}.target"
 ENABLE_CLEAR_VOLATILE_INSTFMT = "obmc-flash-bios-enable-clearvolatile@{0}.service"
@@ -24,3 +30,13 @@
 
 SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ENABLE_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}"
 SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHECK_CLEAR_VOLATILE_START_FMT', 'OBMC_HOST_INSTANCES')}"
+
+# Chassis target installation - always enable and clear in chassis
+# power on
+CHASSIS_PON_TGTFMT = "obmc-chassis-poweron@{0}.target"
+ENABLE_CLEAR_VOLATILE_PON_FMT = "../${ENABLE_CLEAR_VOLATILE_TMPL}:${CHASSIS_PON_TGTFMT}.requires/${ENABLE_CLEAR_VOLATILE_INSTFMT}"
+
+CHECK_CLEAR_VOLATILE_PON_FMT = "../${CHECK_CLEAR_VOLATILE_TMPL}:${CHASSIS_PON_TGTFMT}.requires/${CHECK_CLEAR_VOLATILE_INSTFMT}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ENABLE_CLEAR_VOLATILE_PON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHECK_CLEAR_VOLATILE_PON_FMT', 'OBMC_CHASSIS_INSTANCES')}"