diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-10-16 15:01:15 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-10-18 21:54:03 +0200 |
commit | 6d0f6bcf337c5261c08fabe12982178c2c489d76 (patch) | |
tree | ae13958ffa9c6b58c2ea97aac07a4ad2f04a350f /tools | |
parent | 71edc271816ec82cf0550dd6980be2da3cc2ad9e (diff) |
rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/env/fw_env.c | 4 | ||||
-rw-r--r-- | tools/envcrc.c | 14 | ||||
-rw-r--r-- | tools/updater/cmd_flash.c | 56 | ||||
-rw-r--r-- | tools/updater/flash.c | 10 | ||||
-rw-r--r-- | tools/updater/flash_hw.c | 28 | ||||
-rw-r--r-- | tools/updater/utils.c | 12 |
6 files changed, 62 insertions, 62 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 6e9c34f3de9..a46205d8687 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -172,8 +172,8 @@ static char default_environment[] = { #ifdef CONFIG_SERVERIP "serverip=" MK_STR (CONFIG_SERVERIP) "\0" #endif -#ifdef CFG_AUTOLOAD - "autoload=" CFG_AUTOLOAD "\0" +#ifdef CONFIG_SYS_AUTOLOAD + "autoload=" CONFIG_SYS_AUTOLOAD "\0" #endif #ifdef CONFIG_ROOTPATH "rootpath=" MK_STR (CONFIG_ROOTPATH) "\0" diff --git a/tools/envcrc.c b/tools/envcrc.c index ba28fa0d3da..4334cdf746d 100644 --- a/tools/envcrc.c +++ b/tools/envcrc.c @@ -35,13 +35,13 @@ #if defined(CONFIG_ENV_IS_IN_FLASH) # ifndef CONFIG_ENV_ADDR -# define CONFIG_ENV_ADDR (CFG_FLASH_BASE + CONFIG_ENV_OFFSET) +# define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) # endif # ifndef CONFIG_ENV_OFFSET -# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CFG_FLASH_BASE) +# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE) # endif # if !defined(CONFIG_ENV_ADDR_REDUND) && defined(CONFIG_ENV_OFFSET_REDUND) -# define CONFIG_ENV_ADDR_REDUND (CFG_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND) +# define CONFIG_ENV_ADDR_REDUND (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND) # endif # ifndef CONFIG_ENV_SIZE # define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE @@ -49,16 +49,16 @@ # if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND) # define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE # endif -# if (CONFIG_ENV_ADDR >= CFG_MONITOR_BASE) && \ - ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) +# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \ + ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) # define ENV_IS_EMBEDDED 1 # endif # if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND) -# define CFG_REDUNDAND_ENVIRONMENT 1 +# define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1 # endif #endif /* CONFIG_ENV_IS_IN_FLASH */ -#ifdef CFG_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT # define ENV_HEADER_SIZE (sizeof(uint32_t) + 1) #else # define ENV_HEADER_SIZE (sizeof(uint32_t)) diff --git a/tools/updater/cmd_flash.c b/tools/updater/cmd_flash.c index 0f6f62b9444..5ff7336599b 100644 --- a/tools/updater/cmd_flash.c +++ b/tools/updater/cmd_flash.c @@ -64,7 +64,7 @@ abbrev_spec(char *str, flash_info_t **pinfo, int *psf, int *psl) bank = simple_strtoul(str, &ep, 10); if (ep == str || *ep != '\0' || - bank < 1 || bank > CFG_MAX_FLASH_BANKS || + bank < 1 || bank > CONFIG_SYS_MAX_FLASH_BANKS || (fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN) return -1; @@ -96,7 +96,7 @@ int do_flinfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) ulong bank; if (argc == 1) { /* print info for all FLASH banks */ - for (bank=0; bank <CFG_MAX_FLASH_BANKS; ++bank) { + for (bank=0; bank <CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { printf ("\nBank # %ld: ", bank+1); flash_print_info (&flash_info[bank]); @@ -105,9 +105,9 @@ int do_flinfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) } bank = simple_strtoul(argv[1], NULL, 16); - if ((bank < 1) || (bank > CFG_MAX_FLASH_BANKS)) { + if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { printf ("Only FLASH Banks # 1 ... # %d supported\n", - CFG_MAX_FLASH_BANKS); + CONFIG_SYS_MAX_FLASH_BANKS); return 1; } printf ("\nBank # %ld: ", bank); @@ -127,7 +127,7 @@ int do_flerase(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) } if (strcmp(argv[1], "all") == 0) { - for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) { + for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { printf ("Erase Flash Bank # %ld ", bank); info = &flash_info[bank-1]; rcode = flash_erase (info, 0, info->sector_count-1); @@ -153,9 +153,9 @@ int do_flerase(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) if (strcmp(argv[1], "bank") == 0) { bank = simple_strtoul(argv[2], NULL, 16); - if ((bank < 1) || (bank > CFG_MAX_FLASH_BANKS)) { + if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { printf ("Only FLASH Banks # 1 ... # %d supported\n", - CFG_MAX_FLASH_BANKS); + CONFIG_SYS_MAX_FLASH_BANKS); return 1; } printf ("Erase Flash Bank # %ld ", bank); @@ -187,7 +187,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last) erased = 0; - for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) { + for (bank=0,info = &flash_info[0]; bank < CONFIG_SYS_MAX_FLASH_BANKS; ++bank, ++info) { ulong b_end; int sect; @@ -258,7 +258,7 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) } if (strcmp(argv[2], "all") == 0) { - for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) { + for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) { info = &flash_info[bank-1]; if (info->flash_id == FLASH_UNKNOWN) { continue; @@ -267,19 +267,19 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) /* p ? "" : "Un-", bank); */ for (i=0; i<info->sector_count; ++i) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (flash_real_protect(info, i, p)) rcode = 1; putc ('.'); #else info->protect[i] = p; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } } -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (!rcode) puts (" done\n"); -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ return rcode; } @@ -293,18 +293,18 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) /* p ? "" : "Un-", sect_first, sect_last, */ /* (info-flash_info)+1); */ for (i = sect_first; i <= sect_last; i++) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (flash_real_protect(info, i, p)) rcode = 1; putc ('.'); #else info->protect[i] = p; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (!rcode) puts (" done\n"); -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ return rcode; } @@ -316,9 +316,9 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) if (strcmp(argv[2], "bank") == 0) { bank = simple_strtoul(argv[3], NULL, 16); - if ((bank < 1) || (bank > CFG_MAX_FLASH_BANKS)) { + if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) { printf ("Only FLASH Banks # 1 ... # %d supported\n", - CFG_MAX_FLASH_BANKS); + CONFIG_SYS_MAX_FLASH_BANKS); return 1; } printf ("%sProtect Flash Bank # %ld\n", @@ -330,18 +330,18 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) return 1; } for (i=0; i<info->sector_count; ++i) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (flash_real_protect(info, i, p)) rcode = 1; putc ('.'); #else info->protect[i] = p; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (!rcode) puts (" done\n"); -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ return rcode; } @@ -366,7 +366,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last) protected = 0; - for (bank=0,info = &flash_info[0]; bank < CFG_MAX_FLASH_BANKS; ++bank, ++info) { + for (bank=0,info = &flash_info[0]; bank < CONFIG_SYS_MAX_FLASH_BANKS; ++bank, ++info) { ulong b_end; int sect; @@ -402,18 +402,18 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last) if (s_first>=0 && s_first<=s_last) { protected += s_last - s_first + 1; for (i=s_first; i<=s_last; ++i) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (flash_real_protect(info, i, p)) rcode = 1; putc ('.'); #else info->protect[i] = p; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } } -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) if (!rcode) putc ('\n'); -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } if (protected) { diff --git a/tools/updater/flash.c b/tools/updater/flash.c index a73159ff9bf..5be5f1b0996 100644 --- a/tools/updater/flash.c +++ b/tools/updater/flash.c @@ -66,18 +66,18 @@ flash_protect (int flag, ulong from, ulong to, flash_info_t *info) */ if (from <= end && to >= info->start[i]) { if (flag & FLAG_PROTECT_CLEAR) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) flash_real_protect(info, i, 0); #else info->protect[i] = 0; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } else if (flag & FLAG_PROTECT_SET) { -#if defined(CFG_FLASH_PROTECTION) +#if defined(CONFIG_SYS_FLASH_PROTECTION) flash_real_protect(info, i, 1); #else info->protect[i] = 1; -#endif /* CFG_FLASH_PROTECTION */ +#endif /* CONFIG_SYS_FLASH_PROTECTION */ } } } @@ -93,7 +93,7 @@ addr2info (ulong addr) flash_info_t *info; int i; - for (i=0, info = &flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) { + for (i=0, info = &flash_info[0]; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i, ++info) { if (info->flash_id != FLASH_UNKNOWN && addr >= info->start[0] && /* WARNING - The '- 1' is needed if the flash diff --git a/tools/updater/flash_hw.c b/tools/updater/flash_hw.c index 638844e8737..8af4b454ec0 100644 --- a/tools/updater/flash_hw.c +++ b/tools/updater/flash_hw.c @@ -80,7 +80,7 @@ unsigned long flash_init_old(void) { int i; - for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) + for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) { flash_info[i].flash_id = FLASH_UNKNOWN; flash_info[i].sector_count = 0; @@ -101,25 +101,25 @@ unsigned long flash_init (void) flash_to_xd(); /* Init: no FLASHes known */ - for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) { + for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { flash_info[i].flash_id = FLASH_UNKNOWN; flash_info[i].sector_count = 0; flash_info[i].size = 0; } - DEBUGF("\n## Get flash size @ 0x%08x\n", CFG_FLASH_BASE); + DEBUGF("\n## Get flash size @ 0x%08x\n", CONFIG_SYS_FLASH_BASE); - flash_size = flash_get_size (CFG_FLASH_BASE, flash_info); + flash_size = flash_get_size (CONFIG_SYS_FLASH_BASE, flash_info); DEBUGF("## Flash bank size: %08lx\n", flash_size); if (flash_size) { -#if CFG_MONITOR_BASE >= CFG_FLASH_BASE && \ - CFG_MONITOR_BASE < CFG_FLASH_BASE + CFG_FLASH_MAX_SIZE +#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE && \ + CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_MAX_SIZE /* monitor protection ON by default */ flash_protect(FLAG_PROTECT_SET, - CFG_MONITOR_BASE, - CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1, + CONFIG_SYS_MONITOR_BASE, + CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN - 1, &flash_info[0]); #endif @@ -286,10 +286,10 @@ static ulong flash_get_size (ulong addr, flash_info_t *info) } - if (info->sector_count > CFG_MAX_FLASH_SECT) { + if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { printf ("** ERROR: sector count %d > max (%d) **\n", - info->sector_count, CFG_MAX_FLASH_SECT); - info->sector_count = CFG_MAX_FLASH_SECT; + info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); + info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; } if (! flash_get_offsets (addr, info)) { @@ -418,10 +418,10 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) last = start; addr = info->start[l_sect]; - DEBUGF ("Start erase timeout: %d\n", CFG_FLASH_ERASE_TOUT); + DEBUGF ("Start erase timeout: %d\n", CONFIG_SYS_FLASH_ERASE_TOUT); while ((in8(addr) & 0x80) != 0x80) { - if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { + if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { printf ("Timeout\n"); flash_reset (info->start[0]); flash_to_mem(); @@ -570,7 +570,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data) /* data polling for D7 */ start = get_timer (0); while ((in8(dest+i) & 0x80) != (data_ch[i] & 0x80)) { - if (get_timer(start) > CFG_FLASH_WRITE_TOUT) { + if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { flash_reset (addr); flash_to_mem(); return (1); diff --git a/tools/updater/utils.c b/tools/updater/utils.c index 0304f94c107..61a611876c4 100644 --- a/tools/updater/utils.c +++ b/tools/updater/utils.c @@ -132,16 +132,16 @@ do_reset (void) __asm__ __volatile__ ("isync"); __asm__ __volatile__ ("sync"); -#ifdef CFG_RESET_ADDRESS - addr = CFG_RESET_ADDRESS; +#ifdef CONFIG_SYS_RESET_ADDRESS + addr = CONFIG_SYS_RESET_ADDRESS; #else /* - * note: when CFG_MONITOR_BASE points to a RAM address, - * CFG_MONITOR_BASE - sizeof (ulong) is usually a valid + * note: when CONFIG_SYS_MONITOR_BASE points to a RAM address, + * CONFIG_SYS_MONITOR_BASE - sizeof (ulong) is usually a valid * address. Better pick an address known to be invalid on your - * system and assign it to CFG_RESET_ADDRESS. + * system and assign it to CONFIG_SYS_RESET_ADDRESS. */ - addr = CFG_MONITOR_BASE - sizeof (ulong); + addr = CONFIG_SYS_MONITOR_BASE - sizeof (ulong); #endif soft_restart(addr); while(1); /* not reached */ |