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

Cédric Le Goater clg at kaod.org
Sat Mar 25 01:44:39 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>
Reviewed-by: Joel Stanley <joel at jms.id.au>
---
 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