This patch provides support to program a flash extended address
register for winbond and stmicro SPI flashes.

Signed-off-by: Jagannadha Sutradharudu Teki <[email protected]>
---
Changes for v2:
        - none

 drivers/mtd/spi/spi_flash.c          | 2 ++
 drivers/mtd/spi/spi_flash_internal.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 193de42..05d1792 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -286,6 +286,8 @@ int spi_flash_cmd_bankaddr_write(struct spi_flash *flash, 
u8 bank_sel)
        idcode0 = flash->idcode0;
        if (idcode0 == 0x01) {
                cmd = CMD_BANKADDR_BRWR;
+       } else if ((idcode0 == 0xef) || (idcode0 == 0x20)) {
+               cmd = CMD_EXTNADDR_WREAR;
        } else {
                printf("SF: Unsupported bank addr write %02x\n", idcode0);
                return -1;
diff --git a/drivers/mtd/spi/spi_flash_internal.h 
b/drivers/mtd/spi/spi_flash_internal.h
index 2567bbc..de1a0df 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -31,6 +31,7 @@
 /* Bank addr acess commands */
 #define CMD_BANKADDR_BRWR              0x17
 #define CMD_BANKADDR_BRRD              0x16
+#define CMD_EXTNADDR_WREAR             0xC5
 
 /* Common status */
 #define STATUS_WIP                     0x01
-- 
1.8.3


_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to