[PATCH linux dev-4.10 2/3] mtd: spi-nor: aspeed: fix physical base address of chip

Cédric Le Goater clg at kaod.org
Thu Mar 23 19:42:36 AEDT 2017


The phys_base address is used to trigger DMAs on a chip and to address
the correct CS, it should take into account the offset of the chip in
the AHB bus window.

Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 drivers/mtd/spi-nor/aspeed-smc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
index d5d8b2d6e06b..b3c8cfe29765 100644
--- a/drivers/mtd/spi-nor/aspeed-smc.c
+++ b/drivers/mtd/spi-nor/aspeed-smc.c
@@ -693,7 +693,7 @@ static int aspeed_smc_chip_setup_init(struct aspeed_smc_chip *chip,
 		return -EINVAL;
 	}
 
-	chip->phys_base = res->start;
+	chip->phys_base = res->start + (chip->ahb_base - controller->ahb_base);
 
 	/*
 	 * Get value of the inherited control register. U-Boot usually
-- 
2.7.4



More information about the openbmc mailing list