From f52f784bb300ec0acbd6c6bd9e6c3e5b435c4a90 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Fri, 8 Oct 2010 18:52:29 +0000 Subject: Move implicit erase out of chip drivers Flashrom had an implicit erase-on-write for most flash chip and programmer drivers, but it was not entirely consistent. Some drivers had their own hand-rolled partial update functionality which made handling partial updates from generic code impossible. Move implicit erase out of chip drivers, and kill some dead erase functions at the same time. A full chip erase is now performed in the generic code for all flash chips on write, and after that the whole chip is written. Corresponding to flashrom svn r1206. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Uwe Hermann --- 82802ab.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to '82802ab.c') diff --git a/82802ab.c b/82802ab.c index 3935a7e..1f3a668 100644 --- a/82802ab.c +++ b/82802ab.c @@ -144,23 +144,6 @@ int erase_block_82802ab(struct flashchip *flash, unsigned int page, unsigned int return 0; } -int erase_82802ab(struct flashchip *flash) -{ - int i; - unsigned int total_size = flash->total_size * 1024; - - msg_cspew("total_size is %d; flash->page_size is %d\n", - total_size, flash->page_size); - for (i = 0; i < total_size; i += flash->page_size) - if (erase_block_82802ab(flash, i, flash->page_size)) { - msg_cerr("ERASE FAILED!\n"); - return -1; - } - msg_cinfo("DONE ERASE\n"); - - return 0; -} - void write_page_82802ab(chipaddr bios, uint8_t *src, chipaddr dst, int page_size) { @@ -179,11 +162,6 @@ int write_82802ab(struct flashchip *flash, uint8_t *buf) int i; chipaddr bios = flash->virtual_memory; - if (erase_flash(flash)) { - msg_cerr("ERASE FAILED!\n"); - return -1; - } - msg_cinfo("Programming at: "); for (i = 0; i < flash->total_size; i++) { if ((i & 0x3) == 0) -- cgit v1.1