Commit 0b78a2cf authored by Huang Shijie's avatar Huang Shijie Committed by Brian Norris

mtd: spi-nor: fix the wrong dummy value

For the DDR Quad read, the dummy cycles maybe 3 or 6 which is less then 8.
The dummy cycles is actually 8 for SPI fast/dual/quad read.

This patch makes preparations for the DDR quad read, it fixes the wrong dummy
value for both the spi-nor.c and m25p80.c.
Signed-off-by: default avatarHuang Shijie <b32955@freescale.com>
Acked-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 438320dd
...@@ -128,9 +128,12 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len, ...@@ -128,9 +128,12 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
struct spi_device *spi = flash->spi; struct spi_device *spi = flash->spi;
struct spi_transfer t[2]; struct spi_transfer t[2];
struct spi_message m; struct spi_message m;
int dummy = nor->read_dummy; unsigned int dummy = nor->read_dummy;
int ret; int ret;
/* convert the dummy cycles to the number of bytes */
dummy /= 8;
/* Wait till previous write/erase is done. */ /* Wait till previous write/erase is done. */
ret = nor->wait_till_ready(nor); ret = nor->wait_till_ready(nor);
if (ret) if (ret)
......
...@@ -98,7 +98,7 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor) ...@@ -98,7 +98,7 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor)
case SPI_NOR_FAST: case SPI_NOR_FAST:
case SPI_NOR_DUAL: case SPI_NOR_DUAL:
case SPI_NOR_QUAD: case SPI_NOR_QUAD:
return 1; return 8;
case SPI_NOR_NORMAL: case SPI_NOR_NORMAL:
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment