[flashrom] [PATCH] Rename spi_chip_write_256 to spi_chip_write_page

Mark Marshall markmarshall14 at gmail.com
Thu Mar 28 13:18:56 CET 2013


It seems that the spi_chip_write_256 function writes a page of
data (not always 256 bytes), so rename the function to indicate
what it does.

Signed-off-by: Mark Marshall <mark.marshall at omicron.at>
---
 bitbang_spi.c    |    2 +-
 buspirate_spi.c  |    2 +-
 chipdrivers.h    |    2 +-
 dediprog.c       |    4 +-
 dummyflasher.c   |   18 ++--
 flashchips.c     |  314 +++++++++++++++++++++++++++---------------------------
 ft2232_spi.c     |    2 +-
 ichspi.c         |    6 +-
 it85spi.c        |    2 +-
 it87spi.c        |    6 +-
 jedec.c          |    5 +-
 linux_spi.c      |    6 +-
 programmer.h     |    4 +-
 sb600spi.c       |    2 +-
 serprog.c        |    2 +-
 sfdp.c           |    2 +-
 spi.c            |   10 +-
 spi25.c          |    2 +-
 usbblaster_spi.c |    2 +-
 wbsio_spi.c      |    2 +-
 20 files changed, 198 insertions(+), 197 deletions(-)

diff --git a/bitbang_spi.c b/bitbang_spi.c
index b10fc26..20f9a3f 100644
--- a/bitbang_spi.c
+++ b/bitbang_spi.c
@@ -70,7 +70,7 @@ static const struct spi_programmer spi_programmer_bitbang = {
 	.command	= bitbang_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/buspirate_spi.c b/buspirate_spi.c
index d2ebc75..c0e5b0d 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -141,7 +141,7 @@ static struct spi_programmer spi_programmer_buspirate = {
 	.command	= NULL,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/chipdrivers.h b/chipdrivers.h
index e9d0b7f..83524ee 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -29,7 +29,7 @@

 /* spi.c */
 int spi_aai_write(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
-int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
+int spi_chip_write_page(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
 int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int
start, int unsigned len);

 /* spi25.c */
diff --git a/dediprog.c b/dediprog.c
index ae86810..fe035eb 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -415,7 +415,7 @@ static int dediprog_spi_write(struct flashctx
*flash, uint8_t *buf,
 	return 0;
 }

-static int dediprog_spi_write_256(struct flashctx *flash, uint8_t
*buf, unsigned int start, unsigned int len)
+static int dediprog_spi_write_page(struct flashctx *flash, uint8_t
*buf, unsigned int start, unsigned int len)
 {
 	return dediprog_spi_write(flash, buf, start, len, DEDI_SPI_CMD_PAGEWRITE);
 }
@@ -751,7 +751,7 @@ static const struct spi_programmer
spi_programmer_dediprog = {
 	.command	= dediprog_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= dediprog_spi_read,
-	.write_256	= dediprog_spi_write_256,
+	.write_page	= dediprog_spi_write_page,
 	.write_aai	= dediprog_spi_write_aai,
 };

diff --git a/dummyflasher.c b/dummyflasher.c
index 5cb1c35..dea00d0 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -94,13 +94,13 @@ static const uint8_t sfdp_table[] = {
 #endif
 #endif

-static unsigned int spi_write_256_chunksize = 256;
+static unsigned int spi_write_page_chunksize = 256;

 static int dummy_spi_send_command(struct flashctx *flash, unsigned
int writecnt,
 				  unsigned int readcnt,
 				  const unsigned char *writearr,
 				  unsigned char *readarr);
-static int dummy_spi_write_256(struct flashctx *flash, const uint8_t *buf,
+static int dummy_spi_write_page(struct flashctx *flash, const uint8_t *buf,
 			       unsigned int start, unsigned int len);
 static void dummy_chip_writeb(const struct flashctx *flash, uint8_t val,
 			      chipaddr addr);
@@ -126,7 +126,7 @@ static const struct spi_programmer
spi_programmer_dummyflasher = {
 	.command	= dummy_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= dummy_spi_write_256,
+	.write_page	= dummy_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

@@ -202,12 +202,12 @@ int dummy_init(void)
 		msg_pdbg("Support for all flash bus types disabled.\n");
 	free(bustext);

-	tmp = extract_programmer_param("spi_write_256_chunksize");
+	tmp = extract_programmer_param("spi_write_page_chunksize");
 	if (tmp) {
-		spi_write_256_chunksize = atoi(tmp);
+		spi_write_page_chunksize = atoi(tmp);
 		free(tmp);
-		if (spi_write_256_chunksize < 1) {
-			msg_perr("invalid spi_write_256_chunksize\n");
+		if (spi_write_page_chunksize < 1) {
+			msg_perr("invalid spi_write_page_chunksize\n");
 			return 1;
 		}
 	}
@@ -846,9 +846,9 @@ static int dummy_spi_send_command(struct flashctx
*flash, unsigned int writecnt,
 	return 0;
 }

-static int dummy_spi_write_256(struct flashctx *flash, const uint8_t *buf,
+static int dummy_spi_write_page(struct flashctx *flash, const uint8_t *buf,
 			       unsigned int start, unsigned int len)
 {
 	return spi_write_chunked(flash, buf, start, len,
-				 spi_write_256_chunksize);
+				 spi_write_page_chunksize);
 }
diff --git a/flashchips.c b/flashchips.c
index a7e6d8b..4d01c0e 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -566,7 +566,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -600,7 +600,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -635,7 +635,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -670,7 +670,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -705,7 +705,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -740,7 +740,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -780,7 +780,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -815,7 +815,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -850,7 +850,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -888,7 +888,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -926,7 +926,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -958,7 +958,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -990,7 +990,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1022,7 +1022,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1054,7 +1054,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1086,7 +1086,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1118,7 +1118,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1157,7 +1157,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_amic_a25l032,
 		.unlock		= NULL, /* Two status reg bytes (read with 0x35 and 0x05) */
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1196,7 +1196,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_amic_a25l032,
 		.unlock		= NULL, /* Two status reg bytes (read with 0x35 and 0x05) */
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1354,7 +1354,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df,
 		.unlock		= spi_disable_blockprotect_at25df,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600}, /* 2.3-3.6V & 2.7-3.6V models available */
 	},
@@ -1392,7 +1392,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df,
 		.unlock		= spi_disable_blockprotect_at25df,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600}, /* 2.3-3.6V & 2.7-3.6V models available */
 	},
@@ -1430,7 +1430,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df,
 		.unlock		= spi_disable_blockprotect_at25df,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {1600, 2000}, /* Datasheet says range is 1.65-1.95 V */
 	},
@@ -1468,7 +1468,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df_sec,
 		.unlock		= spi_disable_blockprotect_at25df_sec,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1506,7 +1506,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df_sec,
 		.unlock		= spi_disable_blockprotect_at25df_sec,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1544,7 +1544,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df,
 		.unlock		= spi_disable_blockprotect_at25df,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1583,7 +1583,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df_sec,
 		.unlock		= spi_disable_blockprotect_at25df_sec,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1621,7 +1621,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df_sec,
 		.unlock		= spi_disable_blockprotect_at25df_sec,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1660,7 +1660,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df_sec,
 		.unlock		= spi_disable_blockprotect_at25df_sec,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1689,7 +1689,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25f,
 		.unlock		= spi_disable_blockprotect_at25f,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1719,7 +1719,7 @@ const struct flashchip flashchips[] = {
 		.printlock	= spi_prettyprint_status_register_at25f512a,
 		/* FIXME: It is not correct to use this one, because the BP1 bit is N/A. */
 		.unlock		= spi_disable_blockprotect_at25f512a,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1761,7 +1761,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25f512b,
 		.unlock		= spi_disable_blockprotect_at25f512b,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1792,7 +1792,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25f,
 		.unlock		= spi_disable_blockprotect_at25f,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1821,7 +1821,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25f,
 		.unlock		= spi_disable_blockprotect_at25f,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1850,7 +1850,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25f4096,
 		.unlock		= spi_disable_blockprotect_at25f4096,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1891,7 +1891,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25fs010,
 		.unlock		= spi_disable_blockprotect_at25fs010,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1929,7 +1929,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25fs040,
 		.unlock		= spi_disable_blockprotect_at25fs040,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -1999,7 +1999,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at26df081a,
 		.unlock		= spi_disable_blockprotect_at25df,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2037,7 +2037,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at25df,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2075,7 +2075,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_at26df081a,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2095,7 +2095,7 @@ const struct flashchip flashchips[] = {
 		.probe_timing	= TIMING_ZERO,
 		.printlock	= spi_prettyprint_status_register_at26df081a,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	  },*/

@@ -2808,7 +2808,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2842,7 +2842,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2876,7 +2876,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2910,7 +2910,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2945,7 +2945,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -2980,7 +2980,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3015,7 +3015,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3050,7 +3050,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3085,7 +3085,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3120,7 +3120,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3155,7 +3155,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3190,7 +3190,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3225,7 +3225,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3260,7 +3260,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3295,7 +3295,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3330,7 +3330,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3368,7 +3368,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3406,7 +3406,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3444,7 +3444,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3479,7 +3479,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3514,7 +3514,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3549,7 +3549,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3584,7 +3584,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3619,7 +3619,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3655,7 +3655,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3691,7 +3691,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3733,7 +3733,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3769,7 +3769,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3805,7 +3805,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3841,7 +3841,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -3877,7 +3877,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -3914,7 +3914,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4203,7 +4203,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4241,7 +4241,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4280,7 +4280,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4319,7 +4319,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4358,7 +4358,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4397,7 +4397,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4436,7 +4436,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -4475,7 +4475,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {1700, 1950},
 	},
@@ -4605,7 +4605,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -4644,7 +4644,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -4683,7 +4683,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -4722,7 +4722,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -4761,7 +4761,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -4800,7 +4800,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_s33,
 		.unlock		= spi_disable_blockprotect_s33,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,	/* also fast read 0x0B */
 		.voltage	= {2700, 3600},
 	},
@@ -5103,7 +5103,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported, MX25L512E
supports dual I/O */
 		.voltage	= {2700, 3600}, /* 2.35-3.6V for MX25V512(C) */
 	},
@@ -5139,7 +5139,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported, MX25L1006E
supports dual I/O */
 		.voltage	= {2700, 3600},
 	},
@@ -5177,7 +5177,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5215,7 +5215,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5253,7 +5253,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600}, /* 2.35-3.6V for MX25V8005 */
 	},
@@ -5288,7 +5288,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2, /* bit6:
error flag */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5327,7 +5327,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /*
MX25L1605A bp2 only */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5362,7 +5362,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6:
Continously Program (CP) mode */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B), dual I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5398,7 +5398,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5434,7 +5434,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5469,7 +5469,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp2, /* bit6:
error flag */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5505,7 +5505,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6: CP mode */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and dual I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5544,7 +5544,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and dual I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5580,7 +5580,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5616,7 +5616,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
has different meanings */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5652,7 +5652,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
for 36E is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -5692,7 +5692,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5728,7 +5728,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* MX25L12805D: Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -5769,7 +5769,7 @@ const struct flashchip flashchips[] = {
 		/* TODO: security register */
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1650, 2000},
 	},
@@ -5811,7 +5811,7 @@ const struct flashchip flashchips[] = {
 		/* TODO: security register */
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1650, 2000},
 	},
@@ -5853,7 +5853,7 @@ const struct flashchip flashchips[] = {
 		/* TODO: security register */
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* bit6
is quad enable */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1650, 2000},
 	},
@@ -6258,7 +6258,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6290,7 +6290,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6322,7 +6322,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6354,7 +6354,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6386,7 +6386,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6422,7 +6422,7 @@ const struct flashchip flashchips[] = {
 			}
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1700, 2000},
 	},
@@ -6455,7 +6455,7 @@ const struct flashchip flashchips[] = {
 			}
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1700, 2000},
 	},
@@ -6488,7 +6488,7 @@ const struct flashchip flashchips[] = {
 			}
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -6521,7 +6521,7 @@ const struct flashchip flashchips[] = {
 			}
 		},
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {1700, 2000},
 	},
@@ -6555,7 +6555,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
 		.voltage	= {2700, 3600},
 	},
@@ -6587,7 +6587,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6625,7 +6625,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6657,7 +6657,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6689,7 +6689,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6727,7 +6727,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -6759,7 +6759,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7033,7 +7033,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -7124,7 +7124,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7153,7 +7153,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7182,7 +7182,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7211,7 +7211,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7240,7 +7240,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7269,7 +7269,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -7479,7 +7479,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_sst25, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8580,7 +8580,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8643,7 +8643,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8702,7 +8702,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -8731,7 +8731,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp1,
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
 	},
@@ -8760,7 +8760,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8789,7 +8789,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -8817,7 +8817,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8846,7 +8846,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8875,7 +8875,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8904,7 +8904,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8933,7 +8933,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_default_bp3, /* TODO: check */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -8966,7 +8966,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -8997,7 +8997,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -9029,7 +9029,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -9847,7 +9847,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -9886,7 +9886,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -9925,7 +9925,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -9964,7 +9964,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -10002,7 +10002,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 	},

@@ -10033,7 +10033,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10065,7 +10065,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10097,7 +10097,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10129,7 +10129,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10167,7 +10167,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10205,7 +10205,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
@@ -10243,7 +10243,7 @@ const struct flashchip flashchips[] = {
 		},
 		.printlock	= spi_prettyprint_status_register_plain, /* TODO: improve */
 		.unlock		= spi_disable_blockprotect,
-		.write		= spi_chip_write_256,
+		.write		= spi_chip_write_page,
 		.read		= spi_chip_read,
 		.voltage	= {2700, 3600},
 	},
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 81be051..5ddfd84 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -151,7 +151,7 @@ static const struct spi_programmer spi_programmer_ft2232 = {
 	.command	= ft2232_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/ichspi.c b/ichspi.c
index 72942f6..6b7aa94 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1521,7 +1521,7 @@ static const struct spi_programmer spi_programmer_ich7 = {
 	.command = ich_spi_send_command,
 	.multicommand = ich_spi_send_multicommand,
 	.read = default_spi_read,
-	.write_256 = default_spi_write_256,
+	.write_page = default_spi_write_page,
 	.write_aai = default_spi_write_aai,
 };

@@ -1532,7 +1532,7 @@ static const struct spi_programmer spi_programmer_ich9 = {
 	.command = ich_spi_send_command,
 	.multicommand = ich_spi_send_multicommand,
 	.read = default_spi_read,
-	.write_256 = default_spi_write_256,
+	.write_page = default_spi_write_page,
 	.write_aai = default_spi_write_aai,
 };

@@ -1837,7 +1837,7 @@ static const struct spi_programmer spi_programmer_via = {
 	.command = ich_spi_send_command,
 	.multicommand = ich_spi_send_multicommand,
 	.read = default_spi_read,
-	.write_256 = default_spi_write_256,
+	.write_page = default_spi_write_page,
 	.write_aai = default_spi_write_aai,
 };

diff --git a/it85spi.c b/it85spi.c
index 0b074eb..d2cf3ab 100644
--- a/it85spi.c
+++ b/it85spi.c
@@ -283,7 +283,7 @@ static const struct spi_programmer spi_programmer_it85xx = {
 	.command	= it85xx_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/it87spi.c b/it87spi.c
index 5320bc7..f2949c7 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -107,7 +107,7 @@ static int it8716f_spi_send_command(struct flashctx *flash,
 				    unsigned char *readarr);
 static int it8716f_spi_chip_read(struct flashctx *flash, uint8_t *buf,
 				 unsigned int start, unsigned int len);
-static int it8716f_spi_chip_write_256(struct flashctx *flash, const
uint8_t *buf,
+static int it8716f_spi_chip_write_page(struct flashctx *flash, const
uint8_t *buf,
 				      unsigned int start, unsigned int len);

 static const struct spi_programmer spi_programmer_it87xx = {
@@ -117,7 +117,7 @@ static const struct spi_programmer spi_programmer_it87xx = {
 	.command	= it8716f_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= it8716f_spi_chip_read,
-	.write_256	= it8716f_spi_chip_write_256,
+	.write_page	= it8716f_spi_chip_write_page,
 	.write_aai	= default_spi_write_aai,
 };

@@ -361,7 +361,7 @@ static int it8716f_spi_chip_read(struct flashctx
*flash, uint8_t *buf,
 	return 0;
 }

-static int it8716f_spi_chip_write_256(struct flashctx *flash, const
uint8_t *buf,
+static int it8716f_spi_chip_write_page(struct flashctx *flash, const
uint8_t *buf,
 				      unsigned int start, unsigned int len)
 {
 	const struct flashchip *chip = flash->chip;
diff --git a/jedec.c b/jedec.c
index 7bc9133..8445bd9 100644
--- a/jedec.c
+++ b/jedec.c
@@ -381,8 +381,9 @@ int write_jedec_1(struct flashctx *flash, uint8_t
*src, unsigned int start,
 	return failed;
 }

-int write_page_write_jedec_common(struct flashctx *flash, uint8_t *src,
-				  unsigned int start, unsigned int page_size)
+static int write_page_write_jedec_common(struct flashctx *flash, uint8_t *src,
+					 unsigned int start,
+					 unsigned int page_size)
 {
 	int i, tried = 0, failed;
 	uint8_t *s = src;
diff --git a/linux_spi.c b/linux_spi.c
index a09d06b..7e18306 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -43,7 +43,7 @@ static int linux_spi_send_command(struct flashctx
*flash, unsigned int writecnt,
 				  unsigned char *rxbuf);
 static int linux_spi_read(struct flashctx *flash, uint8_t *buf,
 			  unsigned int start, unsigned int len);
-static int linux_spi_write_256(struct flashctx *flash, const uint8_t *buf,
+static int linux_spi_write_page(struct flashctx *flash, const uint8_t *buf,
 			       unsigned int start, unsigned int len);

 static const struct spi_programmer spi_programmer_linux = {
@@ -53,7 +53,7 @@ static const struct spi_programmer spi_programmer_linux = {
 	.command	= linux_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= linux_spi_read,
-	.write_256	= linux_spi_write_256,
+	.write_page	= linux_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

@@ -174,7 +174,7 @@ static int linux_spi_read(struct flashctx *flash,
uint8_t *buf,
 				(unsigned int)getpagesize());
 }

-static int linux_spi_write_256(struct flashctx *flash, const uint8_t *buf,
+static int linux_spi_write_page(struct flashctx *flash, const uint8_t *buf,
 			       unsigned int start, unsigned int len)
 {
 	return spi_write_chunked(flash, buf, start, len,
diff --git a/programmer.h b/programmer.h
index 5ba5855..80f9cee 100644
--- a/programmer.h
+++ b/programmer.h
@@ -536,7 +536,7 @@ struct spi_programmer {

 	/* Optimized functions for this programmer */
 	int (*read)(struct flashctx *flash, uint8_t *buf, unsigned int
start, unsigned int len);
-	int (*write_256)(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
+	int (*write_page)(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
 	int (*write_aai)(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
 	const void *data;
 };
@@ -545,7 +545,7 @@ int default_spi_send_command(struct flashctx
*flash, unsigned int writecnt, unsi
 			     const unsigned char *writearr, unsigned char *readarr);
 int default_spi_send_multicommand(struct flashctx *flash, struct
spi_command *cmds);
 int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned
int start, unsigned int len);
-int default_spi_write_256(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
+int default_spi_write_page(struct flashctx *flash, const uint8_t
*buf, unsigned int start, unsigned int len);
 int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
 int register_spi_programmer(const struct spi_programmer *programmer);

diff --git a/sb600spi.c b/sb600spi.c
index fe60aa9..acade2c 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -201,7 +201,7 @@ static const struct spi_programmer spi_programmer_sb600 = {
 	.command = sb600_spi_send_command,
 	.multicommand = default_spi_send_multicommand,
 	.read = default_spi_read,
-	.write_256 = default_spi_write_256,
+	.write_page = default_spi_write_page,
 	.write_aai = default_spi_write_aai,
 };

diff --git a/serprog.c b/serprog.c
index c36c93d..82149a5 100644
--- a/serprog.c
+++ b/serprog.c
@@ -322,7 +322,7 @@ static struct spi_programmer spi_programmer_serprog = {
 	.command	= serprog_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= serprog_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/sfdp.c b/sfdp.c
index bc69dd0..7232414 100644
--- a/sfdp.c
+++ b/sfdp.c
@@ -187,7 +187,7 @@ static int sfdp_fill_flash(struct flashchip *chip,
uint8_t *buf, uint16_t len)
 	if (tmp32 & (1 << 2)) {
 		msg_cdbg2("at least 64 B.\n");
 		chip->page_size = 64;
-		chip->write = spi_chip_write_256;
+		chip->write = spi_chip_write_page;
 	} else {
 		msg_cdbg2("1 B only.\n");
 		chip->page_size = 256;
diff --git a/spi.c b/spi.c
index 2b10eab..7c49fba 100644
--- a/spi.c
+++ b/spi.c
@@ -88,7 +88,7 @@ int default_spi_read(struct flashctx *flash, uint8_t
*buf, unsigned int start,
 	return spi_read_chunked(flash, buf, start, len, max_data);
 }

-int default_spi_write_256(struct flashctx *flash, const uint8_t *buf,
+int default_spi_write_page(struct flashctx *flash, const uint8_t *buf,
 			  unsigned int start, unsigned int len)
 {
 	unsigned int max_data = flash->pgm->spi.max_data_write;
@@ -134,13 +134,13 @@ int spi_chip_read(struct flashctx *flash,
uint8_t *buf, unsigned int start,
  * Program chip using page (256 bytes) programming.
  * Some SPI masters can't do this, they use single byte programming instead.
  * The redirect to single byte programming is achieved by setting
- * .write_256 = spi_chip_write_1
+ * .write_page = spi_chip_write_1
  */
 /* real chunksize is up to 256, logical chunksize is 256 */
-int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf,
+int spi_chip_write_page(struct flashctx *flash, const uint8_t *buf,
 		       unsigned int start, unsigned int len)
 {
-	return flash->pgm->spi.write_256(flash, buf, start, len);
+	return flash->pgm->spi.write_page(flash, buf, start, len);
 }

 /*
@@ -174,7 +174,7 @@ int register_spi_programmer(const struct
spi_programmer *pgm)
 {
 	struct registered_programmer rpgm;

-	if (!pgm->write_aai || !pgm->write_256 || !pgm->read || !pgm->command ||
+	if (!pgm->write_aai || !pgm->write_page || !pgm->read || !pgm->command ||
 	    !pgm->multicommand ||
 	    ((pgm->command == default_spi_send_command) &&
 	     (pgm->multicommand == default_spi_send_multicommand))) {
diff --git a/spi25.c b/spi25.c
index 06584bc..174bdcf 100644
--- a/spi25.c
+++ b/spi25.c
@@ -974,7 +974,7 @@ int spi_write_chunked(struct flashctx *flash,
const uint8_t *buf,
 	unsigned int pos, j, lenhere, towrite, page_end;
 	/* FIXME: page_size is the wrong variable. We need max_writechunk_size
 	 * in struct flashctx to do this properly. All chips using
-	 * spi_chip_write_256 have page_size set to max_writechunk_size, so
+	 * spi_chip_write_page have page_size set to max_writechunk_size, so
 	 * we're OK for now.
 	 */
 	unsigned int page_size = flash->chip->page_size;
diff --git a/usbblaster_spi.c b/usbblaster_spi.c
index 86fd573..fd3734d 100644
--- a/usbblaster_spi.c
+++ b/usbblaster_spi.c
@@ -218,7 +218,7 @@ static const struct spi_programmer
spi_programmer_usbblaster = {
 	.command	= usbblaster_spi_send_command,
 	.multicommand	= default_spi_send_multicommand,
 	.read		= default_spi_read,
-	.write_256	= default_spi_write_256,
+	.write_page	= default_spi_write_page,
 	.write_aai	= default_spi_write_aai,
 };

diff --git a/wbsio_spi.c b/wbsio_spi.c
index 7d4bb2a..0cfe31c 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -75,7 +75,7 @@ static const struct spi_programmer spi_programmer_wbsio = {
 	.command = wbsio_spi_send_command,
 	.multicommand = default_spi_send_multicommand,
 	.read = wbsio_spi_read,
-	.write_256 = spi_chip_write_1,
+	.write_page = spi_chip_write_1,
 	.write_aai = default_spi_write_aai,
 };




More information about the flashrom mailing list