From a43e9a66aae9812f8790c4a9290989bb0774d2a6 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Tue, 9 Oct 2018 00:32:37 -0700 Subject: 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 Signed-off-by: Stewart Smith --- hw/ast-bmc/ast-sf-ctrl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/ast-bmc') 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 -- cgit v1.1