Add additional error messages to flash driver on TRAB board
authorWolfgang Denk <wd@pollux.denx.de>
Wed, 19 Jul 2006 12:07:21 +0000 (14:07 +0200)
committerWolfgang Denk <wd@pollux.denx.de>
Wed, 19 Jul 2006 12:07:21 +0000 (14:07 +0200)
(for erase errors and timeout errors)
Patch by Martin Krause, 14 Feb 2006

CHANGELOG
board/trab/flash.c

index 3e6b1f996dc255d0fac27d8bafdd639186e2db14..e1e68aaee321079f6251c1f544484d2ce06ba83d 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,10 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Add additional error messages to flash driver on TRAB board
+  (for erase errors and timeout errors)
+  Patch by Martin Krause, 14 Feb 2006
+
 * Add support for TB5200 board
   The TB5200 ("Tinybox") is a small baseboard for the TQM5200 module
   integrated in a little aluminium case.
index 8cdd82400bba2b49b2314d14489fa328f97e4c9f..77a6fc29fa3bf5c1c479cb3abfc3d79c22ea93bf 100644 (file)
@@ -281,10 +281,12 @@ int flash_erase (flash_info_t * info, int s_first, int s_last)
 
                        if (chip1 == ERR || chip2 == ERR) {
                                rc = ERR_PROG_ERROR;
+                               printf ("Flash erase error\n");
                                goto outahere;
                        }
                        if (chip1 == TMO) {
                                rc = ERR_TIMOUT;
+                               printf ("Flash erase timeout error\n");
                                goto outahere;
                        }
                }
@@ -384,8 +386,13 @@ static int write_word (flash_info_t * info, ulong dest, ulong data)
 
        *addr = CMD_READ_ARRAY;
 
-       if (chip1 == ERR || chip2 == ERR || *addr != data)
+       if (chip1 == ERR || chip2 == ERR || *addr != data) {
                rc = ERR_PROG_ERROR;
+               printf ("Flash program error\n");
+               debug ("chip1: %#x, chip2: %#x, addr: %#lx *addr: %#lx, "
+                      "data: %#lx\n",
+                      chip1, chip2, addr, *addr, data);
+       }
 
        if (iflag)
                enable_interrupts ();