summaryrefslogtreecommitdiffstats
path: root/82802ab.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-09-16 08:26:59 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2009-09-16 08:26:59 +0000
commitab044b20a2b44097ce65c3fd4f232ee7170303ba (patch)
tree4d4e3556312edc4be7fc90d073a2fbb79d86d687 /82802ab.c
parent9e72aa51a7a9ac5f041bacab75fd4be1e2a3356c (diff)
downloadast2050-flashrom-ab044b20a2b44097ce65c3fd4f232ee7170303ba.zip
ast2050-flashrom-ab044b20a2b44097ce65c3fd4f232ee7170303ba.tar.gz
Fix all remaining issues reported by LLVM/clang's scan-build
Corresponding to flashrom svn r723. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to '82802ab.c')
-rw-r--r--82802ab.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/82802ab.c b/82802ab.c
index d7194c1..b274d56 100644
--- a/82802ab.c
+++ b/82802ab.c
@@ -33,13 +33,13 @@
// I need that Berkeley bit-map printer
void print_82802ab_status(uint8_t status)
{
- printf("%s", status & 0x80 ? "Ready:" : "Busy:");
- printf("%s", status & 0x40 ? "BE SUSPEND:" : "BE RUN/FINISH:");
- printf("%s", status & 0x20 ? "BE ERROR:" : "BE OK:");
- printf("%s", status & 0x10 ? "PROG ERR:" : "PROG OK:");
- printf("%s", status & 0x8 ? "VP ERR:" : "VPP OK:");
- printf("%s", status & 0x4 ? "PROG SUSPEND:" : "PROG RUN/FINISH:");
- printf("%s", status & 0x2 ? "WP|TBL#|WP#,ABORT:" : "UNLOCK:");
+ printf_debug("%s", status & 0x80 ? "Ready:" : "Busy:");
+ printf_debug("%s", status & 0x40 ? "BE SUSPEND:" : "BE RUN/FINISH:");
+ printf_debug("%s", status & 0x20 ? "BE ERROR:" : "BE OK:");
+ printf_debug("%s", status & 0x10 ? "PROG ERR:" : "PROG OK:");
+ printf_debug("%s", status & 0x8 ? "VP ERR:" : "VPP OK:");
+ printf_debug("%s", status & 0x4 ? "PROG SUSPEND:" : "PROG RUN/FINISH:");
+ printf_debug("%s", status & 0x2 ? "WP|TBL#|WP#,ABORT:" : "UNLOCK:");
}
int probe_82802ab(struct flashchip *flash)
@@ -98,20 +98,19 @@ int erase_82802ab_block(struct flashchip *flash, int offset)
// clear status register
chip_writeb(0x50, bios);
- //printf("Erase at %p\n", bios);
+
// clear write protect
- //printf("write protect is at %p\n", (wrprotect));
- //printf("write protect is 0x%x\n", *(wrprotect));
chip_writeb(0, wrprotect);
- //printf("write protect is 0x%x\n", *(wrprotect));
// now start it
chip_writeb(0x20, bios);
chip_writeb(0xd0, bios);
programmer_delay(10);
+
// now let's see what the register is
status = wait_82802ab(flash->virtual_memory);
- //print_82802ab_status(status);
+ print_82802ab_status(status);
+
if (check_erased_range(flash, offset, flash->page_size)) {
fprintf(stderr, "ERASE FAILED!\n");
return -1;
OpenPOWER on IntegriCloud