summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-15 17:23:36 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-15 17:23:36 +0000
commit30f7cb2f3c570c99b61bd5df72621f44f1bdd0d0 (patch)
treed714754c298d7d247786e19c4b2b4afd6067a795 /flash.h
parent084546449983c1d6f147c1a3e381e225887e322c (diff)
downloadast2050-flashrom-30f7cb2f3c570c99b61bd5df72621f44f1bdd0d0.zip
ast2050-flashrom-30f7cb2f3c570c99b61bd5df72621f44f1bdd0d0.tar.gz
Flashrom only checks for very few chips if the erase worked
And even when it checks if the erase worked, the result of that check is often ignored. Convert all erase functions and actually check return codes almost everywhere. Check inside all erase_* routines if erase worked, not outside. erase_sector_jedec and erase_block_jedec have changed prototypes to enable erase checking. Uwe successfully tested LPC on an CK804 box and SPI on some SB600 box. Corresponding to flashrom svn r595. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Urja Rannikko <urjaman@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/flash.h b/flash.h
index 25ec836..97e0778 100644
--- a/flash.h
+++ b/flash.h
@@ -364,6 +364,9 @@ extern int verbose;
void map_flash_registers(struct flashchip *flash);
int read_memmapped(struct flashchip *flash, uint8_t *buf);
int min(int a, int b);
+int max(int a, int b);
+int check_erased_range(struct flashchip *flash, int start, int len);
+int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, char *message);
extern char *pcidev_bdf;
/* layout.c */
@@ -471,8 +474,8 @@ int write_byte_program_jedec(chipaddr bios, uint8_t *src,
int probe_jedec(struct flashchip *flash);
int erase_chip_jedec(struct flashchip *flash);
int write_jedec(struct flashchip *flash, uint8_t *buf);
-int erase_sector_jedec(chipaddr bios, unsigned int page);
-int erase_block_jedec(chipaddr bios, unsigned int page);
+int erase_sector_jedec(struct flashchip *flash, unsigned int page, int pagesize);
+int erase_block_jedec(struct flashchip *flash, unsigned int page, int blocksize);
int write_sector_jedec(chipaddr bios, uint8_t *src,
chipaddr dst, unsigned int page_size);
@@ -484,8 +487,7 @@ int write_m29f002b(struct flashchip *flash, uint8_t *buf);
/* m29f400bt.c */
int probe_m29f400bt(struct flashchip *flash);
int erase_m29f400bt(struct flashchip *flash);
-int block_erase_m29f400bt(chipaddr bios,
- chipaddr dst);
+int block_erase_m29f400bt(struct flashchip *flash, int start, int len);
int write_m29f400bt(struct flashchip *flash, uint8_t *buf);
int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf);
void toggle_ready_m29f400bt(chipaddr dst);
OpenPOWER on IntegriCloud