aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-10-09 00:32:37 -0700
committerStewart Smith <stewart@linux.ibm.com>2018-10-31 17:33:34 +1100
commite4197f8b56b4290956a1feeeb6f7c202c94e73d8 (patch)
tree26e6b43623e6cf33303f240ca93793ce678816c5
parentd2649636ba4d18dc1553d68b7bb640a9ed141381 (diff)
downloadskiboot-e4197f8b56b4290956a1feeeb6f7c202c94e73d8.zip
skiboot-e4197f8b56b4290956a1feeeb6f7c202c94e73d8.tar.gz
skiboot-e4197f8b56b4290956a1feeeb6f7c202c94e73d8.tar.bz2
astbmc: Fail SFC init if SIO is unavailable
[ Upstream commit a43e9a66aae9812f8790c4a9290989bb0774d2a6 ] If SuperIO is unavailable then the driver cannot perform accesses on which it currently depends. Test for SuperIO availability during initialsation and bail out immediately if it is absent. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r--hw/ast-bmc/ast-sf-ctrl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/ast-bmc/ast-sf-ctrl.c b/hw/ast-bmc/ast-sf-ctrl.c
index 32fc63a..11eb30f 100644
--- a/hw/ast-bmc/ast-sf-ctrl.c
+++ b/hw/ast-bmc/ast-sf-ctrl.c
@@ -948,6 +948,9 @@ int ast_sf_open(uint8_t type, struct spi_flash_ctrl **ctrl)
struct ast_sf_ctrl *ct;
#ifdef __SKIBOOT__
uint32_t hicr7;
+
+ if (!ast_sio_is_enabled())
+ return -ENODEV;
#endif /* __SKIBOOT__ */
if (type != AST_SF_TYPE_PNOR && type != AST_SF_TYPE_BMC