Skip to content
Snippets Groups Projects
Commit bb74140d authored by Heiko Schocher's avatar Heiko Schocher
Browse files

Fixes common/cmd_flash.c:

   - fix some compiler/parser error, if using m68k tool chain
   - optical fix for protect on/off all messages, if using more
     then one bank
  Patch by Jens Scharsig, 28 July 2005
parent 3a5e2188
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
Changes since U-Boot 1.1.4: Changes since U-Boot 1.1.4:
====================================================================== ======================================================================
* Fixes common/cmd_flash.c:
- fix some compiler/parser error, if using m68k tool chain
- optical fix for protect on/off all messages, if using more
then one bank
Patch by Jens Scharsig, 28 July 2005
* Fix Lite5200B support: initialize SDelay register * Fix Lite5200B support: initialize SDelay register
See Freescale's AN3221 "MPC5200B SDRAM Initialization and See Freescale's AN3221 "MPC5200B SDRAM Initialization and
Configuration", 3.3.1 SDelay--MBAR + 0x0190 Configuration", 3.3.1 SDelay--MBAR + 0x0190
......
...@@ -125,13 +125,16 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl) ...@@ -125,13 +125,16 @@ abbrev_spec (char *str, flash_info_t ** pinfo, int *psf, int *psl)
static int static int
addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last) addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
{ {
char len_used = 0; /* indicates if the "start +length" form used */
char *ep; char *ep;
char len_used; /* indicates if the "start +length" form used */
char found;
ulong bank;
*addr_first = simple_strtoul(arg1, &ep, 16); *addr_first = simple_strtoul(arg1, &ep, 16);
if (ep == arg1 || *ep != '\0') if (ep == arg1 || *ep != '\0')
return -1; return -1;
len_used = 0;
if (arg2 && *arg2 == '+'){ if (arg2 && *arg2 == '+'){
len_used = 1; len_used = 1;
++arg2; ++arg2;
...@@ -142,9 +145,6 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last) ...@@ -142,9 +145,6 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
return -1; return -1;
if (len_used){ if (len_used){
char found = 0;
ulong bank;
/* /*
* *addr_last has the length, compute correct *addr_last * *addr_last has the length, compute correct *addr_last
* XXX watch out for the integer overflow! Right now it is * XXX watch out for the integer overflow! Right now it is
...@@ -159,6 +159,7 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last) ...@@ -159,6 +159,7 @@ addr_spec(char *arg1, char *arg2, ulong *addr_first, ulong *addr_last)
*/ */
/* find the end addr of the sector where the *addr_last is */ /* find the end addr of the sector where the *addr_last is */
found = 0;
for (bank = 0; bank < CFG_MAX_FLASH_BANKS && !found; ++bank){ for (bank = 0; bank < CFG_MAX_FLASH_BANKS && !found; ++bank){
int i; int i;
flash_info_t *info = &flash_info[bank]; flash_info_t *info = &flash_info[bank];
...@@ -506,12 +507,10 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ...@@ -506,12 +507,10 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
info->protect[i] = p; info->protect[i] = p;
#endif /* CFG_FLASH_PROTECTION */ #endif /* CFG_FLASH_PROTECTION */
} }
}
#if defined(CFG_FLASH_PROTECTION) #if defined(CFG_FLASH_PROTECTION)
if (!rcode) puts (" done\n"); if (!rcode) puts (" done\n");
#endif /* CFG_FLASH_PROTECTION */ #endif /* CFG_FLASH_PROTECTION */
}
return rcode; return rcode;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment