Add Bus class to reset OCC bus driver

For some systems, the OCC is accessed over the SBEFIFO, acting as a bus.
If the SBE experiences a failure, the SBEFIFO driver is unable to
recover. Therefore, the OCC control application  must force a reset of
the SBEFIFO driver when the OCC goes active.

Add a Bus class and reset method to unbind and bind the appropriate
SBEFIFO devices when the OCC devices are bound.

Testing: Powered on the system successfully. Injected SBE error through
a putscom. Without this fix, I intermittently saw SBEFIFO errors on the
BMC after the injection. With the fix, I saw no errors despite ~20
iterations.

Resolves openbmc/openbmc#3156

Change-Id: I0f9a230c57d0a3a7b59a874f62cdb1d93c6dcdfb
Signed-off-by: Eddie James <eajames@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 149e0d0..7ac868c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,6 +105,7 @@
 AS_IF([test "x$OCC_MASTER_NAME" == "x"], [OCC_MASTER_NAME="occ-hwmon.1"])
 AC_DEFINE_UNQUOTED([OCC_MASTER_NAME], ["$OCC_MASTER_NAME"], [The OCC master object name])
 
+AC_ARG_VAR(OCC_BUS_PATH, [The OCC bus device path])
 AC_ARG_VAR(OCC_HWMON_PATH, [The OCC hwmon path])
 AC_ARG_VAR(DEV_PATH, [The device path])
 AC_ARG_VAR(I2C_OCC_DEVICE_NAME, [The device name of i2c occ hwmon])
@@ -115,9 +116,11 @@
     AS_IF([test "x$I2C_OCC_DEVICE_NAME" == "x"], [I2C_OCC_DEVICE_NAME="p8-occ-hwmon"]),
 
     # Else, define occ hwmon path for FSI
+    AS_IF([test "x$OCC_BUS_PATH" == "x"], [OCC_BUS_PATH="/sys/bus/fsi/drivers/sbefifo/"])
     AS_IF([test "x$OCC_HWMON_PATH" == "x"], [OCC_HWMON_PATH="/sys/bus/platform/drivers/occ-hwmon/"])
     AS_IF([test "x$DEV_PATH" == "x"], [DEV_PATH="/sys/bus/platform/devices/"]),
 )
+AC_DEFINE_UNQUOTED([OCC_BUS_PATH], ["$OCC_BUS_PATH"], [The OCC bus device path])
 AC_DEFINE_UNQUOTED([OCC_HWMON_PATH], ["$OCC_HWMON_PATH"], [The OCC hwmon path])
 AC_DEFINE_UNQUOTED([DEV_PATH], ["$DEV_PATH"], [The device path])
 AC_DEFINE_UNQUOTED([I2C_OCC_DEVICE_NAME], ["$I2C_OCC_DEVICE_NAME"], [The device name of i2c occ hwmon])