summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf_ops.c
diff options
context:
space:
mode:
authorJagannadha Sutradharudu Teki <jaganna@xilinx.com>2013-12-26 14:13:36 +0530
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>2014-01-11 16:51:37 +0530
commit067951223e3305fce3df972c1970f6ab1ef15e98 (patch)
tree3d6b69cffb9047178d7c4b17232b8b4b5b8d3212 /drivers/mtd/spi/sf_ops.c
parentff063ed4808e4ead3021eaf53ee4fdb80c9e91f8 (diff)
downloadu-boot-imx-067951223e3305fce3df972c1970f6ab1ef15e98.zip
u-boot-imx-067951223e3305fce3df972c1970f6ab1ef15e98.tar.gz
u-boot-imx-067951223e3305fce3df972c1970f6ab1ef15e98.tar.bz2
sf: Add macronix set QEB support
This patch adds set QEB support for macronix flash devices which are trying to program/read quad operations. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Diffstat (limited to 'drivers/mtd/spi/sf_ops.c')
-rw-r--r--drivers/mtd/spi/sf_ops.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 6adee32..05fbcbd 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -39,6 +39,32 @@ int spi_flash_cmd_write_status(struct spi_flash *flash, u8 sr)
return 0;
}
+#ifdef CONFIG_SPI_FLASH_MACRONIX
+int spi_flash_set_qeb_mxic(struct spi_flash *flash)
+{
+ u8 qeb_status;
+ u8 cmd;
+ int ret;
+
+ cmd = CMD_READ_STATUS;
+ ret = spi_flash_read_common(flash, &cmd, 1, &qeb_status, 1);
+ if (ret < 0) {
+ debug("SF: fail to read status register\n");
+ return ret;
+ }
+
+ if (qeb_status & STATUS_QEB_MXIC) {
+ debug("SF: Quad enable bit is already set\n");
+ } else {
+ ret = spi_flash_cmd_write_status(flash, STATUS_QEB_MXIC);
+ if (ret < 0)
+ return ret;
+ }
+
+ return ret;
+}
+#endif
+
#if defined(CONFIG_SPI_FLASH_SPANSION) || defined(CONFIG_SPI_FLASH_WINBOND)
static int spi_flash_cmd_write_config(struct spi_flash *flash, u8 cr)
{