Make use of obmc-fan-control-ready@.target

This involves the following:
* Start the fan-control-init@.service on a power on.
* That service will set fans to full speed, delay for a bit, and then
  start the obmc-fan-control-ready target.
* This target will start the fan monitor and real fan control services.
* On a power off, the target and these services will be deactivated.

Doing it this way ensures the fans will have had time to ramp up from a
cold start before applications start looking at them.

Currently, on a reboot at runtime the same thing will occur.  The watchdog
would have already brought the fans to high speed, so this will extend
that time at full speed by another 20 (or similar, it's configurable)
seconds, ensuring we know what speed the fans are at.

Resolves openbmc/openbmc#1567

Change-Id: I73a1f91f0efaf319df97b59334073116d45f40c3
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
index 19eb4db..f051404 100644
--- a/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
+++ b/meta-phosphor/common/recipes-phosphor/fans/phosphor-fan.bb
@@ -46,8 +46,8 @@
 # Needed to install into the obmc-chassis-poweron target
 TMPL_TACH = "phosphor-fan-presence-tach@.service"
 INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service"
-TGTFMT = "obmc-chassis-poweron@{0}.target"
-FMT_TACH = "../${TMPL_TACH}:${TGTFMT}.requires/${INSTFMT_TACH}"
+POWERON_TGT = "obmc-chassis-poweron@{0}.target"
+FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}"
 
 FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach"
 SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}"
@@ -67,13 +67,20 @@
 
 RDEPENDS_${PN}-control += "sdbusplus"
 
+FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target"
+
 TMPL_CONTROL = "phosphor-fan-control@.service"
 INSTFMT_CONTROL = "phosphor-fan-control@{0}.service"
-FMT_CONTROL = "../${TMPL_CONTROL}:${TGTFMT}.requires/${INSTFMT_CONTROL}"
+FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}"
+
+TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service"
+INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service"
+FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.requires/${INSTFMT_CONTROL_INIT}"
 
 FILES_${PN}-control = "${sbindir}/phosphor-fan-control"
-SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL}"
+SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}"
 SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}"
 
 # --------------------------------------
 # phosphor-chassis-cooling-type specific configuration
@@ -95,7 +102,7 @@
 
 TMPL_MONITOR = "phosphor-fan-monitor@.service"
 INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service"
-FMT_MONITOR = "../${TMPL_MONITOR}:${TGTFMT}.requires/${INSTFMT_MONITOR}"
+FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}"
 
 FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor"
 SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR}"