diff mbox series

[U-Boot] driver/mtd/spi: Default page size Spansion flash "S25FS512S" is 256b

Message ID 1525689107-8575-1-git-send-email-Ashish.Kumar@nxp.com
State Accepted
Commit 4eaa2fa16968359ffcf207e63848ed7f3a6e4309
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [U-Boot] driver/mtd/spi: Default page size Spansion flash "S25FS512S" is 256b | expand

Commit Message

Ashish Kumar May 7, 2018, 10:31 a.m. UTC
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
---
 drivers/mtd/spi/spi_flash.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Jagan Teki May 9, 2018, 11:13 a.m. UTC | #1
On Mon, May 7, 2018 at 4:01 PM, Ashish Kumar <Ashish.Kumar@nxp.com> wrote:
> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> ---
>  drivers/mtd/spi/spi_flash.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 3d24a08..ce420cb 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -1046,14 +1046,15 @@ int spi_flash_scan(struct spi_flash *flash)
>         flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
>         flash->page_size = info->page_size;
>         /*
> -        * The Spansion S25FL032P and S25FL064P have 256b pages, yet use the
> -        * 0x4d00 Extended JEDEC code. The rest of the Spansion flashes with
> -        * the 0x4d00 Extended JEDEC code have 512b pages. All of the others
> -        * have 256b pages.
> +        * The Spansion S25FS512S, S25FL032P and S25FL064P have 256b pages,
> +        * yet use the 0x4d00 Extended JEDEC code. The rest of the Spansion
> +        * flashes with the 0x4d00 Extended JEDEC code have 512b pages.
> +        * All of the others have 256b pages.
>          */
>         if (JEDEC_EXT(info) == 0x4d00) {
>                 if ((JEDEC_ID(info) != 0x0215) &&
> -                   (JEDEC_ID(info) != 0x0216))
> +                   (JEDEC_ID(info) != 0x0216) &&
> +                   (JEDEC_ID(info) != 0x0220))

0220 is JEDEC ID for S25FS512S which is 512 is it? commit message says 256b?
Ashish Kumar May 10, 2018, 5:03 a.m. UTC | #2
> -----Original Message-----
> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]
> Sent: Wednesday, May 9, 2018 4:44 PM
> To: Ashish Kumar <ashish.kumar@nxp.com>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>
> Subject: Re: [U-Boot] [PATCH] driver/mtd/spi: Default page size Spansion flash
> "S25FS512S" is 256b
> 
> On Mon, May 7, 2018 at 4:01 PM, Ashish Kumar <Ashish.Kumar@nxp.com>
> wrote:
> > Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
> > ---
> >  drivers/mtd/spi/spi_flash.c | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> > index 3d24a08..ce420cb 100644
> > --- a/drivers/mtd/spi/spi_flash.c
> > +++ b/drivers/mtd/spi/spi_flash.c
> > @@ -1046,14 +1046,15 @@ int spi_flash_scan(struct spi_flash *flash)
> >         flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
> >         flash->page_size = info->page_size;
> >         /*
> > -        * The Spansion S25FL032P and S25FL064P have 256b pages, yet use the
> > -        * 0x4d00 Extended JEDEC code. The rest of the Spansion flashes with
> > -        * the 0x4d00 Extended JEDEC code have 512b pages. All of the others
> > -        * have 256b pages.
> > +        * The Spansion S25FS512S, S25FL032P and S25FL064P have 256b pages,
> > +        * yet use the 0x4d00 Extended JEDEC code. The rest of the Spansion
> > +        * flashes with the 0x4d00 Extended JEDEC code have 512b pages.
> > +        * All of the others have 256b pages.
> >          */
> >         if (JEDEC_EXT(info) == 0x4d00) {
> >                 if ((JEDEC_ID(info) != 0x0215) &&
> > -                   (JEDEC_ID(info) != 0x0216))
> > +                   (JEDEC_ID(info) != 0x0216) &&
> > +                   (JEDEC_ID(info) != 0x0220))
> 
> 0220 is JEDEC ID for S25FS512S which is 512 is it? commit message says 256b?
Yes, 0220 is for S25FS512S. The loops says all JEDEC EXT starting 0x4d00 is 512b, except 215,216 and 220.

Regards
Ashish
Jagan Teki May 16, 2018, 1:28 p.m. UTC | #3
On Thu, May 10, 2018 at 10:33 AM, Ashish Kumar <ashish.kumar@nxp.com> wrote:
>
>
>> -----Original Message-----
>> From: Jagan Teki [mailto:jagannadh.teki@gmail.com]
>> Sent: Wednesday, May 9, 2018 4:44 PM
>> To: Ashish Kumar <ashish.kumar@nxp.com>
>> Cc: U-Boot Mailing List <u-boot@lists.denx.de>
>> Subject: Re: [U-Boot] [PATCH] driver/mtd/spi: Default page size Spansion flash
>> "S25FS512S" is 256b
>>
>> On Mon, May 7, 2018 at 4:01 PM, Ashish Kumar <Ashish.Kumar@nxp.com>
>> wrote:
>> > Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
>> > ---
>> >  drivers/mtd/spi/spi_flash.c | 11 ++++++-----
>> >  1 file changed, 6 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
>> > index 3d24a08..ce420cb 100644
>> > --- a/drivers/mtd/spi/spi_flash.c
>> > +++ b/drivers/mtd/spi/spi_flash.c
>> > @@ -1046,14 +1046,15 @@ int spi_flash_scan(struct spi_flash *flash)
>> >         flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
>> >         flash->page_size = info->page_size;
>> >         /*
>> > -        * The Spansion S25FL032P and S25FL064P have 256b pages, yet use the
>> > -        * 0x4d00 Extended JEDEC code. The rest of the Spansion flashes with
>> > -        * the 0x4d00 Extended JEDEC code have 512b pages. All of the others
>> > -        * have 256b pages.
>> > +        * The Spansion S25FS512S, S25FL032P and S25FL064P have 256b pages,
>> > +        * yet use the 0x4d00 Extended JEDEC code. The rest of the Spansion
>> > +        * flashes with the 0x4d00 Extended JEDEC code have 512b pages.
>> > +        * All of the others have 256b pages.
>> >          */
>> >         if (JEDEC_EXT(info) == 0x4d00) {
>> >                 if ((JEDEC_ID(info) != 0x0215) &&
>> > -                   (JEDEC_ID(info) != 0x0216))
>> > +                   (JEDEC_ID(info) != 0x0216) &&
>> > +                   (JEDEC_ID(info) != 0x0220))
>>
>> 0220 is JEDEC ID for S25FS512S which is 512 is it? commit message says 256b?
> Yes, 0220 is for S25FS512S. The loops says all JEDEC EXT starting 0x4d00 is 512b, except 215,216 and 220.

Added proper commit message and

Applied to u-boot-spi/master
diff mbox series

Patch

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 3d24a08..ce420cb 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1046,14 +1046,15 @@  int spi_flash_scan(struct spi_flash *flash)
 	flash->shift = (flash->dual_flash & SF_DUAL_PARALLEL_FLASH) ? 1 : 0;
 	flash->page_size = info->page_size;
 	/*
-	 * The Spansion S25FL032P and S25FL064P have 256b pages, yet use the
-	 * 0x4d00 Extended JEDEC code. The rest of the Spansion flashes with
-	 * the 0x4d00 Extended JEDEC code have 512b pages. All of the others
-	 * have 256b pages.
+	 * The Spansion S25FS512S, S25FL032P and S25FL064P have 256b pages,
+	 * yet use the 0x4d00 Extended JEDEC code. The rest of the Spansion
+	 * flashes with the 0x4d00 Extended JEDEC code have 512b pages.
+	 * All of the others have 256b pages.
 	 */
 	if (JEDEC_EXT(info) == 0x4d00) {
 		if ((JEDEC_ID(info) != 0x0215) &&
-		    (JEDEC_ID(info) != 0x0216))
+		    (JEDEC_ID(info) != 0x0216) &&
+		    (JEDEC_ID(info) != 0x0220))
 			flash->page_size = 512;
 	}
 	flash->page_size <<= flash->shift;