Service to scan hub chip on second processor

New openfsi driver code requires user space to explicitly
scan the second processors fsi hub to ensure no conflict
between it and the host.

User space code will use this service to do this scan
at the appropriate time.

Change-Id: I6806ec637e3b00cbba63b7dfd49a14e19cc8f713
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service b/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service
index 2cf65a3..4e95b25 100644
--- a/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service
+++ b/common/recipes-phosphor/fsi/op-fsi/fsi-enable.service
@@ -1,6 +1,8 @@
 [Unit]
 Description=Enable FSI
 Conflicts=fsi-disable.service
+Wants=fsi-hub-scan@0.service
+Before=fsi-hub-scan@0.service
 
 [Service]
 ExecStart=/bin/sh -c "echo 0 > /sys/devices/platform/gpio-fsi/external_mode"
diff --git a/common/recipes-phosphor/fsi/op-fsi/fsi-hub-scan@.service b/common/recipes-phosphor/fsi/op-fsi/fsi-hub-scan@.service
new file mode 100644
index 0000000..edb79d7
--- /dev/null
+++ b/common/recipes-phosphor/fsi/op-fsi/fsi-hub-scan@.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Scan FSI hub device
+Wants=fsi-scan@%i.service
+After=fsi-scan@%i.service
+Conflicts=obmc-chassis-poweroff@%i.target
+
+[Service]
+ExecStart=/bin/sh -c "echo 1 > /sys/devices/platform/gpio-fsi/fsi0/slave@00:00/00:00:00:0a/fsi1/rescan"
+Type=oneshot
+RemainAfterExit=yes