Skip to contentSkip to conversation

sf: Remove spansion_s25fss_disable_4KB_erase

PATCH New Jagan Teki 1 participant 2 messages Nov 17, 2016 – Nov 18, 2016 Memory technology devices (MTD)

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH v7 10/21 sf: Remove spansion_s25fss_disable_4KB_erase

From: Jagan Teki <[email protected]>

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 better to erase the whole flash using 4K sector erase instead of detecting these family parts again and do two different erase operations.

For this:
- Removed spansion_s25fss_disable_4KB_erase code
- Add SECT_4K for S25FS512S chip

Cc Yunhui Cui <[email protected]>
Cc Bin Meng <[email protected]>
Cc York Sun <[email protected]>
Cc Vignesh R <[email protected]>
Cc Mugunthan V N <[email protected]>
Cc Michal Simek <[email protected]>
Cc Michael Trimarchi <[email protected]>
Cc Siva Durga Prasad Paladugu <[email protected]>

---
Changes for v7:
- Add SECT_4K S25FS512S

 drivers/mtd/spi/sf_internal.h |  6 ----
 drivers/mtd/spi/sf_params.c   |  2 +-
 drivers/mtd/spi/spi_flash.c   | 79 -------------------------------------------
 3 files changed, 1 insertion(+), 86 deletions(-)
drivers/mtd/spi/sf_internal.h +0 -6
index cbed6e8..6a39cdd 100644
@@ -98,12 +98,6 @@ int sst_write_bp(struct spi_flash *flash, u32 offset, size_t len,
 		const void *buf);
 #endif
 
-#ifdef CONFIG_SPI_FLASH_SPANSION
-/* Used for Spansion S25FS-S family flash only. */
-#define CMD_SPANSION_RDAR	0x65 /* Read any device register */
-#define CMD_SPANSION_WRAR	0x71 /* Write any device register */
-#endif
-
 #define JEDEC_MFR(info)		((info)->id[0])
 #define JEDEC_ID(info)		(((info)->id[1]) << 8 | ((info)->id[2]))
 #define JEDEC_EXT(info)		(((info)->id[3]) << 8 | ((info)->id[4]))
drivers/mtd/spi/sf_params.c +1 -1
index 6157e29..7b9e5ef 100644
@@ -99,7 +99,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",      INFO(0x010220, 0x4D00, 128 * 1024,   512, RD_FULL | WR_QPP) },
+	{"S25FS512S",      INFO(0x010220, 0x4D00, 128 * 1024,   512, RD_FULL | WR_QPP | SECT_4K) },
 	{"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) },
drivers/mtd/spi/spi_flash.c +0 -79

91 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v7 10/21 sf: Remove spansion_s25fss_disable_4KB_erase

Quoted 31 lines · Jagan Teki

From: Jagan Teki <[email protected]>

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 better to erase the whole flash using 4K sector erase instead of detecting these family parts again and do two different erase operations.

For this:
- Removed spansion_s25fss_disable_4KB_erase code
- Add SECT_4K for S25FS512S chip

Cc Yunhui Cui <[email protected]>
Cc Bin Meng <[email protected]>
Cc York Sun <[email protected]>
Cc Vignesh R <[email protected]>
Cc Mugunthan V N <[email protected]>
Cc Michal Simek <[email protected]>
Cc Michael Trimarchi <[email protected]>
Cc Siva Durga Prasad Paladugu <[email protected]>
Quoted 3 lines

---
Changes for v7:
- Add SECT_4K S25FS512S

Applied to u-boot-spi/master

thanks!

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