Skip to contentSkip to conversation

Don't tftp to unknown flash

PATCH New Jochen Friedrich 2 participants 2 messages Sep 2, 2008 – Sep 3, 2008 Networking

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
 net/tftp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/tftp.c +2 -0
index 84d83ca..9aeecb8 100644
@@ -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;
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH v2 1/1 Don't tftp to unknown flash

Quoted 16 lines · Jochen Friedrich

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.

---
 net/tftp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/tftp.c +0 -0
index 84d83ca..9aeecb8 100644

net/tftp.c store_block (unsigned block, uchar * src, unsigned len) · line 118

Quoted 8 lines
net/tftp.c +2 -0
@@ -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