diff options
author | Cédric Le Goater <clg@kaod.org> | 2019-04-17 16:39:40 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2021-11-01 09:42:40 +0300 |
commit | 8519d93e110c7c9502674a3031ffa66129364820 (patch) | |
tree | 31ef978d3cd243299a00b8f54986641d18dae6eb | |
parent | f3aff9a3d438e311a6b4a317a0599a4eb903d19d (diff) | |
download | linux-8519d93e110c7c9502674a3031ffa66129364820.tar.xz |
mtd: spi-nor: aspeed: use memcpy_fromio() to capture the optimization buffer
aspeed_smc_read_from_ahb() only reads the first word which is not what
we want. We want to capture a CALIBRATE_BUF_SIZE size window of the
flash contents to optimize the read.
OpenBMC-Staging-Count: 10
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r-- | drivers/mtd/spi-nor/controllers/aspeed-smc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/spi-nor/controllers/aspeed-smc.c b/drivers/mtd/spi-nor/controllers/aspeed-smc.c index 94df75c60b04..74e88087a1d0 100644 --- a/drivers/mtd/spi-nor/controllers/aspeed-smc.c +++ b/drivers/mtd/spi-nor/controllers/aspeed-smc.c @@ -793,8 +793,7 @@ static bool aspeed_smc_check_reads(struct aspeed_smc_chip *chip, int i; for (i = 0; i < 10; i++) { - aspeed_smc_read_from_ahb(test_buf, chip->ahb_base, - CALIBRATE_BUF_SIZE); + memcpy_fromio(test_buf, chip->ahb_base, CALIBRATE_BUF_SIZE); if (memcmp(test_buf, golden_buf, CALIBRATE_BUF_SIZE) != 0) return false; } @@ -918,8 +917,7 @@ static int aspeed_smc_optimize_read(struct aspeed_smc_chip *chip, writel(chip->ctl_val[smc_read], chip->ctl); - aspeed_smc_read_from_ahb(golden_buf, chip->ahb_base, - CALIBRATE_BUF_SIZE); + memcpy_fromio(golden_buf, chip->ahb_base, CALIBRATE_BUF_SIZE); /* Establish our read mode with freq field set to 0 (HCLK/16) */ chip->ctl_val[smc_read] = save_read_val & 0xfffff0ff; |