diff options
author | Matt Spinler <spinler@us.ibm.com> | 2017-03-08 22:53:51 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-03-16 23:00:47 +0300 |
commit | cf92a506586cb25e57ec06aaeacbc223832d5e28 (patch) | |
tree | 8d5e8b2266a1e1dc10014aaca79818e61ca1001c /meta-phosphor/common/recipes-phosphor/chassis | |
parent | 1f09d4ae2aa35b469578ff284c98579d23cdac4d (diff) | |
download | openbmc-cf92a506586cb25e57ec06aaeacbc223832d5e28.tar.xz |
Add FSI enable/disable services for cronus use
Start fsi-disable.service to unbind the FSI Driver.
Start fsi-enable.service to bind it again and rescan.
Also added a fsi-bind@.service so we can ensure the
driver is bound each power on.
Change-Id: I5fa62b44994aea3bb645e755187f29e720bf3bce
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/chassis')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan.bb | 15 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi.bb | 21 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-bind@.service | 18 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-disable.service | 8 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-enable.service | 10 | ||||
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-scan@.service (renamed from meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service) | 1 |
6 files changed, 57 insertions, 16 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan.bb deleted file mode 100644 index 4a4fdd7606..0000000000 --- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan.bb +++ /dev/null @@ -1,15 +0,0 @@ -SUMMARY = "Scan for FSI devices" -DESCRIPTION = "Tells the OpenFSI device driver to scan for FSI devices" -PR = "r1" - -inherit obmc-phosphor-dbus-service -inherit obmc-phosphor-license - -TMPL = "fsi-scan@.service" -INSTFMT = "fsi-scan@{0}.service" -TGTFMT = "obmc-power-chassis-on@{0}.target" -FMT = "../${TMPL}:${TGTFMT}.requires/${INSTFMT}" - -SYSTEMD_SERVICE_${PN} += "${TMPL}" -SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_SUBSTITUTIONS += "MACHINE:${MACHINE}:${TMPL}" diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi.bb new file mode 100644 index 0000000000..37a326fd05 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi.bb @@ -0,0 +1,21 @@ +SUMMARY = "FSI Services" +DESCRIPTION = "Install FSI related services" +PR = "r1" + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +TGTFMT = "obmc-power-chassis-on@{0}.target" + +TMPL_SCAN = "fsi-scan@.service" +INSTFMT_SCAN = "fsi-scan@{0}.service" +FMT_SCAN = "../${TMPL_SCAN}:${TGTFMT}.requires/${INSTFMT_SCAN}" + +TMPL_BIND = "fsi-bind@.service" +INSTFMT_BIND = "fsi-bind@{0}.service" +FMT_BIND = "../${TMPL_BIND}:${TGTFMT}.requires/${INSTFMT_BIND}" + +SYSTEMD_SERVICE_${PN} += "${TMPL_SCAN} ${TMPL_BIND} fsi-enable.service fsi-disable.service" + +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_SCAN', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_BIND', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-bind@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-bind@.service new file mode 100644 index 0000000000..77c61f4146 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-bind@.service @@ -0,0 +1,18 @@ +[Unit] +Description=Bind FSI Driver +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Wants=obmc-host-start-pre@%i.target +Before=obmc-host-start-pre@%i.target +Wants=fsi-scan@%i.service +Before=fsi-scan@%i.service +Conflicts=obmc-power-chassis-off@%i.target +ConditionDirectoryNotEmpty=!/sys/bus/platform/drivers/fsi-master-gpio/fsi-master + +[Service] +ExecStart=/bin/sh -c "echo fsi-master > /sys/bus/platform/drivers/fsi-master-gpio/bind" +Type=oneshot +RemainAfterExit=yes + +[Install] +RequiredBy=obmc-power-chassis-on@%i.target diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-disable.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-disable.service new file mode 100644 index 0000000000..a58af0445c --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-disable.service @@ -0,0 +1,8 @@ +[Unit] +Description=Disable FSI +Conflicts=fsi-enable.service + +[Service] +ExecStart=/bin/sh -c "echo fsi-master > /sys/bus/platform/drivers/fsi-master-gpio/unbind" +Type=oneshot +RemainAfterExit=yes diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-enable.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-enable.service new file mode 100644 index 0000000000..c5b1ea1390 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-enable.service @@ -0,0 +1,10 @@ +[Unit] +Description=Enable FSI +Conflicts=fsi-disable.service +ConditionDirectoryNotEmpty=!/sys/bus/platform/drivers/fsi-master-gpio/fsi-master + +[Service] +ExecStart=/bin/sh -c "echo fsi-master > /sys/bus/platform/drivers/fsi-master-gpio/bind" +ExecStart=/bin/sh -c "echo 1 > /sys/bus/platform/devices/fsi-master/scan" +Type=oneshot +RemainAfterExit=yes diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-scan@.service index ca19f1d99e..8f94e28ab3 100644 --- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi-scan/fsi-scan@.service +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-fsi/fsi-scan@.service @@ -5,7 +5,6 @@ After=obmc-power-on@%i.target Wants=obmc-host-start-pre@%i.target Before=obmc-host-start-pre@%i.target Conflicts=obmc-power-chassis-off@%i.target -ConditionPathExists=!/run/openbmc/chassis@%i-on [Service] ExecStart=/bin/sh -c "echo 1 > /sys/bus/platform/devices/fsi-master/scan" |