9
0
Fork 0

svn_rev_078

u-boot-no-tftp-in-flash
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:20 +02:00 committed by Sascha Hauer
parent 5295a2e898
commit a71f3f7828
1 changed files with 16 additions and 1 deletions

View File

@ -151,12 +151,16 @@ static void netboot_update_env (void)
#endif
}
#ifndef CFG_DIRECT_FLASH_TFTP
extern flash_info_t flash_info[];
#endif
static int
netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
{
char *s;
int rcode = 0;
int size;
int size, i;
/* pre-set load_addr */
if ((s = getenv("loadaddr")) != NULL) {
@ -187,6 +191,17 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
return 1;
}
#ifndef CFG_DIRECT_FLASH_TFTP
for (i=0; i<CFG_MAX_FLASH_BANKS; i++) {
/* start address in flash? */
if (load_addr >= flash_info[i].start[0] &&
load_addr < flash_info[i].start[0] + flash_info[i].size) {
printf("load address is in flash. Will not overwrite\n");
return 1;
}
}
#endif
if ((size = NetLoop(proto)) < 0)
return 1;