diff mbox

[U-Boot,v3,04/17] sf: Add extended addr read support for winbond|stmicro

Message ID 5a08be5f-dbf5-4aaf-a76c-2d973e571788@CO1EHSMHS003.ehs.local
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagannadha Sutradharudu Teki June 11, 2013, 7:23 p.m. UTC
This patch provides support to read 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(+)

Comments

Simon Glass June 12, 2013, 10:19 p.m. UTC | #1
On Tue, Jun 11, 2013 at 12:23 PM, Jagannadha Sutradharudu Teki <
jagannadha.sutradharudu-teki@xilinx.com> wrote:

> This patch provides support to read 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>

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 05d1792..66b6b14 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -321,6 +321,8 @@ int spi_flash_cmd_bankaddr_read(struct spi_flash
> *flash, void *data)
>
>         if (idcode0 == 0x01) {
>                 cmd = CMD_BANKADDR_BRRD;
> +       } else if ((idcode0 == 0xef) || (idcode0 == 0x20)) {
> +               cmd = CMD_EXTNADDR_RDEAR;
>         } else {
>                 printf("SF: Unsupported bank addr read %02x\n", idcode0);
>                 return -1;
> diff --git a/drivers/mtd/spi/spi_flash_internal.h
> b/drivers/mtd/spi/spi_flash_internal.h
> index de1a0df..1b29e2d 100644
> --- a/drivers/mtd/spi/spi_flash_internal.h
> +++ b/drivers/mtd/spi/spi_flash_internal.h
> @@ -32,6 +32,7 @@
>  #define CMD_BANKADDR_BRWR              0x17
>  #define CMD_BANKADDR_BRRD              0x16
>  #define CMD_EXTNADDR_WREAR             0xC5
> +#define CMD_EXTNADDR_RDEAR             0xC8
>
>  /* Common status */
>  #define STATUS_WIP                     0x01
> --
> 1.8.3
>
>
>
diff mbox

Patch

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 05d1792..66b6b14 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -321,6 +321,8 @@  int spi_flash_cmd_bankaddr_read(struct spi_flash *flash, void *data)
 
 	if (idcode0 == 0x01) {
 		cmd = CMD_BANKADDR_BRRD;
+	} else if ((idcode0 == 0xef) || (idcode0 == 0x20)) {
+		cmd = CMD_EXTNADDR_RDEAR;
 	} else {
 		printf("SF: Unsupported bank addr read %02x\n", idcode0);
 		return -1;
diff --git a/drivers/mtd/spi/spi_flash_internal.h b/drivers/mtd/spi/spi_flash_internal.h
index de1a0df..1b29e2d 100644
--- a/drivers/mtd/spi/spi_flash_internal.h
+++ b/drivers/mtd/spi/spi_flash_internal.h
@@ -32,6 +32,7 @@ 
 #define CMD_BANKADDR_BRWR		0x17
 #define CMD_BANKADDR_BRRD		0x16
 #define CMD_EXTNADDR_WREAR		0xC5
+#define CMD_EXTNADDR_RDEAR		0xC8
 
 /* Common status */
 #define STATUS_WIP			0x01