summaryrefslogtreecommitdiff
path: root/net/tftp.c
diff options
context:
space:
mode:
authorJochen Friedrich <jochen@scram.de>2008-09-02 11:24:59 +0200
committerBen Warren <biggerbadderben@gmail.com>2008-09-02 21:18:19 -0700
commitbe1b0d2777e179191a57b138b660547a17e55aad (patch)
tree59cb7bce221c6b381b76fd940b93c2c14fecc833 /net/tftp.c
parent33314470ab32a3f5412bb61b5f3d6c216c88bf9b (diff)
downloadu-boot-imx-be1b0d2777e179191a57b138b660547a17e55aad.zip
u-boot-imx-be1b0d2777e179191a57b138b660547a17e55aad.tar.gz
u-boot-imx-be1b0d2777e179191a57b138b660547a17e55aad.tar.bz2
Don't tftp to unknown flash
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>
Diffstat (limited to 'net/tftp.c')
-rw-r--r--net/tftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 84d83ca..9aeecb8 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -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;