bios: fix driver binding order
spi-aspeed-smc driver was bound but spi-nor driver was not bound which
created problems for systems with more than one spi device on the bus.
Update the code to bind spi-nor driver as well for the desired device
and not unbind spi-aspeed-smc driver at the end since other spi devices
may still be in use on that bus.
Tested: bios update proceeds normally
Config which was used:
```
{
"FirmwareInfo": {
"CompatibleHardware": "com.tyan.Hardware.S8030.SPI.Host",
"VendorIANA": 6653
},
"MuxOutputs": [
{
"Name": "BMC_SPI_SEL",
"Polarity": "High"
}
],
"Name": "HostSPIFlash",
"SPIControllerIndex": 1,
"SPIDeviceIndex": 0,
"Type": "SPIFlash",
}
```
SPI controller driver says bound throughout the update process
```
root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/platform/drivers/spi-aspeed-smc/
1e620000.spi 1e630000.spi bind uevent unbind
```
and SPI flash driver (spi-nor) is bound and then unbound after the
update process.
```
root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/spi/drivers/spi-nor/
bind spi0.0 spi1.0 uevent unbind
root@s8030-bmc-30303035c0c1:/sys/bus/platform# ls /sys/bus/spi/drivers/spi-nor/
bind spi0.0 uevent unbind
```
Change-Id: I874670f9fd27f6642359ea078e6e9db4c1b9e249
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/bios/spi_device.hpp b/bios/spi_device.hpp
index d05ab89..4a9e6fc 100644
--- a/bios/spi_device.hpp
+++ b/bios/spi_device.hpp
@@ -81,6 +81,7 @@
// @returns true on success
sdbusplus::async::task<bool> unbindSPIFlash();
+ bool isSPIControllerBound();
bool isSPIFlashBound();
// @description preconditions: