From: Jens Scharsig (BuS Elektronik) Date: Fri, 27 Jan 2012 08:29:53 +0000 (+0100) Subject: * Fix: watchdog timed out, if flash blank (0xFF) blocks X-Git-Tag: v2012.04-rc1~256^2^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a9f5faba6e2c5819fc1ebeef02fad1726721f849;p=u-boot * Fix: watchdog timed out, if flash blank (0xFF) blocks The current implementation of cfi_flash uses udelay to reset watchdog. If several blocks are blank (0xff filled) the watchdog timed out. The reason is, udelay is never called, if flash device is ready to fast. e.g. mw.w $(copy_addr) FFFF 10000;cp.b $(copy_addr) 10880000 20000 -> watchdog timed out mw.w $(copy_addr) 0000 10000;cp.b $(copy_addr) 10880000 20000 -> watchdog not timed out This patch adds an extra watchdog reset in front of flash ready check. Signed-off-by: Jens Scharsig (BuS Elektronik) Signed-off-by: Stefan Roese --- diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 5494bcffa7..722c3fc7bd 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -40,6 +40,7 @@ #include #include #include +#include /* * This file implements a Common Flash Interface (CFI) driver for @@ -577,6 +578,7 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector, reset_timer(); #endif start = get_timer (0); + WATCHDOG_RESET(); while (flash_is_busy (info, sector)) { if (get_timer (start) > tout) { printf ("Flash %s timeout at address %lx data %lx\n", @@ -668,6 +670,7 @@ static int flash_status_poll(flash_info_t *info, void *src, void *dst, reset_timer(); #endif start = get_timer(0); + WATCHDOG_RESET(); while (1) { switch (info->portwidth) { case FLASH_CFI_8BIT: