public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCHv2] Don't tftp to unknown flash
@ 2008-09-02  9:24 Jochen Friedrich
  2008-09-03  4:25 ` Ben Warren
  0 siblings, 1 reply; 2+ messages in thread
From: Jochen Friedrich @ 2008-09-02  9:24 UTC (permalink / raw)
  To: u-boot

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 |    2 ++
 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;
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCHv2] Don't tftp to unknown flash
  2008-09-02  9:24 [U-Boot] [PATCHv2] Don't tftp to unknown flash Jochen Friedrich
@ 2008-09-03  4:25 ` Ben Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Warren @ 2008-09-03  4:25 UTC (permalink / raw)
  To: u-boot

Jochen Friedrich wrote:
> 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 |    2 ++
>  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;
>   
Added to net repo.

thanks,
Ben

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-03  4:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-02  9:24 [U-Boot] [PATCHv2] Don't tftp to unknown flash Jochen Friedrich
2008-09-03  4:25 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox