public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
@ 2016-06-22  7:58 Michael Trimarchi
  2016-06-22 10:00 ` Yao Yuan
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2016-06-22  7:58 UTC (permalink / raw)
  To: u-boot

The S25FS128 is part of S25FS-S family physical sectors may be
configured as a hybrid combination of eight 4-kB parameter sectors
at the top or bottom of the address space with all but one of the
remaining sectors being uniform size. This rework a bit commit

80c1bfd2332e71dfe669cac53ba06b7435a7ca39

and add this jedec part number

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 64d4e0f..c993588 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 #ifdef CONFIG_SPI_FLASH_SPANSION
+
+inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec)
+{
+	switch (jedec) {
+	case 0x0219:
+	case 0x0220:
+	case 0x2018:
+		if ((ext_jedec & 0xff00) == 0x4d00)
+			return 1;
+	default:;
+	}
+
+	return 0;
+}
+
 static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)
 {
 	u8 cmd[4];
@@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
 	 * sector that is not overlaid by the parameter sectors.
 	 * The uniform sector erase command has no effect on parameter sectors.
 	 */
-	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
-	    (ext_jedec & 0xff00) == 0x4d00) {
+	if (is_spansion_s25fss_family(jedec, ext_jedec)) {
 		int ret;
 		u8 id[6];
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-06-22  7:58 [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Michael Trimarchi
@ 2016-06-22 10:00 ` Yao Yuan
  2016-06-22 10:06   ` Michael Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Yao Yuan @ 2016-06-22 10:00 UTC (permalink / raw)
  To: u-boot

On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
> The S25FS128 is part of S25FS-S family physical sectors may be configured as a
> hybrid combination of eight 4-kB parameter sectors at the top or bottom of the
> address space with all but one of the remaining sectors being uniform size. This
> rework a bit commit
> 
> 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
> 
> and add this jedec part number
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> ---
>  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index
> 64d4e0f..c993588 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob, struct
> spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
> 
>  #ifdef CONFIG_SPI_FLASH_SPANSION
> +
> +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
> +	switch (jedec) {
> +	case 0x0219:
> +	case 0x0220:
> +	case 0x2018:
> +		if ((ext_jedec & 0xff00) == 0x4d00)
> +			return 1;
> +	default:;
> +	}
> +
> +	return 0;
> +}
> +
>  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
>  	u8 cmd[4];
> @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
>  	 * sector that is not overlaid by the parameter sectors.
>  	 * The uniform sector erase command has no effect on parameter
> sectors.
>  	 */
> -	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> -	    (ext_jedec & 0xff00) == 0x4d00) {
> +	if (is_spansion_s25fss_family(jedec, ext_jedec)) {
>  		int ret;
>  		u8 id[6];
> 
> --

Hi Michael, 
From some datasheet for spansion flash,
it seems all the spansion S25FS family should disable 4kb.
So how about just judge the idcode[0]?

Like:
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 64d4e0f..cfe3649 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1072,8 +1072,7 @@ int spi_flash_scan(struct spi_flash *flash)
         * sector that is not overlaid by the parameter sectors.
         * The uniform sector erase command has no effect on parameter sectors.
         */
-       if ((jedec == 0x0219 || (jedec == 0x0220)) &&
-           (ext_jedec & 0xff00) == 0x4d00) {
+       if (idcode[0] == SPI_FLASH_CFI_MFR_SPANSION) {
                int ret;
                u8 id[6];


How about your think?

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-06-22 10:00 ` Yao Yuan
@ 2016-06-22 10:06   ` Michael Trimarchi
  2016-06-22 10:14     ` Yao Yuan
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2016-06-22 10:06 UTC (permalink / raw)
  To: u-boot

Hi

On Wed, Jun 22, 2016 at 10:00:49AM +0000, Yao Yuan wrote:
> On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
> > The S25FS128 is part of S25FS-S family physical sectors may be configured as a
> > hybrid combination of eight 4-kB parameter sectors at the top or bottom of the
> > address space with all but one of the remaining sectors being uniform size. This
> > rework a bit commit
> > 
> > 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
> > 
> > and add this jedec part number
> > 
> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > ---
> >  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index
> > 64d4e0f..c993588 100644
> > --- a/drivers/mtd/spi/spi_flash.c
> > +++ b/drivers/mtd/spi/spi_flash.c
> > @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob, struct
> > spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
> > 
> >  #ifdef CONFIG_SPI_FLASH_SPANSION
> > +
> > +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
> > +	switch (jedec) {
> > +	case 0x0219:
> > +	case 0x0220:
> > +	case 0x2018:
> > +		if ((ext_jedec & 0xff00) == 0x4d00)
> > +			return 1;
> > +	default:;
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> >  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
> >  	u8 cmd[4];
> > @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
> >  	 * sector that is not overlaid by the parameter sectors.
> >  	 * The uniform sector erase command has no effect on parameter
> > sectors.
> >  	 */
> > -	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> > -	    (ext_jedec & 0xff00) == 0x4d00) {
> > +	if (is_spansion_s25fss_family(jedec, ext_jedec)) {
> >  		int ret;
> >  		u8 id[6];
> > 
> > --
> 
> Hi Michael, 
> From some datasheet for spansion flash,
> it seems all the spansion S25FS family should disable 4kb.
> So how about just judge the idcode[0]?
> 

I understand your point but I don't have enough part number and
I can only to test on this one. I will verify this patch too and 
put my review and drop my personal one. Anyway can you ask if
the first 0x8000 are considered by boot rom? I'm trying to boot
from qspi an imx7d board and I create the parameter using
the files/qspi-nor-spansion-s25fl128s-config but not sure if I need
to flash from 0x400 or from 0x8400. And then I think that bootloader
should go from 0x1000 or from 0x9000 correct?
Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
0x1000 or 0x400? 

> Like:
> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> index 64d4e0f..cfe3649 100644
> --- a/drivers/mtd/spi/spi_flash.c
> +++ b/drivers/mtd/spi/spi_flash.c
> @@ -1072,8 +1072,7 @@ int spi_flash_scan(struct spi_flash *flash)
>          * sector that is not overlaid by the parameter sectors.
>          * The uniform sector erase command has no effect on parameter sectors.
>          */
> -       if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> -           (ext_jedec & 0xff00) == 0x4d00) {
> +       if (idcode[0] == SPI_FLASH_CFI_MFR_SPANSION) {
>                 int ret;
>                 u8 id[6];
> 
> 
> How about your think?

For me is fine if you are sure

Michael

> 
> 
> 

-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-06-22 10:06   ` Michael Trimarchi
@ 2016-06-22 10:14     ` Yao Yuan
  2016-06-22 10:55       ` [U-Boot] Booting imx7d from qspi using spansion flash (WAS Re: [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128) Michael Trimarchi
  2016-08-06 14:37       ` [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Jagan Teki
  0 siblings, 2 replies; 9+ messages in thread
From: Yao Yuan @ 2016-06-22 10:14 UTC (permalink / raw)
  To: u-boot

On 06/22/2016 06:08 PM, Michael Trimarchi wrote:
> On Wed, Jun 22, 2016 at 10:00:49AM +0000, Yao Yuan wrote:
> > On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
> > > The S25FS128 is part of S25FS-S family physical sectors may be
> > > configured as a hybrid combination of eight 4-kB parameter sectors
> > > at the top or bottom of the address space with all but one of the
> > > remaining sectors being uniform size. This rework a bit commit
> > >
> > > 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
> > >
> > > and add this jedec part number
> > >
> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > ---
> > >  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
> > >  1 file changed, 16 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/mtd/spi/spi_flash.c
> > > b/drivers/mtd/spi/spi_flash.c index
> > > 64d4e0f..c993588 100644
> > > --- a/drivers/mtd/spi/spi_flash.c
> > > +++ b/drivers/mtd/spi/spi_flash.c
> > > @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob,
> > > struct spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
> > >
> > >  #ifdef CONFIG_SPI_FLASH_SPANSION
> > > +
> > > +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
> > > +	switch (jedec) {
> > > +	case 0x0219:
> > > +	case 0x0220:
> > > +	case 0x2018:
> > > +		if ((ext_jedec & 0xff00) == 0x4d00)
> > > +			return 1;
> > > +	default:;
> > > +	}
> > > +
> > > +	return 0;
> > > +}
> > > +
> > >  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
> > >  	u8 cmd[4];
> > > @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
> > >  	 * sector that is not overlaid by the parameter sectors.
> > >  	 * The uniform sector erase command has no effect on parameter
> > > sectors.
> > >  	 */
> > > -	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> > > -	    (ext_jedec & 0xff00) == 0x4d00) {
> > > +	if (is_spansion_s25fss_family(jedec, ext_jedec)) {
> > >  		int ret;
> > >  		u8 id[6];
> > >
> > > --
> >
> > Hi Michael,
> > From some datasheet for spansion flash, it seems all the spansion
> > S25FS family should disable 4kb.
> > So how about just judge the idcode[0]?
> >
> 
> I understand your point but I don't have enough part number and I can only to
> test on this one. I will verify this patch too and put my review and drop my
> personal one. Anyway can you ask if the first 0x8000 are considered by boot
> rom? I'm trying to boot from qspi an imx7d board and I create the parameter
> using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
> from 0x400 or from 0x8400. And then I think that bootloader should go from
> 0x1000 or from 0x9000 correct?
> Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
> 0x1000 or 0x400?
> 

I'm not sure what's the offset for imx7d, but for NXP LS series SOC.
The RCW_PBI offset: 0x0
The Uboot offset is defined by RCW_PBI code.(Such as 0x10000)

> > Like:
> > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> > index 64d4e0f..cfe3649 100644
> > --- a/drivers/mtd/spi/spi_flash.c
> > +++ b/drivers/mtd/spi/spi_flash.c
> > @@ -1072,8 +1072,7 @@ int spi_flash_scan(struct spi_flash *flash)
> >          * sector that is not overlaid by the parameter sectors.
> >          * The uniform sector erase command has no effect on parameter sectors.
> >          */
> > -       if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> > -           (ext_jedec & 0xff00) == 0x4d00) {
> > +       if (idcode[0] == SPI_FLASH_CFI_MFR_SPANSION) {
> >                 int ret;
> >                 u8 id[6];
> >
> >
> > How about your think?
> 
> For me is fine if you are sure
> 
> Michael
> 
> >
> >
> >
> 
> --
> | Michael Nazzareno Trimarchi                     Amarula Solutions BV |
> | COO  -  Founder                                      Cruquiuskade 47 |
> | +31(0)851119172                                 Amsterdam 1018 AM NL |
> |                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Booting imx7d from qspi using spansion flash (WAS Re: [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128)
  2016-06-22 10:14     ` Yao Yuan
@ 2016-06-22 10:55       ` Michael Trimarchi
  2016-08-06 14:37       ` [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Jagan Teki
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Trimarchi @ 2016-06-22 10:55 UTC (permalink / raw)
  To: u-boot

Hi Ye.Li

On Wed, Jun 22, 2016 at 10:14:29AM +0000, Yao Yuan wrote:
> On 06/22/2016 06:08 PM, Michael Trimarchi wrote:
> > On Wed, Jun 22, 2016 at 10:00:49AM +0000, Yao Yuan wrote:
> > > On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
> > > > The S25FS128 is part of S25FS-S family physical sectors may be
> > > > configured as a hybrid combination of eight 4-kB parameter sectors
> > > > at the top or bottom of the address space with all but one of the
> > > > remaining sectors being uniform size. This rework a bit commit
> > > >
> > > > 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
> > > >
> > > > and add this jedec part number
> > > >
> > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > ---
> > > >  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
> > > >  1 file changed, 16 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/mtd/spi/spi_flash.c
> > > > b/drivers/mtd/spi/spi_flash.c index
> > > > 64d4e0f..c993588 100644
> > > > --- a/drivers/mtd/spi/spi_flash.c
> > > > +++ b/drivers/mtd/spi/spi_flash.c
> > > > @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob,
> > > > struct spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
> > > >
> > > >  #ifdef CONFIG_SPI_FLASH_SPANSION
> > > > +
> > > > +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
> > > > +	switch (jedec) {
> > > > +	case 0x0219:
> > > > +	case 0x0220:
> > > > +	case 0x2018:
> > > > +		if ((ext_jedec & 0xff00) == 0x4d00)
> > > > +			return 1;
> > > > +	default:;
> > > > +	}
> > > > +
> > > > +	return 0;
> > > > +}
> > > > +
> > > >  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
> > > >  	u8 cmd[4];
> > > > @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
> > > >  	 * sector that is not overlaid by the parameter sectors.
> > > >  	 * The uniform sector erase command has no effect on parameter
> > > > sectors.
> > > >  	 */
> > > > -	if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> > > > -	    (ext_jedec & 0xff00) == 0x4d00) {
> > > > +	if (is_spansion_s25fss_family(jedec, ext_jedec)) {
> > > >  		int ret;
> > > >  		u8 id[6];
> > > >
> > > > --
> > >
> > > Hi Michael,
> > > From some datasheet for spansion flash, it seems all the spansion
> > > S25FS family should disable 4kb.
> > > So how about just judge the idcode[0]?
> > >
> > 
> > I understand your point but I don't have enough part number and I can only to
> > test on this one. I will verify this patch too and put my review and drop my
> > personal one. Anyway can you ask if the first 0x8000 are considered by boot
> > rom? I'm trying to boot from qspi an imx7d board and I create the parameter
> > using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
> > from 0x400 or from 0x8400. And then I think that bootloader should go from
> > 0x1000 or from 0x9000 correct?
> > Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
> > 0x1000 or 0x400?
> > 
> 
> I'm not sure what's the offset for imx7d, but for NXP LS series SOC.
> The RCW_PBI offset: 0x0
> The Uboot offset is defined by RCW_PBI code.(Such as 0x10000)
> 

I have seen that the booting from QSPI come from you. Do you have an idea about
imx7d booting from QSPI?

Michael

> > > Like:
> > > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
> > > index 64d4e0f..cfe3649 100644
> > > --- a/drivers/mtd/spi/spi_flash.c
> > > +++ b/drivers/mtd/spi/spi_flash.c
> > > @@ -1072,8 +1072,7 @@ int spi_flash_scan(struct spi_flash *flash)
> > >          * sector that is not overlaid by the parameter sectors.
> > >          * The uniform sector erase command has no effect on parameter sectors.
> > >          */
> > > -       if ((jedec == 0x0219 || (jedec == 0x0220)) &&
> > > -           (ext_jedec & 0xff00) == 0x4d00) {
> > > +       if (idcode[0] == SPI_FLASH_CFI_MFR_SPANSION) {
> > >                 int ret;
> > >                 u8 id[6];
> > >
> > >
> > > How about your think?
> > 
> > For me is fine if you are sure
> > 
> > Michael
> > 
> > >
> > >
> > >
> > 
> > --
> > | Michael Nazzareno Trimarchi                     Amarula Solutions BV |
> > | COO  -  Founder                                      Cruquiuskade 47 |
> > | +31(0)851119172                                 Amsterdam 1018 AM NL |
> > |                  [`as] http://www.amarulasolutions.com               |

-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-06-22 10:14     ` Yao Yuan
  2016-06-22 10:55       ` [U-Boot] Booting imx7d from qspi using spansion flash (WAS Re: [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128) Michael Trimarchi
@ 2016-08-06 14:37       ` Jagan Teki
  2016-08-06 14:40         ` Michael Trimarchi
  1 sibling, 1 reply; 9+ messages in thread
From: Jagan Teki @ 2016-08-06 14:37 UTC (permalink / raw)
  To: u-boot

On 22 June 2016 at 15:44, Yao Yuan <yao.yuan@nxp.com> wrote:
> On 06/22/2016 06:08 PM, Michael Trimarchi wrote:
>> On Wed, Jun 22, 2016 at 10:00:49AM +0000, Yao Yuan wrote:
>> > On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
>> > > The S25FS128 is part of S25FS-S family physical sectors may be
>> > > configured as a hybrid combination of eight 4-kB parameter sectors
>> > > at the top or bottom of the address space with all but one of the
>> > > remaining sectors being uniform size. This rework a bit commit
>> > >
>> > > 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
>> > >
>> > > and add this jedec part number
>> > >
>> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>> > > ---
>> > >  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
>> > >  1 file changed, 16 insertions(+), 2 deletions(-)
>> > >
>> > > diff --git a/drivers/mtd/spi/spi_flash.c
>> > > b/drivers/mtd/spi/spi_flash.c index
>> > > 64d4e0f..c993588 100644
>> > > --- a/drivers/mtd/spi/spi_flash.c
>> > > +++ b/drivers/mtd/spi/spi_flash.c
>> > > @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob,
>> > > struct spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
>> > >
>> > >  #ifdef CONFIG_SPI_FLASH_SPANSION
>> > > +
>> > > +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
>> > > + switch (jedec) {
>> > > + case 0x0219:
>> > > + case 0x0220:
>> > > + case 0x2018:
>> > > +         if ((ext_jedec & 0xff00) == 0x4d00)
>> > > +                 return 1;
>> > > + default:;
>> > > + }
>> > > +
>> > > + return 0;
>> > > +}
>> > > +
>> > >  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
>> > >   u8 cmd[4];
>> > > @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
>> > >    * sector that is not overlaid by the parameter sectors.
>> > >    * The uniform sector erase command has no effect on parameter
>> > > sectors.
>> > >    */
>> > > - if ((jedec == 0x0219 || (jedec == 0x0220)) &&
>> > > -     (ext_jedec & 0xff00) == 0x4d00) {
>> > > + if (is_spansion_s25fss_family(jedec, ext_jedec)) {
>> > >           int ret;
>> > >           u8 id[6];
>> > >
>> > > --
>> >
>> > Hi Michael,
>> > From some datasheet for spansion flash, it seems all the spansion
>> > S25FS family should disable 4kb.
>> > So how about just judge the idcode[0]?
>> >
>>
>> I understand your point but I don't have enough part number and I can only to
>> test on this one. I will verify this patch too and put my review and drop my
>> personal one. Anyway can you ask if the first 0x8000 are considered by boot
>> rom? I'm trying to boot from qspi an imx7d board and I create the parameter
>> using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
>> from 0x400 or from 0x8400. And then I think that bootloader should go from
>> 0x1000 or from 0x9000 correct?
>> Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
>> 0x1000 or 0x400?
>>

Don't understand either does this "Disable 4-KB erase command for
SPANSION S25FS-S family" (spansion_s25fss_disable_4KB_erase) is an
issue workaround or something like hybrid configuration feature for
spansion parts?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-08-06 14:37       ` [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Jagan Teki
@ 2016-08-06 14:40         ` Michael Trimarchi
  2016-08-06 15:08           ` Jagan Teki
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Trimarchi @ 2016-08-06 14:40 UTC (permalink / raw)
  To: u-boot

Hi

On Sat, Aug 6, 2016 at 4:37 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> On 22 June 2016 at 15:44, Yao Yuan <yao.yuan@nxp.com> wrote:
>> On 06/22/2016 06:08 PM, Michael Trimarchi wrote:
>>> On Wed, Jun 22, 2016 at 10:00:49AM +0000, Yao Yuan wrote:
>>> > On 06/22/2016 03:59 PM, Michael Trimarchi wrote:
>>> > > The S25FS128 is part of S25FS-S family physical sectors may be
>>> > > configured as a hybrid combination of eight 4-kB parameter sectors
>>> > > at the top or bottom of the address space with all but one of the
>>> > > remaining sectors being uniform size. This rework a bit commit
>>> > >
>>> > > 80c1bfd2332e71dfe669cac53ba06b7435a7ca39
>>> > >
>>> > > and add this jedec part number
>>> > >
>>> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>>> > > ---
>>> > >  drivers/mtd/spi/spi_flash.c | 18 ++++++++++++++++--
>>> > >  1 file changed, 16 insertions(+), 2 deletions(-)
>>> > >
>>> > > diff --git a/drivers/mtd/spi/spi_flash.c
>>> > > b/drivers/mtd/spi/spi_flash.c index
>>> > > 64d4e0f..c993588 100644
>>> > > --- a/drivers/mtd/spi/spi_flash.c
>>> > > +++ b/drivers/mtd/spi/spi_flash.c
>>> > > @@ -972,6 +972,21 @@ int spi_flash_decode_fdt(const void *blob,
>>> > > struct spi_flash *flash)  #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
>>> > >
>>> > >  #ifdef CONFIG_SPI_FLASH_SPANSION
>>> > > +
>>> > > +inline int is_spansion_s25fss_family(u16 jedec, u16 ext_jedec) {
>>> > > + switch (jedec) {
>>> > > + case 0x0219:
>>> > > + case 0x0220:
>>> > > + case 0x2018:
>>> > > +         if ((ext_jedec & 0xff00) == 0x4d00)
>>> > > +                 return 1;
>>> > > + default:;
>>> > > + }
>>> > > +
>>> > > + return 0;
>>> > > +}
>>> > > +
>>> > >  static int spansion_s25fss_disable_4KB_erase(struct spi_slave *spi)  {
>>> > >   u8 cmd[4];
>>> > > @@ -1072,8 +1087,7 @@ int spi_flash_scan(struct spi_flash *flash)
>>> > >    * sector that is not overlaid by the parameter sectors.
>>> > >    * The uniform sector erase command has no effect on parameter
>>> > > sectors.
>>> > >    */
>>> > > - if ((jedec == 0x0219 || (jedec == 0x0220)) &&
>>> > > -     (ext_jedec & 0xff00) == 0x4d00) {
>>> > > + if (is_spansion_s25fss_family(jedec, ext_jedec)) {
>>> > >           int ret;
>>> > >           u8 id[6];
>>> > >
>>> > > --
>>> >
>>> > Hi Michael,
>>> > From some datasheet for spansion flash, it seems all the spansion
>>> > S25FS family should disable 4kb.
>>> > So how about just judge the idcode[0]?
>>> >
>>>
>>> I understand your point but I don't have enough part number and I can only to
>>> test on this one. I will verify this patch too and put my review and drop my
>>> personal one. Anyway can you ask if the first 0x8000 are considered by boot
>>> rom? I'm trying to boot from qspi an imx7d board and I create the parameter
>>> using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
>>> from 0x400 or from 0x8400. And then I think that bootloader should go from
>>> 0x1000 or from 0x9000 correct?
>>> Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
>>> 0x1000 or 0x400?
>>>
>
> Don't understand either does this "Disable 4-KB erase command for
> SPANSION S25FS-S family" (spansion_s25fss_disable_4KB_erase) is an
> issue workaround or something like hybrid configuration feature for
> spansion parts?
>

Please refer here.

Michael

> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: S25FS-S_Prog_Guide_AN.pdf
Type: application/pdf
Size: 606238 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160806/c81f0989/attachment-0001.pdf>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-08-06 14:40         ` Michael Trimarchi
@ 2016-08-06 15:08           ` Jagan Teki
  2016-08-06 15:14             ` Michael Trimarchi
  0 siblings, 1 reply; 9+ messages in thread
From: Jagan Teki @ 2016-08-06 15:08 UTC (permalink / raw)
  To: u-boot

On 6 August 2016 at 20:10, Michael Trimarchi
<michael@amarulasolutions.com> wrote:
>>>>
>>>> I understand your point but I don't have enough part number and I can only to
>>>> test on this one. I will verify this patch too and put my review and drop my
>>>> personal one. Anyway can you ask if the first 0x8000 are considered by boot
>>>> rom? I'm trying to boot from qspi an imx7d board and I create the parameter
>>>> using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
>>>> from 0x400 or from 0x8400. And then I think that bootloader should go from
>>>> 0x1000 or from 0x9000 correct?
>>>> Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
>>>> 0x1000 or 0x400?
>>>>
>>
>> Don't understand either does this "Disable 4-KB erase command for
>> SPANSION S25FS-S family" (spansion_s25fss_disable_4KB_erase) is an
>> issue workaround or something like hybrid configuration feature for
>> spansion parts?
>>
>
> Please refer here.

Thanks for the pdf, So the lower 8 4k sectors are unaffected even if
we do sector erase(d8h)? What if we do 4k erase(20h) whole flash all
effected?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128
  2016-08-06 15:08           ` Jagan Teki
@ 2016-08-06 15:14             ` Michael Trimarchi
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Trimarchi @ 2016-08-06 15:14 UTC (permalink / raw)
  To: u-boot

Hi

On Sat, Aug 6, 2016 at 5:08 PM, Jagan Teki <jagannadh.teki@gmail.com> wrote:
> On 6 August 2016 at 20:10, Michael Trimarchi
> <michael@amarulasolutions.com> wrote:
>>>>>
>>>>> I understand your point but I don't have enough part number and I can only to
>>>>> test on this one. I will verify this patch too and put my review and drop my
>>>>> personal one. Anyway can you ask if the first 0x8000 are considered by boot
>>>>> rom? I'm trying to boot from qspi an imx7d board and I create the parameter
>>>>> using the files/qspi-nor-spansion-s25fl128s-config but not sure if I need to flash
>>>>> from 0x400 or from 0x8400. And then I think that bootloader should go from
>>>>> 0x1000 or from 0x9000 correct?
>>>>> Then from BOOT_FROM I choose qspi but what is the DEFAULT_ADDRESS
>>>>> 0x1000 or 0x400?
>>>>>
>>>
>>> Don't understand either does this "Disable 4-KB erase command for
>>> SPANSION S25FS-S family" (spansion_s25fss_disable_4KB_erase) is an
>>> issue workaround or something like hybrid configuration feature for
>>> spansion parts?
>>>
>>
>> Please refer here.
>
> Thanks for the pdf, So the lower 8 4k sectors are unaffected even if
> we do sector erase(d8h)? What if we do 4k erase(20h) whole flash all
> effected?

1) correct
2) I need to check

If we send this command we just remap it in the same way

Michael
>
> thanks!
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.



-- 
| Michael Nazzareno Trimarchi                     Amarula Solutions BV |
| COO  -  Founder                                      Cruquiuskade 47 |
| +31(0)851119172                                 Amsterdam 1018 AM NL |
|                  [`as] http://www.amarulasolutions.com               |

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-06 15:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-22  7:58 [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Michael Trimarchi
2016-06-22 10:00 ` Yao Yuan
2016-06-22 10:06   ` Michael Trimarchi
2016-06-22 10:14     ` Yao Yuan
2016-06-22 10:55       ` [U-Boot] Booting imx7d from qspi using spansion flash (WAS Re: [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128) Michael Trimarchi
2016-08-06 14:37       ` [U-Boot] [PATCH] sf: Disable 4-KB erase command for SPANSION S25FS128 Jagan Teki
2016-08-06 14:40         ` Michael Trimarchi
2016-08-06 15:08           ` Jagan Teki
2016-08-06 15:14             ` Michael Trimarchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox