Message ID | 36cddb16-bb23-4ed6-93d9-393d5677ffd8@CO9EHSMHS021.ehs.local |
---|---|
State | Superseded |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show |
On Tue, Jun 11, 2013 at 12:23 PM, Jagannadha Sutradharudu Teki < jagannadha.sutradharudu-teki@xilinx.com> wrote: > This patch provides support to program a flash extended address > register for winbond and stmicro SPI flashes. > > Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> > Reviewed-by: Simon Glass <sjg@chromium.org> Looks good, same comment as previous patch. > --- > Changes for v3: > - none > 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 > > >
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
This patch provides support to program a flash extended address register for winbond and stmicro SPI flashes. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> --- Changes for v3: - none Changes for v2: - none drivers/mtd/spi/spi_flash.c | 2 ++ drivers/mtd/spi/spi_flash_internal.h | 1 + 2 files changed, 3 insertions(+)