diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-03-28 06:41:09 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-04-02 06:50:21 -0400 |
commit | 0dcdbb172c2fdf60c5c578980308b312fd56496f (patch) | |
tree | 6f1680e9e84ef057e8d4e308f04d127f95994fb4 /drivers/mtd/spi/spansion.c | |
parent | 9726ba4abaa16cd6c385ad350d403f98a8eacf52 (diff) | |
download | u-boot-imx-0dcdbb172c2fdf60c5c578980308b312fd56496f.zip u-boot-imx-0dcdbb172c2fdf60c5c578980308b312fd56496f.tar.gz u-boot-imx-0dcdbb172c2fdf60c5c578980308b312fd56496f.tar.bz2 |
sf: always read 5 bytes for the idcode
Some SPI flash drivers like to have extended id information available
(like the spansion flash), so rather than making it re-issue the ID cmd
to get at the last 2 bytes, have the common code read 5 bytes rather than
just 3. This also matches the Linux behavior where it always reads 5 id
bytes from all flashes.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
CC: Mingkai Hu <Mingkai.hu@freescale.com>
Diffstat (limited to 'drivers/mtd/spi/spansion.c')
-rw-r--r-- | drivers/mtd/spi/spansion.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c index 3dcccd3..fdb7917 100644 --- a/drivers/mtd/spi/spansion.c +++ b/drivers/mtd/spi/spansion.c @@ -310,15 +310,9 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode) struct spansion_spi_flash *spsn; unsigned int i; unsigned short jedec, ext_jedec; - int ret; - u8 id[5] = {0}; - - ret = spi_flash_cmd(spi, CMD_READ_ID, id, sizeof(id)); - if (ret) - return NULL; - jedec = id[1] << 8 | id[2]; - ext_jedec = id[3] << 8 | id[4]; + jedec = idcode[1] << 8 | idcode[2]; + ext_jedec = idcode[3] << 8 | idcode[4]; for (i = 0; i < ARRAY_SIZE(spansion_spi_flash_table); i++) { params = &spansion_spi_flash_table[i]; |