From 6677d2cefb60103156db713e2cdffb02b4a2d270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 7 Dec 2015 10:54:23 +0100 Subject: libflash: fix 4bytes address enablement on BMC SPI flash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e25f3f3559d9 ("libflash: enable 4b mode on BMC SPI flash") added a setting for 4byte addresses on the BMC SPI flash when needed. This setting should be only done for the BMC flash, which is not the case in the current code. This patch fixes it. Signed-off-by: Cédric Le Goater Reviewed-by: Joel Stanley Signed-off-by: Stewart Smith --- hw/ast-bmc/ast-sf-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/ast-bmc') diff --git a/hw/ast-bmc/ast-sf-ctrl.c b/hw/ast-bmc/ast-sf-ctrl.c index d18031a..bf42d32 100644 --- a/hw/ast-bmc/ast-sf-ctrl.c +++ b/hw/ast-bmc/ast-sf-ctrl.c @@ -178,7 +178,7 @@ static int ast_sf_set_4b(struct spi_flash_ctrl *ctrl, bool enable) /* Update read mode */ ast_ahb_writel(ct->ctl_read_val, ct->ctl_reg); - if (ce_ctrl) + if (ce_ctrl && ct->type == AST_SF_TYPE_BMC) ast_ahb_writel(ce_ctrl, BMC_SPI_FCTL_CE_CTRL); return 0; -- cgit v1.1