jedec: Use common probing for EN29LV640B
Turns out this is just common probing with respective feature bits
and `.probe_timing`.
Change-Id: I5bbf23198966c4520e2c344d198cba4e4dcbc49b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/446
diff --git a/en29lv640b.c b/en29lv640b.c
index 8883a09..3f33a40 100644
--- a/en29lv640b.c
+++ b/en29lv640b.c
@@ -54,31 +54,3 @@
/* FIXME: Ignore errors for now. */
return 0;
}
-
-int probe_en29lv640b(struct flashctx *flash)
-{
- chipaddr bios = flash->virtual_memory;
- uint16_t id1, id2;
-
- chip_writeb(flash, 0xAA, bios + 0xAAA);
- chip_writeb(flash, 0x55, bios + 0x555);
- chip_writeb(flash, 0x90, bios + 0xAAA);
-
- programmer_delay(10);
-
- id1 = chip_readb(flash, bios + 0x200);
- id1 |= (chip_readb(flash, bios) << 8);
-
- id2 = chip_readb(flash, bios + 0x02);
-
- chip_writeb(flash, 0xF0, bios + 0xAAA);
-
- programmer_delay(10);
-
- msg_cdbg("%s: id1 0x%04x, id2 0x%04x\n", __func__, id1, id2);
-
- if (id1 == flash->chip->id.manufacture && id2 == flash->chip->id.model)
- return 1;
-
- return 0;
-}
diff --git a/flashchips.c b/flashchips.c
index 801cae2..853fa23 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -6609,15 +6609,15 @@
.vendor = "Eon",
.name = "EN29LV640B",
.bustype = BUS_PARALLEL,
- .id.type = ID_EN29LV640B,
+ .id.type = ID_JEDEC,
.id.manufacture = EON_ID,
.id.model = EON_EN29LV640B,
.total_size = 8192,
.page_size = 8192,
- .feature_bits = FEATURE_ADDR_SHIFTED,
- .tested = TEST_OK_PREW,
- .probe = probe_en29lv640b,
- .probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
+ .feature_bits = FEATURE_ADDR_SHIFTED | FEATURE_ADDR_AAA | FEATURE_SHORT_RESET,
+ .tested = {.probe = NT, .read = OK, .erase = OK, .write = OK},
+ .probe = probe_buses,
+ .probe_timing = 10, /* Datasheet has no timing info specified */
.block_erasers =
{
{
diff --git a/flashprog.c b/flashprog.c
index fc20045..13e3695 100644
--- a/flashprog.c
+++ b/flashprog.c
@@ -661,7 +661,6 @@
{
static const char *const id_names[] = {
[ID_82802AB] = "82802AB",
- [ID_EN29LV640B] = "EN29LV640B",
[ID_JEDEC] = "JEDEC",
[ID_JEDEC_29GL] = "JEDEC_29GL",
[ID_OPAQUE] = "OPAQUE",
diff --git a/include/chipdrivers/probing.h b/include/chipdrivers/probing.h
index 9d00970..a84d6e8 100644
--- a/include/chipdrivers/probing.h
+++ b/include/chipdrivers/probing.h
@@ -26,7 +26,6 @@
ID_82802AB,
ID_EDI,
- ID_EN29LV640B,
ID_JEDEC,
ID_JEDEC_29GL,
ID_OPAQUE,
diff --git a/jedec.c b/jedec.c
index 0c3ed0a..4ff1040 100644
--- a/jedec.c
+++ b/jedec.c
@@ -388,13 +388,14 @@
feature_bits_t features;
signed int probe_timing;
} additional_sets[] = {
- { 2*MiB, FEATURE_SHORT_RESET, TIMING_ZERO },
- { 2*MiB, FEATURE_LONG_RESET | FEATURE_ADDR_SHIFTED, 10 },
- { 512*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_SHIFTED, 10 },
- { 384*KiB, FEATURE_LONG_RESET, 1 },
- { 256*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_2AA, TIMING_FIXME },
- { 256*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_AAA, TIMING_ZERO },
- { 128*KiB, FEATURE_SHORT_RESET, TIMING_ZERO },
+ { 8*MiB, FEATURE_SHORT_RESET | FEATURE_ADDR_SHIFTED | FEATURE_ADDR_AAA, 10 },
+ { 2*MiB, FEATURE_SHORT_RESET, TIMING_ZERO },
+ { 2*MiB, FEATURE_LONG_RESET | FEATURE_ADDR_SHIFTED, 10 },
+ { 512*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_SHIFTED, 10 },
+ { 384*KiB, FEATURE_LONG_RESET, 1 },
+ { 256*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_2AA, TIMING_FIXME },
+ { 256*KiB, FEATURE_LONG_RESET | FEATURE_ADDR_AAA, TIMING_ZERO },
+ { 128*KiB, FEATURE_SHORT_RESET, TIMING_ZERO },
};
for (set = 0; set < ARRAY_SIZE(additional_sets); ++set) {
*next_ptr = probe_jedec_generic(par, additional_sets[set].chip_size,