diff options
author | Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> | 2009-11-27 17:49:42 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-11-27 17:49:42 +0000 |
commit | 1c296ca8bc5985168e83edcf9502bab2421d44c1 (patch) | |
tree | ccbfa84c583ef476bca4aa6015d65b63ad291679 /en29f002a.c | |
parent | 797a8346cf8f07e6acfd29a370a2f40138470d94 (diff) | |
download | flashrom-1c296ca8bc5985168e83edcf9502bab2421d44c1.tar.gz flashrom-1c296ca8bc5985168e83edcf9502bab2421d44c1.tar.bz2 flashrom-1c296ca8bc5985168e83edcf9502bab2421d44c1.zip |
Use common jedec functionality where appropriate
The deleted function in en29f002a.c is reintroduced as
write_by_byte_jedec in jedec.c as it contains no chip-specific
instructions. It is not yet used in other chip drivers, as key addresses
(0x2AAA/0x5555) are often specified with less bits. After crosschecking
datasheets, most of the fixmes can probably be resolved as indicated in
them, causing significant code reduction.
The common JEDEC code for bytewise programming does not program 0xFF
at all. The chips that had a dedicated bytewise flash function which
has been changed to write_jedec_1 thus changed flashing behaviour
and the "write" test flag has been removed. This applies to: AMD
Am29F002BB/Am29F002NBB AMD Am29F002BT/Am29F002NBT (TEST_OK_PREW before)
AMIC A29002B AMIC A29002T (TEST_OK_PREW before) EON EN29F002(A)(N)B EON
EN29F002(A)(N)T (TEST_OK_PREW before) Macronix MX29F001B (TEST_OK_PREW
before) Macronix MX29F001T (TEST_OK_PREW before) Macronix MX29F002B
Macronix MX29F002T (TEST_OK_PREW before) Macronix MX29LV040
Similar analysis should be performed for the read id stuff.
Corresponding to flashrom svn r785.
Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'en29f002a.c')
-rw-r--r-- | en29f002a.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/en29f002a.c b/en29f002a.c index 14fccabb..020df329 100644 --- a/en29f002a.c +++ b/en29f002a.c @@ -87,39 +87,3 @@ int probe_en29f002a(struct flashchip *flash) return 0; } - -/* The EN29F002 chip needs repeated single byte writing, no block writing. */ -int write_en29f002a(struct flashchip *flash, uint8_t *buf) -{ - int i; - int total_size = flash->total_size * 1024; - chipaddr bios = flash->virtual_memory; - chipaddr dst = bios; - - //chip_writeb(0xF0, bios); - programmer_delay(10); - if (erase_chip_jedec(flash)) { - fprintf(stderr, "ERASE FAILED!\n"); - return -1; - } - - printf("Programming page: "); - for (i = 0; i < total_size; i++) { - /* write to the sector */ - if ((i & 0xfff) == 0) - printf("address: 0x%08lx", (unsigned long)i); - chip_writeb(0xAA, bios + 0x5555); - chip_writeb(0x55, bios + 0x2AAA); - chip_writeb(0xA0, bios + 0x5555); - chip_writeb(*buf++, dst++); - - /* wait for Toggle bit ready */ - toggle_ready_jedec(dst); - - if ((i & 0xfff) == 0) - printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"); - } - - printf("\n"); - return 0; -} |