[PATCH linux dev-4.7 12/12] mtd: spi-nor: aspeed: use fast read when doing DMAs
Cédric Le Goater
clg at kaod.org
Fri Oct 14 23:38:04 AEDT 2016
Try to improve the speed of transfers when doing DMAs
Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
drivers/mtd/spi-nor/aspeed-smc.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
index ae2d9bc643c3..40e48372865a 100644
--- a/drivers/mtd/spi-nor/aspeed-smc.c
+++ b/drivers/mtd/spi-nor/aspeed-smc.c
@@ -211,6 +211,7 @@ enum smc_ctl_reg_value {
smc_base, /* base value without mode for other commands */
smc_read, /* command reg for (maybe fast) reads */
smc_write, /* command reg for writes with timings */
+ smc_fread, /* command reg for (maybe faster?) reads */
smc_num_ctl_reg_values /* last value to get count of commands */
};
@@ -347,9 +348,6 @@ static inline void aspeed_smc_chip_configure(struct aspeed_smc_per_chip *chip,
writel(ctl, chip->ctl);
}
-/*
- * TODO: configure FREAD mode
- */
static int aspeed_smc_dma_start(struct aspeed_smc_per_chip *chip,
u32 offset, void *buf, size_t length,
int is_write)
@@ -359,7 +357,7 @@ static int aspeed_smc_dma_start(struct aspeed_smc_per_chip *chip,
int ret;
aspeed_smc_chip_configure(chip, is_write ? chip->ctl_val[smc_write] :
- chip->ctl_val[smc_base]);
+ chip->ctl_val[smc_fread]);
dev_dbg(chip->nor.dev, "DMA %s to=0x%08x len=0x%08x\n",
is_write ? "write" : "read", offset, length);
@@ -823,6 +821,11 @@ static int aspeed_smc_probe(struct platform_device *pdev)
if (err)
continue;
+ chip->ctl_val[smc_fread] = chip->ctl_val[smc_base] |
+ /* Not sure this is that fast */
+ spi_control_fill_opcode(SPINOR_OP_READ_FAST) |
+ CONTROL_SPI_COMMAND_MODE_FREAD;
+
chip->ctl_val[smc_write] = chip->ctl_val[smc_base] |
spi_control_fill_opcode(chip->nor.program_opcode) |
CONTROL_SPI_COMMAND_MODE_WRITE;
--
2.7.4
More information about the openbmc
mailing list