summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-08-04 13:00:15 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:26 -0700
commit28712fabe2977072b6218ceb56ce04958132ae60 (patch)
treedbfefcde663306247932810a69d9c371ec673baf /drivers/mtd
parent6997831ccea6f31ba6994fb7c818ee8c4e763f74 (diff)
Update the macronix SPI flash driver to use the new spi_xfer interface.
This chip is used on x86-alex, so the driver needs to be compilable. BUG=chrome-os-partner:4722 TEST=Built and booted x86-alex with other SPI changes and the Macronix driver turned on, saw that the chip was recognized. Change-Id: Ib7386140cb180be85e7c7ce58d581c2769650c11 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/5380
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi/macronix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/spi/macronix.c b/drivers/mtd/spi/macronix.c
index ff66f2aa35..9bb43893cb 100644
--- a/drivers/mtd/spi/macronix.c
+++ b/drivers/mtd/spi/macronix.c
@@ -49,6 +49,8 @@
#define CMD_MX25XX_DP 0xb9 /* Deep Power-down */
#define CMD_MX25XX_RES 0xab /* Release from DP, and Read Signature */
+#define MACRONIX_SR_WIP (1 << 0) /* Write-in-Progress */
+
struct macronix_spi_flash_params {
u16 idcode;
u16 page_size;
@@ -210,7 +212,11 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
mcx->flash.write = macronix_write;
mcx->flash.erase = macronix_erase;
+#ifdef CONFIG_SPI_FLASH_MACRONIX_NO_FAST_READ
+ mcx->flash.read = spi_flash_cmd_read_slow;
+#else
mcx->flash.read = spi_flash_cmd_read_fast;
+#endif
mcx->flash.sector_size = params->page_size * params->pages_per_sector
* params->sectors_per_block;
mcx->flash.size = mcx->flash.sector_size * params->nr_blocks;