[Skiboot] [PATCH] libflash: fix 4bytes address enablement on BMC SPI flash

Cédric Le Goater clg at fr.ibm.com
Mon Dec 7 20:54:23 AEDT 2015

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 <clg at fr.ibm.com>

 I suppose we could have a ast_sf_set_4b() routine for each type of
 flash. Would it make the code clearer ? 

 hw/ast-bmc/ast-sf-ctrl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: skiboot.git/hw/ast-bmc/ast-sf-ctrl.c
--- skiboot.git.orig/hw/ast-bmc/ast-sf-ctrl.c
+++ skiboot.git/hw/ast-bmc/ast-sf-ctrl.c
@@ -178,7 +178,7 @@ static int ast_sf_set_4b(struct spi_flas
 	/* 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;

More information about the Skiboot mailing list