Skip to contentSkip to conversation

config: remove CONFIG_SPI_FLASH_BAR from some platforms

PATCH New Suresh Gupta 4 participants 23 messages Apr 25, 2017 – Sep 13, 2017 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config: remove CONFIG_SPI_FLASH_BAR from some platforms

ls1012ardb, ls1046ardb, ls2080ardb has S25FS512S flash which do not support Bank Address Register commands

---
 include/configs/ls1012a_common.h | 1 -
 include/configs/ls1046ardb.h     | 1 -
 include/configs/ls2080ardb.h     | 1 -
 3 files changed, 3 deletions(-)
include/configs/ls1012a_common.h +0 -1
index 09f890d..0db926f 100644
@@ -55,7 +55,6 @@
 #define CONFIG_FSL_QSPI
 #define QSPI0_AMBA_BASE		0x40000000
 #define CONFIG_SPI_FLASH_SPANSION
-#define CONFIG_SPI_FLASH_BAR
 
 #define FSL_QSPI_FLASH_SIZE		(1 << 24)
 #define FSL_QSPI_FLASH_NUM		2
include/configs/ls1046ardb.h +0 -1
index 67ee626..66af039 100644
@@ -208,7 +208,6 @@
 #define CONFIG_SPI_FLASH_SPANSION
 #define FSL_QSPI_FLASH_SIZE		(1 << 26)
 #define FSL_QSPI_FLASH_NUM		2
-#define CONFIG_SPI_FLASH_BAR
 #endif
 #endif
 
include/configs/ls2080ardb.h +0 -1
index 2155a89..79a3d94 100644
@@ -265,7 +265,6 @@ unsigned long get_board_sys_clk(void);
 /* SPI */
 #ifdef CONFIG_FSL_DSPI
 #define CONFIG_SPI_FLASH
-#define CONFIG_SPI_FLASH_BAR
 #define CONFIG_SPI_FLASH_STMICRO
 #endif
 
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 LS1012A: change the size of flash

LS1012A has S25FS512S flash of 64M size

---
 include/configs/ls1012a_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/ls1012a_common.h +1 -1
index 0db926f..861cbc3 100644
@@ -56,7 +56,7 @@
 #define QSPI0_AMBA_BASE		0x40000000
 #define CONFIG_SPI_FLASH_SPANSION
 
-#define FSL_QSPI_FLASH_SIZE		(1 << 24)
+#define FSL_QSPI_FLASH_SIZE		SZ_64M
 #define FSL_QSPI_FLASH_NUM		2
 
 /*
Signature · 1 line
1.9.3
#2 lore raw

PATCH 1/1 LS1012A: change the size of flash

Quoted 13 lines · Suresh Gupta

LS1012A has S25FS512S flash of 64M size

---
 include/configs/ls1012a_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/ls1012a_common.h +0 -0
index 0db926f..861cbc3 100644

include/configs/ls1012a_common.h line 62

Quoted 8 lines
include/configs/ls1012a_common.h +1 -1
@@ -56,7 +56,7 @@
 #define QSPI0_AMBA_BASE		0x40000000
 #define CONFIG_SPI_FLASH_SPANSION
 
-#define FSL_QSPI_FLASH_SIZE		(1 << 24)
+#define FSL_QSPI_FLASH_SIZE		SZ_64M
 #define FSL_QSPI_FLASH_NUM		2
 
 /*

Suresh,

LS1012A doesn't have any flash built-in. Do you mean all boards supporting LS1012A have the same flash chip with 64MB in size? Please clarify.

York

#3 lore raw

PATCH 1/1 LS1012A: change the size of flash

Quoted 35 lines

-----Original Message-----
From: york sun
Sent: Tuesday, May 23, 2017 9:50 PM
To: Suresh Gupta <[email protected]>; u-boot at lists.denx.de
Cc: jagan at openedev.com
Subject: Re: [PATCH] LS1012A: change the size of flash

Quoted 14 lines · Suresh Gupta

LS1012A has S25FS512S flash of 64M size

---
 include/configs/ls1012a_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/ls1012a_common.h +0 -0
index 0db926f..861cbc3 100644

include/configs/ls1012a_common.h line 62

Quoted 8 lines
include/configs/ls1012a_common.h +1 -1
@@ -56,7 +56,7 @@
 #define QSPI0_AMBA_BASE		0x40000000
 #define CONFIG_SPI_FLASH_SPANSION
 
-#define FSL_QSPI_FLASH_SIZE		(1 << 24)
+#define FSL_QSPI_FLASH_SIZE		SZ_64M
 #define FSL_QSPI_FLASH_NUM		2
 
 /*

Suresh,

Quoted 4 lines

LS1012A doesn't have any flash built-in. Do you mean all boards supporting LS1012A have the same flash chip with 64MB in size? Please clarify.

York

York,
You are right, all boards has 64MB (S25FS512S) flash. Sorry for confusion.

SuresH

Applied
#4 lore raw

PATCH 1/1 LS1012A: change the size of flash

Quoted 35 lines · Suresh Gupta
Quoted 35 lines

-----Original Message-----
From: york sun
Sent: Tuesday, May 23, 2017 9:50 PM
To: Suresh Gupta <[email protected]>; u-boot at lists.denx.de
Cc: jagan at openedev.com
Subject: Re: [PATCH] LS1012A: change the size of flash

Quoted 14 lines · Suresh Gupta

LS1012A has S25FS512S flash of 64M size

---
  include/configs/ls1012a_common.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/ls1012a_common.h +0 -0
index 0db926f..861cbc3 100644

include/configs/ls1012a_common.h line 62

Quoted 8 lines
include/configs/ls1012a_common.h +1 -1
@@ -56,7 +56,7 @@
  #define QSPI0_AMBA_BASE		0x40000000
  #define CONFIG_SPI_FLASH_SPANSION
 
-#define FSL_QSPI_FLASH_SIZE		(1 << 24)
+#define FSL_QSPI_FLASH_SIZE		SZ_64M
  #define FSL_QSPI_FLASH_NUM		2
 
  /*

Suresh,

Quoted 8 lines
Quoted 4 lines

LS1012A doesn't have any flash built-in. Do you mean all boards supporting LS1012A have the same flash chip with 64MB in size? Please clarify.

York

York,
You are right, all boards has 64MB (S25FS512S) flash. Sorry for confusion.

Changed subject to "armv8: ls1012a: fix the size of flash for multiple boards". Revise commit message to "LS1012AFRDM, LS1012ARDB, LS1012AQDS all have S25FS512S flash of 64MB size."

Applied to fsl-qoriq master, awaiting upstream. Thanks.

York

#5 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

In reply to Suresh Gupta

As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of 256 or 512 Bytes. So, flag SECT_4K have no significance for this flash.

---
 drivers/mtd/spi/spi_flash_ids.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/spi_flash_ids.c +1 -1
index edca94e..7ca33e8 100644
@@ -101,7 +101,7 @@ const struct spi_flash_info spi_flash_ids[] = {
 	{"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL | WR_QPP) },
 	{"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL | WR_QPP) },
 	{"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
-	{"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
+	{"s25fs512s",      INFO6(0x010220, 0x4d0081, 256 * 1024, 256, RD_FULL | WR_QPP) },
 	{"s25fl512s_256k", INFO(0x010220, 0x4d00, 256 * 1024,   256, RD_FULL | WR_QPP) },
 	{"s25fl512s_64k",  INFO(0x010220, 0x4d01,  64 * 1024,  1024, RD_FULL | WR_QPP) },
 	{"s25fl512s_512k", INFO(0x010220, 0x4f00, 256 * 1024,   256, RD_FULL | WR_QPP) },
Signature · 1 line
1.9.3
#6 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 15 lines · Suresh Gupta

As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of 256 or 512 Bytes. So, flag SECT_4K have no significance for this flash.

---
 drivers/mtd/spi/spi_flash_ids.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/spi_flash_ids.c +0 -0
index edca94e..7ca33e8 100644

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 104

Quoted 5 lines
drivers/mtd/spi/spi_flash_ids.c +1 -1
@@ -101,7 +101,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL | WR_QPP) },
        {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL | WR_QPP) },
        {"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
-       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL | WR_QPP | SECT_4K) },
+       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 256 * 1024, 256, RD_FULL | WR_QPP) },

Did you verify this? because we have an issue about this part number[1]

[1] https://lists.denx.de/pipermail/u-boot/2016-December/276032.html

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#7 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 37 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Wednesday, April 26, 2017 1:01 PM
To: Suresh Gupta <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; york sun <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 15 lines · Suresh Gupta

As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of
256 or 512 Bytes. So, flag SECT_4K have no significance for this flash.

---
 drivers/mtd/spi/spi_flash_ids.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/mtd/spi/spi_flash_ids.c index edca94e..7ca33e8 100644

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 101

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
@@ -101,7 +101,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL |

WR_QPP) },

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 102

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL |

WR_QPP) },

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 103

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL
| WR_QPP | SECT_4K) },
> -       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL |
WR_QPP | SECT_4K) },
> +       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 256 * 1024, 256, RD_FULL |
Quoted 6 lines

WR_QPP) },

Did you verify this? because we have an issue about this part number[1]

[1] https://lists.denx.de/pipermail/u-boot/2016-December/276032.html

I tested this patch on LS1012ARDB, LS1046ARDB and Ls1088ARDB boards having same flash.
I do aware of [1] but as per my testing all works fine with erase size of 256 and block size of 256/512.

As per datasheet, [http://www.cypress.com/file/216376/download] also mention below, The uniform erase blocks are 256. So anyhow we required this patch even we need to disable 4KB erase.

Erase
– Hybrid sector option
– Physical set of eight 4-kbytes sectors and one
224-kbytes sector at the top or bottom of address
space with all remaining sectors of 256 kbytes
– Uniform sector option
– Uniform 256 kbyte blocks

Quoted 5 lines

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

#8 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 50 lines · Suresh Gupta
Quoted 37 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Wednesday, April 26, 2017 1:01 PM
To: Suresh Gupta <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; york sun <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 15 lines · Suresh Gupta

As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of
256 or 512 Bytes. So, flag SECT_4K have no significance for this flash.

---
 drivers/mtd/spi/spi_flash_ids.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/mtd/spi/spi_flash_ids.c index edca94e..7ca33e8 100644

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 101

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
@@ -101,7 +101,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL |

WR_QPP) },

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 102

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL |

WR_QPP) },

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 103

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512, RD_FULL
| WR_QPP | SECT_4K) },
> -       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL |
WR_QPP | SECT_4K) },
> +       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 256 * 1024, 256, RD_FULL |
Quoted 6 lines

WR_QPP) },

Did you verify this? because we have an issue about this part number[1]

[1] https://lists.denx.de/pipermail/u-boot/2016-December/276032.html

I tested this patch on LS1012ARDB, LS1046ARDB and Ls1088ARDB boards having same flash.
I do aware of [1] but as per my testing all works fine with erase size of 256 and block size of 256/512.

As per datasheet, [http://www.cypress.com/file/216376/download] also mention below, The uniform erase blocks are 256. So anyhow we required this patch even we need to disable 4KB erase.

Quoted 8 lines

Erase
– Hybrid sector option
– Physical set of eight 4-kbytes sectors and one
224-kbytes sector at the top or bottom of address
space with all remaining sectors of 256 kbytes
– Uniform sector option
– Uniform 256 kbyte blocks

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

York

#9 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 78 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 27, 2017 4:35 AM
To: Suresh Gupta <[email protected]>; Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 23 lines · Suresh Gupta
Quoted 23 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Wednesday, April 26, 2017 1:01 PM
To: Suresh Gupta <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; york sun <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 10 lines · Suresh Gupta

As per data sheet, S25FS512S support Uniform sector option or erase size of 256 kbytes and Page Programming buffer of
256 or 512 Bytes. So, flag SECT_4K have no significance for this flash.

---
 drivers/mtd/spi/spi_flash_ids.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 6 lines

drivers/mtd/spi/spi_flash_ids.c const struct spi_flash_info spi_flash_ids[] = { · line 101

Quoted 6 lines
(quoted diff) +0 -0

b/drivers/mtd/spi/spi_flash_ids.c index edca94e..7ca33e8 100644

drivers/mtd/spi/spi_flash_ids.c +0 -0
@@ -101,7 +101,7 @@ const struct spi_flash_info spi_flash_ids[] = {
        {"s25fl256s_256k", INFO(0x010219, 0x4d00, 256 * 1024,   128, RD_FULL

|

Quoted 2 lines
Quoted 2 lines

WR_QPP) },

Quoted 1 line
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fl256s_64k",  INFO(0x010219, 0x4d01,  64 * 1024,   512, RD_FULL

|

Quoted 5 lines
Quoted 5 lines

WR_QPP) },

Quoted 2 lines
drivers/mtd/spi/spi_flash_ids.c +0 -0
        {"s25fs256s_64k",  INFO6(0x010219, 0x4d0181, 64 * 1024, 512,

RD_FULL

| WR_QPP | SECT_4K) },
> -       {"s25fs512s",      INFO6(0x010220, 0x4d0081, 128 * 1024, 512, RD_FULL

|

Quoted 2 lines
Quoted 2 lines

WR_QPP | SECT_4K) },

Quoted 1 line

+ {"s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256,

RD_FULL |

Quoted 9 lines
Quoted 7 lines

WR_QPP) },

Did you verify this? because we have an issue about this part number[1]

[1] https://lists.denx.de/pipermail/u-boot/2016-December/276032.html

I tested this patch on LS1012ARDB, LS1046ARDB and Ls1088ARDB boards

having same flash.

Quoted 1 line

I do aware of [1] but as per my testing all works fine with erase size of 256

and block size of 256/512.

Quoted 3 lines

As per datasheet, [http://www.cypress.com/file/216376/download] also mention below, The uniform erase blocks are 256. So anyhow we required this

patch even we need to disable 4KB erase.

Quoted 7 lines

Erase
– Hybrid sector option
– Physical set of eight 4-kbytes sectors and one 224-kbytes sector at the top or bottom of address space with all remaining sectors of 256 kbytes – Uniform sector option – Uniform 256 kbyte blocks

Quoted 5 lines

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

York, the flash s25fs512s support 32 bit address to handle >16M memory access.
With and without CONFIG_SPI_FLASH_BAR the u-boot only access up to 16M of flash memory
for this particular flash which is installed on our boards (LS1012ARDB, LS1046ARDB, LS1088ARDB, LS2088ARDB). So, anyhow we need to remove this CONFIG_SPI_FLASH_BAR from our boards configs.

For accessing >16M of flash memory (to support 32 bit address) I already start discussion [2] with Jagan. Hopefully We have a solution for that in near future.
[2] https://patchwork.ozlabs.org/patch/676152/

Thanks
SuresH

#10 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 2 lines · Suresh Gupta

<snip>

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

Quoted 9 lines

York, the flash s25fs512s support 32 bit address to handle >16M memory access.
With and without CONFIG_SPI_FLASH_BAR the u-boot only access up to 16M of flash memory
for this particular flash which is installed on our boards (LS1012ARDB, LS1046ARDB, LS1088ARDB, LS2088ARDB). So, anyhow we need to remove this CONFIG_SPI_FLASH_BAR from our boards configs.

For accessing >16M of flash memory (to support 32 bit address) I already start discussion [2] with Jagan. Hopefully We have a solution for that in near future.
[2] https://patchwork.ozlabs.org/patch/676152/

How did it (>16MB) work before?

York

#11 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 35 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 27, 2017 10:18 PM
To: Suresh Gupta <[email protected]>; Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 2 lines · Suresh Gupta

<snip>

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

York, the flash s25fs512s support 32 bit address to handle >16M memory

access.

Quoted 2 lines

With and without CONFIG_SPI_FLASH_BAR the u-boot only access up to 16M of flash memory for this particular flash which is installed on our boards

(LS1012ARDB, LS1046ARDB, LS1088ARDB, LS2088ARDB).

Quoted 1 line

So, anyhow we need to remove this CONFIG_SPI_FLASH_BAR from our boards

configs.

Quoted 3 lines

For accessing >16M of flash memory (to support 32 bit address) I already start discussion [2] with Jagan. Hopefully We have a solution for that

Quoted 7 lines

in near future.

Quoted 2 lines

[2] https://patchwork.ozlabs.org/patch/676152/

How did it (>16MB) work before?

York

According to me for this s25fs512s particular flash, >16M should not work in open source code. If you have any commit id where it works, let me know.
I will try at my end and update you

#12 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 39 lines · Suresh Gupta
Quoted 39 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 27, 2017 10:18 PM
To: Suresh Gupta <[email protected]>; Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 2 lines · Suresh Gupta

<snip>

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

York, the flash s25fs512s support 32 bit address to handle >16M memory

access.

Quoted 2 lines

With and without CONFIG_SPI_FLASH_BAR the u-boot only access up to 16M of flash memory for this particular flash which is installed on our boards

(LS1012ARDB, LS1046ARDB, LS1088ARDB, LS2088ARDB).

Quoted 1 line

So, anyhow we need to remove this CONFIG_SPI_FLASH_BAR from our boards

configs.

Quoted 3 lines

For accessing >16M of flash memory (to support 32 bit address) I already start discussion [2] with Jagan. Hopefully We have a solution for that

in near future.

Quoted 2 lines

[2] https://patchwork.ozlabs.org/patch/676152/

Quoted 8 lines
Quoted 3 lines

How did it (>16MB) work before?

York

According to me for this s25fs512s particular flash, >16M should not work in open source code. If you have any commit id where it works, let me know.
I will try at my end and update you

Suresh,

Where are we on this? The internal U-Boot has it working (previous SDK release). Did you check?

York

#13 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 66 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Friday, May 12, 2017 11:23 PM
To: Suresh Gupta <[email protected]>; Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 40 lines · Suresh Gupta
Quoted 40 lines

-----Original Message-----
From: York Sun [mailto:york.sun at nxp.com]
Sent: Thursday, April 27, 2017 10:18 PM
To: Suresh Gupta <[email protected]>; Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 2 lines · Suresh Gupta

<snip>

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

Suresh,

Did you test your patch after removing CONFIG_SPI_FLASH_BAR? Why doesn't this flash support BAR commands? How did it work before broken?

York, the flash s25fs512s support 32 bit address to handle >16M memory

access.

Quoted 3 lines

With and without CONFIG_SPI_FLASH_BAR the u-boot only access up to 16M of flash memory for this particular flash which is installed on our boards

(LS1012ARDB, LS1046ARDB, LS1088ARDB, LS2088ARDB).

Quoted 2 lines

So, anyhow we need to remove this CONFIG_SPI_FLASH_BAR from our boards

configs.

Quoted 4 lines

For accessing >16M of flash memory (to support 32 bit address) I already start discussion [2] with Jagan. Hopefully We have a solution for that

in near future.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

[2] https://patchwork.ozlabs.org/patch/676152/

How did it (>16MB) work before?

York

According to me for this s25fs512s particular flash, >16M should not work in

open source code.

Quoted 3 lines

If you have any commit id where it works, let me know. I will try at my end and update you

Quoted 6 lines

Suresh,

Where are we on this? The internal U-Boot has it working (previous SDK release). Did you check?

York

York,
It is working in internal U-boot which have set of patches which are not up streamed, one of which is similar to mine patch. Along with this, CONFIG_SPI_FLASH_BAR is disable and new flag ADDR_4B is added and couple of other changes. All this is on our internal u-boot and never be working on open-source.
Yao send some of the patches to open source but are rejected by Jagan.

So my intention is to make at least 16M memory access for this particular flash and then I start discussion with Jagan to include code to access this type of flash as we are coming with similar type of flashes in new platforms.

Thanks
SuresH

#14 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

This what I understood based on my previous datasheet read __attached__

In spansion S25FS-S family the physical sectors are grouped as normal and parameter sectors. Parameter sectors are 4kB in size with 8 set located at the bottom or top address of a device. Normal sectors are similar to other flash family with sizes of 64kB or 32 kB.

To erase whole flash using sector erase(D8h or DCh) won't effect the parameter sectors, so in order to erase these we must use 4K sector erase commands (20h or 21h) separately.

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!

Signature · 11 lines
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
-------------- 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/20170607/27ddfb69/attachment-0001.pdf>
#15 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 21 lines

-----Original Message-----
From: Jagan Teki [mailto:jagan at amarulasolutions.com]
Sent: Wednesday, June 07, 2017 12:33 PM
To: Suresh Gupta <[email protected]>
Cc: york sun <[email protected]>; Jagan Teki <[email protected]>; u- boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

This what I understood based on my previous datasheet read __attached__

In spansion S25FS-S family the physical sectors are grouped as normal and parameter sectors. Parameter sectors are 4kB in size with 8 set located at the bottom or top address of a device.
Normal sectors are similar to other flash family with sizes of 64kB or 32 kB.

Quoted 6 lines

To erase whole flash using sector erase(D8h or DCh) won't effect the parameter sectors, so in order to erase these we must use 4K sector erase commands (20h or 21h) separately.

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?

Erasing flash with 4k erase(20h) do not erase the whole chip and also not able to erase address Space of remaining sectors of 256 kbytes . this I tried with my experiments.

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

Quoted 6 lines

thanks!
--
Jagan Teki
Senior Linux Kernel Engineer | Amarula Solutions U-Boot, Linux | Upstream Maintainer Hyderabad, India.

#16 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 25 lines · Suresh Gupta
Quoted 25 lines

-----Original Message-----
From: Jagan Teki [mailto:jagan at amarulasolutions.com]
Sent: Wednesday, June 07, 2017 12:33 PM
To: Suresh Gupta <[email protected]>
Cc: york sun <[email protected]>; Jagan Teki <[email protected]>; u- boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

This what I understood based on my previous datasheet read __attached__

In spansion S25FS-S family the physical sectors are grouped as normal and parameter sectors. Parameter sectors are 4kB in size with 8 set located at the bottom or top address of a device.
Normal sectors are similar to other flash family with sizes of 64kB or 32 kB.

To erase whole flash using sector erase(D8h or DCh) won't effect the parameter sectors, so in order to erase these we must use 4K sector erase commands (20h or 21h) separately.

Quoted 7 lines
Quoted 2 lines

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?

Erasing flash with 4k erase(20h) do not erase the whole chip and also not able to erase address Space of remaining sectors of 256 kbytes . this I tried with my experiments.

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#17 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

<snip>

Quoted 7 lines
Quoted 3 lines

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

Thanks Jagan,
I will send U-boot patches (after testing) by early next week.

My next point :) to discuss is "32-bit address options". This particular flash do not support below commands /* Bank addr access commands */
#ifdef CONFIG_SPI_FLASH_BAR

# define CMD_BANKADDR_BRWR              0x17
# define CMD_BANKADDR_BRRD              0x16
# define CMD_EXTNADDR_WREAR             0xC5
# define CMD_EXTNADDR_RDEAR             0xC8
#endif 

Instead of above S25FS512S flash support 32-bit address commands like 4READ, 4P4E and many more which require 32 bit address directly pass on wires.

Jagan,
So, Do we have any plan to fix this?
Yao Yuan already send one patch [1] for same.
I think this is a decent approach [1]. If required I will resend this patch with little changes.

[1] https://patchwork.ozlabs.org/patch/676152/

Thanks
SuresH

Quoted 5 lines

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

#18 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

Quoted 22 lines · Suresh Gupta

<snip>

Quoted 7 lines
Quoted 3 lines

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

Thanks Jagan,
I will send U-boot patches (after testing) by early next week.

My next point :) to discuss is "32-bit address options". This particular flash do not support below commands /* Bank addr access commands */
#ifdef CONFIG_SPI_FLASH_BAR

# define CMD_BANKADDR_BRWR              0x17
# define CMD_BANKADDR_BRRD              0x16
# define CMD_EXTNADDR_WREAR             0xC5
# define CMD_EXTNADDR_RDEAR             0xC8
#endif
Quoted 7 lines

Instead of above S25FS512S flash support 32-bit address commands like 4READ, 4P4E and many more which require 32 bit address directly pass on wires.

Jagan,
So, Do we have any plan to fix this?
Yao Yuan already send one patch [1] for same.
I think this is a decent approach [1]. If required I will resend this patch with little changes.

Don't know whether you tried this or not.

- Erase bottom 4K sectors using 4K
- Erase middle sectors using SE
- Erase top 4K sectors using 4K

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#19 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 45 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Monday, June 12, 2017 11:37 AM
To: Suresh Gupta <[email protected]>
Cc: Jagan Teki <[email protected]>; york sun <[email protected]>; u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

Quoted 16 lines · Suresh Gupta

<snip>

Quoted 7 lines
Quoted 3 lines

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

Thanks Jagan,
I will send U-boot patches (after testing) by early next week.

My next point :) to discuss is "32-bit address options". This particular flash do not support below commands /* Bank addr access commands */
#ifdef CONFIG_SPI_FLASH_BAR

Quoted 8 lines
# define CMD_BANKADDR_BRWR              0x17
# define CMD_BANKADDR_BRRD              0x16
# define CMD_EXTNADDR_WREAR             0xC5
# define CMD_EXTNADDR_RDEAR             0xC8
#endif

Instead of above S25FS512S flash support 32-bit address commands like 4READ, 4P4E and many more which require 32 bit address directly pass on

wires.

Quoted 5 lines

Jagan,
So, Do we have any plan to fix this?
Yao Yuan already send one patch [1] for same.
I think this is a decent approach [1]. If required I will resend this patch with

Quoted 7 lines

little changes.

Don't know whether you tried this or not.

- Erase bottom 4K sectors using 4K
- Erase middle sectors using SE
- Erase top 4K sectors using 4K

I will try all combinations and let you know the results.

Quoted 6 lines

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

#20 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 62 lines

-----Original Message-----
From: Suresh Gupta
Sent: Monday, June 12, 2017 2:18 PM
To: 'Jagan Teki' <[email protected]>
Cc: Jagan Teki <[email protected]>; york sun <[email protected]>; u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: RE: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 13 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Monday, June 12, 2017 11:37 AM
To: Suresh Gupta <[email protected]>
Cc: Jagan Teki <[email protected]>; york sun <[email protected]>; u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

On Thu, Jun 8, 2017 at 1:00 PM, Suresh Gupta <[email protected]>

Quoted 34 lines · wrote:
Quoted 22 lines

<snip>

Quoted 7 lines
Quoted 3 lines

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

Thanks Jagan,
I will send U-boot patches (after testing) by early next week.

My next point :) to discuss is "32-bit address options". This particular flash do not support below commands /* Bank addr access commands */
#ifdef CONFIG_SPI_FLASH_BAR

# define CMD_BANKADDR_BRWR              0x17
# define CMD_BANKADDR_BRRD              0x16
# define CMD_EXTNADDR_WREAR             0xC5
# define CMD_EXTNADDR_RDEAR             0xC8
#endif
Quoted 3 lines

Instead of above S25FS512S flash support 32-bit address commands like 4READ, 4P4E and many more which require 32 bit address directly pass on

wires.

Quoted 6 lines

Jagan,
So, Do we have any plan to fix this?
Yao Yuan already send one patch [1] for same.
I think this is a decent approach [1]. If required I will resend this patch with

little changes.

Quoted 8 lines
Quoted 5 lines

Don't know whether you tried this or not.

- Erase bottom 4K sectors using 4K
- Erase middle sectors using SE
- Erase top 4K sectors using 4K

I will try all combinations and let you know the results.

Jagan,
The problem here is, I have all board in which we disable hybrid mode and we write this in nonvolatile register. So on my boards 4K erase (0x20) is not working on any of the sectors.
Please suggest.

Hybrid mode of this flash supports,
- Physical set of eight 4-kbytes sectors and
- one 224-kbytes sector at the top or bottom of address space with
- all remaining sectors of 256 kbytes.
So even if we are able to erase eight sectors via cmd 4K and rest via 256 kbyte(0xd8) Then what about one sector of 224 Kbytes.
And how we tell user about this erase pattern.

Again, my suggestion is to disable hybrid mode (volatile) and we may revisit if anyone come up with different approach Please suggest.

Thanks
SuresH

Quoted 6 lines
Quoted 6 lines

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

#21 lore raw

PATCH 1/1 sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Jagan,

Sorry for late reply to your queries,
I copied your query here to make continuation of mail.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Don't know whether you tried this or not.

- Erase bottom 4K sectors using 4K
- Erase middle sectors using SE
- Erase top 4K sectors using 4K

We are able to manage a flash to run in hybrid mode (IE default mode) and in this mode few top 4K sectors get erased by 4K command but no other sectors get erased with 4K cmd. In non hybrid mode, we are able to erase all flash uniformly with SE cmd but 4K is not working.

So we need to remove the SECT_4K flag for s25fs512s if we want uniform commad command for full flash. Also, we need a patch [1] to disable hybrid mode/disable 4K erase.

[1] https://lists.denx.de/pipermail/u-boot/2017-March/285010.html

Thanks
SuresH

Quoted 112 lines

-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Suresh Gupta
Sent: Monday, June 12, 2017 7:33 PM
To: Jagan Teki <[email protected]>
Cc: u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 60 lines

-----Original Message-----
From: Suresh Gupta
Sent: Monday, June 12, 2017 2:18 PM
To: 'Jagan Teki' <[email protected]>
Cc: Jagan Teki <[email protected]>; york sun <[email protected]>; u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: RE: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Quoted 13 lines

-----Original Message-----
From: Jagan Teki [mailto:jagannadh.teki at gmail.com]
Sent: Monday, June 12, 2017 11:37 AM
To: Suresh Gupta <[email protected]>
Cc: Jagan Teki <[email protected]>; york sun <[email protected]>; u-boot at lists.denx.de; Jagan Teki <[email protected]>; Yao Yuan <[email protected]>
Subject: Re: [U-Boot] [PATCH] sf: Fix s25fs512s erase size and remove SECT_4K flag

Hi Suresh,

On Thu, Jun 8, 2017 at 1:00 PM, Suresh Gupta <[email protected]>

Quoted 34 lines · wrote:
Quoted 22 lines

<snip>

Quoted 7 lines
Quoted 3 lines

So best way is to disable hybrid mode and configure flash in Uniform Sector Architecture

OK, then send patches to Linux and U-Boot will review and take other suggestions too.

Thanks Jagan,
I will send U-boot patches (after testing) by early next week.

My next point :) to discuss is "32-bit address options". This particular flash do not support below commands /* Bank addr access commands */
#ifdef CONFIG_SPI_FLASH_BAR

# define CMD_BANKADDR_BRWR              0x17
# define CMD_BANKADDR_BRRD              0x16
# define CMD_EXTNADDR_WREAR             0xC5
# define CMD_EXTNADDR_RDEAR             0xC8
#endif
Quoted 3 lines

Instead of above S25FS512S flash support 32-bit address commands like 4READ, 4P4E and many more which require 32 bit address directly pass on

wires.

Quoted 6 lines

Jagan,
So, Do we have any plan to fix this?
Yao Yuan already send one patch [1] for same.
I think this is a decent approach [1]. If required I will resend this patch with

little changes.

Quoted 8 lines
Quoted 5 lines

Don't know whether you tried this or not.

- Erase bottom 4K sectors using 4K
- Erase middle sectors using SE
- Erase top 4K sectors using 4K

I will try all combinations and let you know the results.

Jagan,
The problem here is, I have all board in which we disable hybrid mode and we write this in nonvolatile register.
So on my boards 4K erase (0x20) is not working on any of the sectors. Please suggest.

Hybrid mode of this flash supports,
- Physical set of eight 4-kbytes sectors and
- one 224-kbytes sector at the top or bottom of address space with
- all remaining sectors of 256 kbytes.
So even if we are able to erase eight sectors via cmd 4K and rest via 256 kbyte(0xd8) Then what about one sector of 224 Kbytes.
And how we tell user about this erase pattern.

Again, my suggestion is to disable hybrid mode (volatile) and we may revisit if anyone come up with different approach
Please suggest.

Thanks
SuresH

Quoted 6 lines
Quoted 6 lines

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

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#22 lore raw

PATCH 1/1 config: remove CONFIG_SPI_FLASH_BAR from some platforms

In reply to Suresh Gupta
Quoted 9 lines · Suresh Gupta

ls1012ardb, ls1046ardb, ls2080ardb has S25FS512S flash which do not support Bank Address Register commands

---
 include/configs/ls1012a_common.h | 1 -
 include/configs/ls1046ardb.h     | 1 -
 include/configs/ls2080ardb.h     | 1 -
 3 files changed, 3 deletions(-)

Changed subject tag to armv8: layerscape:. Fixed grammar error in commit message.
Applied to fsl-qoriq master, awaiting upstream. Thanks.

York