* [U-Boot] [PATCH] * Fix: watchdog timed out, if flash blank (0xFF) blocks
@ 2012-01-27 8:29 Jens Scharsig
2012-02-09 9:49 ` Stefan Roese
0 siblings, 1 reply; 2+ messages in thread
From: Jens Scharsig @ 2012-01-27 8:29 UTC (permalink / raw)
To: u-boot
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) <esw@bus-elektronik.de>
---
drivers/mtd/cfi_flash.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 5494bcf..722c3fc 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -40,6 +40,7 @@
#include <asm/byteorder.h>
#include <environment.h>
#include <mtd/cfi_flash.h>
+#include <watchdog.h>
/*
* 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:
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH] * Fix: watchdog timed out, if flash blank (0xFF) blocks
2012-01-27 8:29 [U-Boot] [PATCH] * Fix: watchdog timed out, if flash blank (0xFF) blocks Jens Scharsig
@ 2012-02-09 9:49 ` Stefan Roese
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2012-02-09 9:49 UTC (permalink / raw)
To: u-boot
On Friday 27 January 2012 09:29:53 Jens Scharsig (BuS Elektronik) wrote:
> 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) <esw@bus-elektronik.de>
Applied to u-boot-cfi-flash. Thanks.
Best regards,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-09 9:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-27 8:29 [U-Boot] [PATCH] * Fix: watchdog timed out, if flash blank (0xFF) blocks Jens Scharsig
2012-02-09 9:49 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox