diff mbox

[v2,3/3] mtd: spi-nor: s25fl512s: Set a page size of 512

Message ID 22ee35326eb763a0f7477c845838ef7aa1c8d1fd.1487085166.git.mark.marshall@omicronenergy.com
State Rejected
Delegated to: Cyrille Pitchen
Headers show

Commit Message

mark.marshall@omicronenergy.com Feb. 14, 2017, 3:35 p.m. UTC
From: Mark Marshall <mark.marshall@omicronenergy.com>

This device has a write page size of 512.  Changing this from 256 to 512
almost doubles the write performance of the flash.

Signed-off-by: Mark Marshall <mark.marshall@omicronenergy.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Cyrille Pitchen Aug. 1, 2017, 4:49 p.m. UTC | #1
Hi Mark,

Le 14/02/2017 à 16:35, mark.marshall@omicronenergy.com a écrit :
> From: Mark Marshall <mark.marshall@omicronenergy.com>
> 
> This device has a write page size of 512.  Changing this from 256 to 512
> almost doubles the write performance of the flash.

This issue should be fixed now parsing the SFDP tables of the s25fl512s
memory part. Indeed bits[7:4] of DWORD11 in the Basic Flash Parameter
Table encode the actual page size for Page Program operations.

This value overrides the one read from info->page_size.

Best regards,

Cyrille

> 
> Signed-off-by: Mark Marshall <mark.marshall@omicronenergy.com>
> ---
>  drivers/mtd/spi-nor/spi-nor.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 467dc93..ba4d7b7 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -1056,6 +1056,8 @@ static const struct flash_info spi_nor_ids[] = {
>  	{ "s25fl256s0", INFO(JEDEC_ID(0x010219, 0x4d00, 2), 256 * 1024, 128, 0) },
>  	{ "s25fl256s1", INFO(JEDEC_ID(0x010219, 0x4d01, 2),  64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
>  	{ "s25fl512s",  INFO(JEDEC_ID(0x010220, 0x4d00, 2), 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> +	{ "s25fl512s",  INFO_FULL(JEDEC_ID(0x010220, 0x4d00, 2),
> +				  256 * 1024, 256, 512, 0, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
>  	{ "s70fl01gs",  INFO(JEDEC_ID(0x010221, 0x4d00, 2), 256 * 1024, 256, 0) },
>  	{ "s25sl12800", INFO(JEDEC_ID(0x012018, 0x0300, 2), 256 * 1024,  64, 0) },
>  	{ "s25sl12801", INFO(JEDEC_ID(0x012018, 0x0301, 2),  64 * 1024, 256, 0) },
>
diff mbox

Patch

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 467dc93..ba4d7b7 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1056,6 +1056,8 @@  static const struct flash_info spi_nor_ids[] = {
 	{ "s25fl256s0", INFO(JEDEC_ID(0x010219, 0x4d00, 2), 256 * 1024, 128, 0) },
 	{ "s25fl256s1", INFO(JEDEC_ID(0x010219, 0x4d01, 2),  64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
 	{ "s25fl512s",  INFO(JEDEC_ID(0x010220, 0x4d00, 2), 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+	{ "s25fl512s",  INFO_FULL(JEDEC_ID(0x010220, 0x4d00, 2),
+				  256 * 1024, 256, 512, 0, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
 	{ "s70fl01gs",  INFO(JEDEC_ID(0x010221, 0x4d00, 2), 256 * 1024, 256, 0) },
 	{ "s25sl12800", INFO(JEDEC_ID(0x012018, 0x0300, 2), 256 * 1024,  64, 0) },
 	{ "s25sl12801", INFO(JEDEC_ID(0x012018, 0x0301, 2),  64 * 1024, 256, 0) },