Patchwork [U-Boot,2/4] sf: Add bank addr access support macronix flash's

login
register
mail settings
Submitter Jagannadha Sutradharudu Teki
Date July 29, 2013, 6:08 p.m.
Message ID <44ee45c2-e5af-47ce-a27b-63a4134eac53@CH1EHSMHS008.ehs.local>
Download mbox | patch
Permalink /patch/262929/
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Comments

Jagannadha Sutradharudu Teki - July 29, 2013, 6:08 p.m.
This patch adds bank addr access support for macronix flash's
so-that the macronix flashes which has > 16Mbyte sizes can be
accessible in 3-byte addressing mode.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
---
 drivers/mtd/spi/spi_flash.c          | 1 +
 drivers/mtd/spi/spi_flash_internal.h | 1 +
 2 files changed, 2 insertions(+)

Patch

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 9814395..2528ebc 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -371,6 +371,7 @@  int spi_flash_bank_config(struct spi_flash *flash, u8 idcode0)
 		break;
 	case SPI_FLASH_STMICRO_IDCODE0:
 	case SPI_FLASH_WINBOND_IDCODE0:
+	case SPI_FLASH_MACRONIX_IDCODE0:
 		flash->bank_read_cmd = CMD_EXTNADDR_RDEAR;
 		flash->bank_write_cmd = CMD_EXTNADDR_WREAR;
 		break;
diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h
index 20eed7c..30b2749 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -36,6 +36,7 @@ 
 # define SPI_FLASH_SPANSION_IDCODE0	0x01
 # define SPI_FLASH_STMICRO_IDCODE0	0x20
 # define SPI_FLASH_WINBOND_IDCODE0	0xef
+# define SPI_FLASH_MACRONIX_IDCODE0	0xc2
 
 /* Bank addr access commands */
 # define CMD_BANKADDR_BRWR		0x17