]> git.sur5r.net Git - u-boot/commitdiff
Don't tftp to unknown flash
authorJochen Friedrich <jochen@scram.de>
Tue, 2 Sep 2008 09:24:59 +0000 (11:24 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Wed, 3 Sep 2008 04:18:19 +0000 (21:18 -0700)
If a board has a variable number of flash banks, there are empty entries
in flash_info[] and CFG_DIRECT_FLASH_TFTP is set, tftp boot fails with
"Outside available Flash". This patch skips flash banks with unknown
flash ids.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
net/tftp.c

index 84d83ca97b1e9f333efe1fa780c3803ce6cadca5..9aeecb8d37febb68fc1839d228ef0838ace15c50 100644 (file)
@@ -111,6 +111,8 @@ store_block (unsigned block, uchar * src, unsigned len)
 
        for (i=0; i<CFG_MAX_FLASH_BANKS; i++) {
                /* start address in flash? */
+               if (flash_info[i].flash_id == FLASH_UNKNOWN)
+                       continue;
                if (load_addr + offset >= flash_info[i].start[0]) {
                        rc = 1;
                        break;