aboutsummaryrefslogtreecommitdiff
path: root/hw/ast-bmc
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-11 01:26:20 -0500
commita43e9a66aae9812f8790c4a9290989bb0774d2a6 (patch)
tree50bab83728fcd989094f3529419ad343b4c8ae4a /hw/ast-bmc
parent9a830ee06c66058b1421c017b25a65a22921e9f6 (diff)
downloadskiboot-a43e9a66aae9812f8790c4a9290989bb0774d2a6.zip
skiboot-a43e9a66aae9812f8790c4a9290989bb0774d2a6.tar.gz
skiboot-a43e9a66aae9812f8790c4a9290989bb0774d2a6.tar.bz2
astbmc: Fail SFC init if SIO is unavailable
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>
Diffstat (limited to 'hw/ast-bmc')
-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