All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jochen Friedrich <jochen@scram.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Don't tftp to unknown flash
Date: Mon, 01 Sep 2008 17:19:04 +0200	[thread overview]
Message-ID: <48BC07E8.2020804@scram.de> (raw)

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>
---
 net/tftp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/tftp.c b/net/tftp.c
index 84d83ca..5fbcbc3 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -111,7 +111,8 @@ store_block (unsigned block, uchar * src, unsigned len)

 	for (i=0; i<CFG_MAX_FLASH_BANKS; i++) {
 		/* start address in flash? */
-		if (load_addr + offset >= flash_info[i].start[0]) {
+		if ((flash_info[i].flash_id != FLASH_UNKNOWN) &&
+		    (load_addr + offset >= flash_info[i].start[0])) {
 			rc = 1;
 			break;
 		}
-- 
1.5.6.5

             reply	other threads:[~2008-09-01 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 15:19 Jochen Friedrich [this message]
2008-09-01 22:53 ` [U-Boot] [PATCH] Don't tftp to unknown flash Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48BC07E8.2020804@scram.de \
    --to=jochen@scram.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.