From 9fe96f9fe893e4f8a42c37df5db1e29d5bab739e Mon Sep 17 00:00:00 2001 From: Mark Marshall Date: Thu, 25 Apr 2013 13:50:30 +0200 Subject: [PATCH 42/96] m25p80: Use a 512 byte page size for Spansion flash s25fl512s The s25fl512s flash from Spnasion has a 512 byte write page size, which means that we can write 512 bytes at a time (instead of 256). This single change makes writing to the flash about 2x's faster. Signed-off-by: Mark Marshall --- drivers/mtd/devices/m25p80.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index b777697..3258179 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -637,6 +637,16 @@ struct flash_info { .flags = (_flags), \ }) +#define INFOP(_jedec_id, _ext_id, _sector_size, _n_sectors, _pg_sz, _flags) \ + ((kernel_ulong_t)&(struct flash_info) { \ + .jedec_id = (_jedec_id), \ + .ext_id = (_ext_id), \ + .sector_size = (_sector_size), \ + .n_sectors = (_n_sectors), \ + .page_size = (_pg_sz), \ + .flags = (_flags), \ + }) + #define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width) \ ((kernel_ulong_t)&(struct flash_info) { \ .sector_size = (_sector_size), \ @@ -698,7 +708,7 @@ static const struct spi_device_id m25p_ids[] = { { "s25sl064a", INFO(0x010216, 0, 64 * 1024, 128, 0) }, { "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) }, { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, 0) }, - { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, 0) }, + { "s25fl512s", INFOP(0x010220, 0x4d00, 256 * 1024, 256, 512, 0) }, { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) }, { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) }, -- 1.7.9.5