diff --git a/chipdrivers.h b/chipdrivers.h
index adcb46d..f722133 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -76,18 +76,34 @@ int write_en29f002a(struct flashchip *flash, uint8_t *buf);
 uint8_t oddparity(uint8_t val);
 void toggle_ready_jedec(chipaddr dst);
 void data_polling_jedec(chipaddr dst, uint8_t data);
-void start_program_jedec(chipaddr bios);
-int write_byte_program_jedec(chipaddr bios, uint8_t *src,
-			     chipaddr dst);
+void start_program_jedec_common(chipaddr bios, unsigned int mask,
+			unsigned int shift);
+int write_byte_program_jedec(chipaddr bios, uint8_t *src, chipaddr dst);
+int probe_jedec_common(struct flashchip *flash, unsigned int entry_cmd,
+			unsigned int mid_cmd, unsigned int did_cmd,
+			unsigned int mask, unsigned int shift, int reset);
+int erase_chip_jedec_common(struct flashchip *flash, unsigned int mask,
+ 			    unsigned int shift);
+int write_jedec_common(struct flashchip *flash, uint8_t *buf,
+			unsigned int mask, unsigned int shift);
+int erase_sector_jedec_common(struct flashchip *flash, unsigned int page,
+			      unsigned int pagesize, unsigned int mask,
+			      unsigned int shift);
+int erase_block_jedec_common(struct flashchip *flash, unsigned int page,
+			     unsigned int blocksize, unsigned int mask,
+			     unsigned int shift);
+int erase_chip_block_jedec(struct flashchip *flash, unsigned int page,
+			   unsigned int blocksize);
+int write_sector_jedec_common(struct flashchip *flash, uint8_t *src, chipaddr dst,
+			     unsigned int page_size, unsigned int mask,
+			     unsigned int shift);
 int probe_jedec(struct flashchip *flash);
+int erase_sector_jedec(struct flashchip *flash, unsigned int page,
+			      unsigned int pagesize);
 int erase_chip_jedec(struct flashchip *flash);
+int erase_block_jedec(struct flashchip *flash, unsigned int page,
+			     unsigned int blocksize);
 int write_jedec(struct flashchip *flash, uint8_t *buf);
-int write_jedec_1(struct flashchip *flash, uint8_t *buf);
-int erase_sector_jedec(struct flashchip *flash, unsigned int page, unsigned int pagesize);
-int erase_block_jedec(struct flashchip *flash, unsigned int page, unsigned int blocksize);
-int erase_chip_block_jedec(struct flashchip *flash, unsigned int page, unsigned int blocksize);
-int write_sector_jedec(chipaddr bios, uint8_t *src,
-		       chipaddr dst, unsigned int page_size);
 
 /* m29f002.c */
 int erase_m29f002(struct flashchip *flash);
diff --git a/flashchips.c b/flashchips.c
index 59f9139..af9039d 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -106,7 +106,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_block_jedec,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -137,7 +137,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_block_jedec,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -1182,7 +1182,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_29f002,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -1213,7 +1213,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_29f002,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -1574,7 +1574,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_block_jedec,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -1605,7 +1605,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_block_jedec,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -2112,7 +2112,7 @@ struct flashchip flashchips[] = {
 		.probe		= probe_29f002,
 		.probe_timing	= TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */
 		.erase		= erase_29f002,
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -2128,7 +2128,7 @@ struct flashchip flashchips[] = {
 		.probe		= probe_29f002,
 		.probe_timing	= TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */
 		.erase		= erase_29f002,
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -2159,7 +2159,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_29f002,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -2190,7 +2190,7 @@ struct flashchip flashchips[] = {
 				.block_erase = erase_chip_29f002,
 			},
 		},
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
@@ -2206,7 +2206,7 @@ struct flashchip flashchips[] = {
 		.probe		= probe_29f002,
 		.probe_timing	= TIMING_IGNORED, /* routine don't use probe_timing (mx29f002.c) */
 		.erase		= erase_29f002,
-		.write		= write_jedec_1,
+		.write		= write_jedec,
 		.read		= read_memmapped,
 	},
 
diff --git a/jedec.c b/jedec.c
index d6cad41..86d3ac8 100644
--- a/jedec.c
+++ b/jedec.c
@@ -87,14 +87,16 @@ void data_polling_jedec(chipaddr dst, uint8_t data)
 		printf_debug("%s: excessive loops, i=0x%x\n", __func__, i);
 }
 
-void start_program_jedec(chipaddr bios)
+void start_program_jedec_common(chipaddr bios, unsigned int mask, unsigned int shift)
 {
-	chip_writeb(0xAA, bios + 0x5555);
-	chip_writeb(0x55, bios + 0x2AAA);
-	chip_writeb(0xA0, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
+	chip_writeb(0xA0, bios + (0x5555 & mask) );
 }
 
-int probe_jedec(struct flashchip *flash)
+int probe_jedec_common(struct flashchip *flash, unsigned int entry_cmd,
+			unsigned int mid_cmd, unsigned int did_cmd,
+			unsigned int mask, unsigned int shift, int reset)
 {
 	chipaddr bios = flash->virtual_memory;
 	uint8_t id1, id2;
@@ -118,19 +120,19 @@ int probe_jedec(struct flashchip *flash)
 	}
 
 	/* Issue JEDEC Product ID Entry command */
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	if (probe_timing_enter)
 		programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	if (probe_timing_enter)
 		programmer_delay(10);
-	chip_writeb(0x90, bios + 0x5555);
+	chip_writeb(0x90, bios + (0x5555 & mask) );
 	if (probe_timing_enter)
 		programmer_delay(probe_timing_enter);
 
 	/* Read product ID */
-	id1 = chip_readb(bios);
-	id2 = chip_readb(bios + 0x01);
+	id1 = chip_readb(bios + mid_cmd);
+	id2 = chip_readb(bios + did_cmd);
 	largeid1 = id1;
 	largeid2 = id2;
 
@@ -147,13 +149,16 @@ int probe_jedec(struct flashchip *flash)
 	}
 
 	/* Issue JEDEC Product ID Exit command */
-	chip_writeb(0xAA, bios + 0x5555);
-	if (probe_timing_exit)
-		programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
-	if (probe_timing_exit)
-		programmer_delay(10);
-	chip_writeb(0xF0, bios + 0x5555);
+	if (!reset)
+	{
+		chip_writeb(0xAA, bios + (0x5555 & mask) );
+		if (probe_timing_exit)
+			programmer_delay(10);
+		chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
+		if (probe_timing_exit)
+			programmer_delay(10);
+	}
+	chip_writeb(0xF0, bios + (0x5555 & mask) );
 	if (probe_timing_exit)
 		programmer_delay(probe_timing_exit);
 
@@ -184,24 +189,28 @@ int probe_jedec(struct flashchip *flash)
 	if (largeid1 == flash->manufacture_id && largeid2 == flash->model_id)
 		return 1;
 
+	//map_flash_registers(flash);
+
 	return 0;
 }
 
-int erase_sector_jedec(struct flashchip *flash, unsigned int page, unsigned int pagesize)
+int erase_sector_jedec_common(struct flashchip *flash, unsigned int page,
+			      unsigned int pagesize, unsigned int mask,
+			      unsigned int shift)
 {
 	chipaddr bios = flash->virtual_memory;
 
 	/*  Issue the Sector Erase command   */
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
-	chip_writeb(0x80, bios + 0x5555);
+	chip_writeb(0x80, bios + (0x5555 & mask) );
 	programmer_delay(10);
 
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
 	chip_writeb(0x30, bios + page);
 	programmer_delay(10);
@@ -216,21 +225,23 @@ int erase_sector_jedec(struct flashchip *flash, unsigned int page, unsigned int
 	return 0;
 }
 
-int erase_block_jedec(struct flashchip *flash, unsigned int block, unsigned int blocksize)
+int erase_block_jedec_common(struct flashchip *flash, unsigned int block,
+			     unsigned int blocksize, unsigned int mask,
+			     unsigned int shift)
 {
 	chipaddr bios = flash->virtual_memory;
 
 	/*  Issue the Sector Erase command   */
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
-	chip_writeb(0x80, bios + 0x5555);
+	chip_writeb(0x80, bios + (0x5555 & mask) );
 	programmer_delay(10);
 
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
 	chip_writeb(0x50, bios + block);
 	programmer_delay(10);
@@ -245,35 +256,25 @@ int erase_block_jedec(struct flashchip *flash, unsigned int block, unsigned int
 	return 0;
 }
 
-/* erase chip with block_erase() prototype */
-int erase_chip_block_jedec(struct flashchip *flash, unsigned int addr, unsigned int blocksize)
-{
-	if ((addr != 0) || (blocksize != flash->total_size * 1024)) {
-		fprintf(stderr, "%s called with incorrect arguments\n",
-			__func__);
-		return -1;
-	}
-	return erase_chip_jedec(flash);
-}
-
-int erase_chip_jedec(struct flashchip *flash)
+int erase_chip_jedec_common(struct flashchip *flash, unsigned int mask,
+			    unsigned int shift)
 {
 	int total_size = flash->total_size * 1024;
 	chipaddr bios = flash->virtual_memory;
 
 	/*  Issue the JEDEC Chip Erase command   */
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
-	chip_writeb(0x80, bios + 0x5555);
+	chip_writeb(0x80, bios + (0x5555 & mask) );
 	programmer_delay(10);
 
-	chip_writeb(0xAA, bios + 0x5555);
+	chip_writeb(0xAA, bios + (0x5555 & mask) );
 	programmer_delay(10);
-	chip_writeb(0x55, bios + 0x2AAA);
+	chip_writeb(0x55, bios + ((0x2AAA & mask)>>shift) );
 	programmer_delay(10);
-	chip_writeb(0x10, bios + 0x5555);
+	chip_writeb(0x10, bios + (0x5555 & mask) );
 	programmer_delay(10);
 
 	toggle_ready_jedec_slow(bios);
@@ -285,19 +286,29 @@ int erase_chip_jedec(struct flashchip *flash)
 	return 0;
 }
 
-int write_page_write_jedec(struct flashchip *flash, uint8_t *src,
-			   int start, int page_size)
+/* erase chip with block_erase() prototype */
+int erase_chip_block_jedec(struct flashchip *flash, unsigned int addr,
+ 			   unsigned int blocksize)
 {
-	int i, tried = 0, failed;
-	uint8_t *s = src;
-	chipaddr bios = flash->virtual_memory;
-	chipaddr dst = bios + start;
-	chipaddr d = dst;
+	if ((addr != 0) || (blocksize != flash->total_size * 1024)) {
+		fprintf(stderr, "%s called with incorrect arguments\n",
+			__func__);
+		return -1;
+	}
+	return erase_chip_jedec_common(flash, 0x0000, 0);
+}
 
-retry:
-	/* Issue JEDEC Data Unprotect comand */
-	start_program_jedec(bios);
+int write_helper_byte(uint8_t *src, chipaddr dst)
+{
+	/* transfer data from source to destination */
+	if (*src != 0xFF)
+		chip_writeb(*src, dst);
+	return 0;
+}
 
+int write_helper_page(uint8_t *src, chipaddr dst, int page_size)
+{
+	int i = 0;
 	/* transfer data from source to destination */
 	for (i = 0; i < page_size; i++) {
 		/* If the data is 0xFF, don't program it */
@@ -306,77 +317,53 @@ retry:
 		dst++;
 		src++;
 	}
-
-	toggle_ready_jedec(dst - 1);
-
-	dst = d;
-	src = s;
-	failed = verify_range(flash, src, start, page_size, NULL);
-
-	if (failed && tried++ < MAX_REFLASH_TRIES) {
-		fprintf(stderr, "retrying.\n");
-		goto retry;
-	}
-	if (failed) {
-		fprintf(stderr, " page 0x%lx failed!\n",
-			(d - bios) / page_size);
-	}
-	return failed;
+	return 0;
 }
 
-int write_byte_program_jedec(chipaddr bios, uint8_t *src,
-			     chipaddr dst)
+int write_sector_jedec_common(struct flashchip *flash, uint8_t *src,
+				  chipaddr dst, unsigned int page_size, unsigned int mask,
+				  unsigned int shift)
 {
-	int tried = 0, failed = 0;
-
-	/* If the data is 0xFF, don't program it and don't complain. */
-	if (*src == 0xFF) {
-		return 0;
-	}
+	int tried = 0, failed;
+	chipaddr bios = flash->virtual_memory;
+	chipaddr v = bios;
 
 retry:
-	/* Issue JEDEC Byte Program command */
-	start_program_jedec(bios);
-
-	/* transfer data from source to destination */
-	chip_writeb(*src, dst);
-	toggle_ready_jedec(bios);
+	/* Issue JEDEC Data Unprotect comand */
+	start_program_jedec_common(bios, mask, shift);
 
-	if (chip_readb(dst) != *src && tried++ < MAX_REFLASH_TRIES) {
-		goto retry;
+	if (page_size > 1)
+	{
+		failed = write_helper_page(src, dst, page_size);
+		v = dst - 1;
+	}
+	else
+	{
+		failed = write_helper_byte(src, dst);
 	}
 
-	if (tried >= MAX_REFLASH_TRIES)
-		failed = 1;
-
-	return failed;
-}
-
-int write_sector_jedec(chipaddr bios, uint8_t *src,
-		       chipaddr dst, unsigned int page_size)
-{
-	int i, failed = 0;
-	chipaddr olddst;
+	toggle_ready_jedec(v);
+	//failed = verify_range(flash, src, start, page_size, NULL);
 
-	olddst = dst;
-	for (i = 0; i < page_size; i++) {
-		if (write_byte_program_jedec(bios, src, dst))
-			failed = 1;
-		dst++, src++;
+	if (failed && tried++ < MAX_REFLASH_TRIES) {
+		fprintf(stderr, "retrying.\n");
+		goto retry;
+	}
+	if (failed) {
+		fprintf(stderr, " page 0x%lx failed!\n",
+			(dst - bios) / page_size);
 	}
-	if (failed)
-		fprintf(stderr, " writing sector at 0x%lx failed!\n", olddst);
-
 	return failed;
 }
 
-int write_jedec(struct flashchip *flash, uint8_t *buf)
+int write_jedec_common(struct flashchip *flash, uint8_t *buf, unsigned int mask,
+			unsigned int shift)
 {
 	int i, failed = 0;
 	int total_size = flash->total_size * 1024;
 	int page_size = flash->page_size;
 
-	if (erase_chip_jedec(flash)) {
+	if (erase_chip_jedec_common(flash, mask, shift)) {
 		fprintf(stderr,"ERASE FAILED!\n");
 		return -1;
 	}
@@ -384,8 +371,8 @@ int write_jedec(struct flashchip *flash, uint8_t *buf)
 	printf("Programming page: ");
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x", i, i * page_size);
-		if (write_page_write_jedec(flash, buf + i * page_size,
-					   i * page_size, page_size))
+		if (write_sector_jedec_common(flash, buf + i * page_size,
+					   i * page_size, page_size, mask, shift))
 			failed = 1;
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
@@ -394,29 +381,68 @@ int write_jedec(struct flashchip *flash, uint8_t *buf)
 	return failed;
 }
 
-int write_jedec_1(struct flashchip *flash, uint8_t * buf)
+void start_program_jedec(chipaddr bios)
 {
-	int i;
-	chipaddr bios = flash->virtual_memory;
-	chipaddr dst = bios;
+	start_program_jedec_common(bios, 0x0000, 0);
+}
 
-	programmer_delay(10);
-	if (erase_flash(flash)) {
-		fprintf(stderr, "ERASE FAILED!\n");
-		return -1;
-	}
+void start_program_jedec_2aa(chipaddr bios)
+{
+	start_program_jedec_common(bios, 0xf000, 2);
+}
 
-	printf("Programming page: ");
-	for (i = 0; i < flash->total_size; i++) {
-		if ((i & 0x3) == 0)
-			printf("address: 0x%08lx", (unsigned long)i * 1024);
+void start_program_jedec_aaa(chipaddr bios)
+{
+	start_program_jedec_common(bios, 0xf000, 0);
+}
 
-                write_sector_jedec(bios, buf + i * 1024, dst + i * 1024, 1024);
+int probe_jedec(struct flashchip *flash)
+{
+	return probe_jedec_common(flash, 0x90, 0x00, 0x01, 0x0000, 0, 0);
+}
 
-		if ((i & 0x3) == 0)
-			printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
-	}
+int probe_jedec_2aa_reset(struct flashchip *flash)
+{
+	return probe_jedec_common(flash, 0x90, 0x00, 0x01, 0xf000, 2, 1);
+}
 
-	printf("\n");
-	return 0;
+int probe_jedec_aaa_did_02(struct flashchip *flash)
+{
+	return probe_jedec_common(flash, 0x90, 0x00, 0x02, 0xf000, 0, 0);
+}
+
+int probe_jedec_60(struct flashchip *flash)
+{
+	return probe_jedec_common(flash, 0x60, 0x00, 0x01, 0x0000, 0, 0);
+}
+
+int erase_sector_jedec(struct flashchip *flash, unsigned int page, unsigned int size)
+{
+	return erase_sector_jedec_common(flash, page, size, 0x0000, 0);
+}
+
+int erase_sector_jedec_2aa(struct flashchip *flash, unsigned int page, unsigned int size)
+{
+	return erase_sector_jedec_common(flash, page, size, 0xf000, 2);
+}
+
+int erase_sector_jedec_aaa(struct flashchip *flash, unsigned int page, unsigned int size)
+{
+	return erase_sector_jedec_common(flash, page, size, 0xf000, 0);
+}
+
+int erase_block_jedec(struct flashchip *flash, unsigned int page, unsigned int size)
+{
+	return erase_block_jedec_common(flash, page, size, 0x0000, 0);
+}
+
+int erase_chip_jedec(struct flashchip *flash)
+{
+	return erase_chip_jedec_common(flash, 0x0000, 0);
 }
+
+int write_jedec(struct flashchip *flash, uint8_t *buf)
+{
+	return write_jedec_common(flash, buf, 0x0000, 0);
+}
+
diff --git a/pm29f002.c b/pm29f002.c
index bf78d13..8f1d010 100644
--- a/pm29f002.c
+++ b/pm29f002.c
@@ -21,7 +21,7 @@
 #include "flash.h"
 
 /* if write_sector_jedec is used,
-   this is write_jedec_1 */
+   this is write_jedec */
 int write_pm29f002(struct flashchip *flash, uint8_t *buf)
 {
 	int i, total_size = flash->total_size * 1024;
diff --git a/pm49fl00x.c b/pm49fl00x.c
index 27a1163..a016928 100644
--- a/pm49fl00x.c
+++ b/pm49fl00x.c
@@ -101,8 +101,8 @@ int write_49fl00x(struct flashchip *flash, uint8_t *buf)
 
 		/* write to the sector */
 		printf("%04d at address: 0x%08x", i, i * page_size);
-		write_sector_jedec(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
+		write_sector_jedec_common(flash, buf + i * page_size,
+				   bios + i * page_size, page_size,0,0);
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 		fflush(stdout);
 	}
diff --git a/sst49lf040.c b/sst49lf040.c
index ab1c918..821347b 100644
--- a/sst49lf040.c
+++ b/sst49lf040.c
@@ -59,8 +59,8 @@ int write_49lf040(struct flashchip *flash, uint8_t *buf)
 		if (i % 10 == 0)
 			printf("%04d at address: 0x%08x ", i, i * page_size);
 
-		write_sector_jedec(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
+		write_sector_jedec_common(flash, buf + i * page_size,
+				   bios + i * page_size, page_size, 0, 0);
 
 		if (i % 10 == 0)
 			printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
diff --git a/sst_fwhub.c b/sst_fwhub.c
index f09aa54..079dec5 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -157,8 +157,8 @@ int write_sst_fwhub(struct flashchip *flash, uint8_t *buf)
 						   page_size);
 			if (rc)
 				return 1;
-			write_sector_jedec(bios, buf + i * page_size,
-					   bios + i * page_size, page_size);
+			write_sector_jedec_common(flash, buf + i * page_size,
+					   bios + i * page_size, page_size, 0, 0);
 		}
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
diff --git a/w39v040c.c b/w39v040c.c
index 722ae29..b4b72ca 100644
--- a/w39v040c.c
+++ b/w39v040c.c
@@ -80,8 +80,8 @@ int write_w39v040c(struct flashchip *flash, uint8_t *buf)
 	printf("Programming page: ");
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x", i, i * page_size);
-		write_sector_jedec(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
+		write_sector_jedec_common(flash, buf + i * page_size,
+				   bios + i * page_size, page_size, 0, 0);
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 	printf("\n");
diff --git a/w39v080fa.c b/w39v080fa.c
index 580657f..ec06d1b 100644
--- a/w39v080fa.c
+++ b/w39v080fa.c
@@ -182,7 +182,7 @@ int write_winbond_fwhub(struct flashchip *flash, uint8_t *buf)
 	printf("Programming: ");
 	for (i = 0; i < total_size; i += flash->page_size) {
 		printf("0x%08x\b\b\b\b\b\b\b\b\b\b", i);
-		write_sector_jedec(bios, buf + i, bios + i, flash->page_size);
+		write_sector_jedec_common(flash, buf + i, bios + i, flash->page_size, 0, 0);
 	}
 	printf("\n");
 
diff --git a/w49f002u.c b/w49f002u.c
index d12bc72..28eaa99 100644
--- a/w49f002u.c
+++ b/w49f002u.c
@@ -36,8 +36,8 @@ int write_49f002(struct flashchip *flash, uint8_t *buf)
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x ", i, i * page_size);
 		/* Byte-wise writing of 'page_size' bytes. */
-		write_sector_jedec(bios, buf + i * page_size,
-				   bios + i * page_size, page_size);
+		write_sector_jedec_common(flash, buf + i * page_size,
+				   bios + i * page_size, page_size, 0, 0);
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 		fflush(stdout);
 	}
