summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/env/fw_env.c20
-rw-r--r--tools/envcrc.c28
-rw-r--r--tools/updater/flash_hw.c4
3 files changed, 26 insertions, 26 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index b6036c8ae2a..46747d337c5 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -80,7 +80,7 @@ static int dev_current;
#define ENVSECTORS(i) envdevices[(i)].env_sectors
#define DEVTYPE(i) envdevices[(i)].mtd_type
-#define CFG_ENV_SIZE ENVSIZE(dev_current)
+#define CONFIG_ENV_SIZE ENVSIZE(dev_current)
#define ENV_SIZE getenvsize()
@@ -212,7 +212,7 @@ static int get_config (char *);
#endif
static inline ulong getenvsize (void)
{
- ulong rc = CFG_ENV_SIZE - sizeof (long);
+ ulong rc = CONFIG_ENV_SIZE - sizeof (long);
if (HaveRedundEnv)
rc -= sizeof (char);
@@ -401,7 +401,7 @@ int fw_setenv (int argc, char *argv[])
++env;
/*
* Overflow when:
- * "name" + "=" + "val" +"\0\0" > CFG_ENV_SIZE - (env-environment)
+ * "name" + "=" + "val" +"\0\0" > CONFIG_ENV_SIZE - (env-environment)
*/
len = strlen (name) + 2;
/* add '=' for first arg, ' ' for all others */
@@ -753,7 +753,7 @@ static int flash_write (int fd_current, int fd_target, int dev_target)
DEVOFFSET (dev_target), DEVNAME (dev_target));
#endif
rc = flash_write_buf (dev_target, fd_target, environment.image,
- CFG_ENV_SIZE, DEVOFFSET (dev_target),
+ CONFIG_ENV_SIZE, DEVOFFSET (dev_target),
DEVTYPE(dev_target));
if (rc < 0)
return rc;
@@ -790,10 +790,10 @@ static int flash_read (int fd)
DEVTYPE(dev_current) = mtdinfo.type;
- rc = flash_read_buf (dev_current, fd, environment.image, CFG_ENV_SIZE,
+ rc = flash_read_buf (dev_current, fd, environment.image, CONFIG_ENV_SIZE,
DEVOFFSET (dev_current), mtdinfo.type);
- return (rc != CFG_ENV_SIZE) ? -1 : 0;
+ return (rc != CONFIG_ENV_SIZE) ? -1 : 0;
}
static int flash_io (int mode)
@@ -890,11 +890,11 @@ static int env_init (void)
if (parse_config ()) /* should fill envdevices */
return -1;
- addr0 = calloc (1, CFG_ENV_SIZE);
+ addr0 = calloc (1, CONFIG_ENV_SIZE);
if (addr0 == NULL) {
fprintf (stderr,
"Not enough memory for environment (%ld bytes)\n",
- CFG_ENV_SIZE);
+ CONFIG_ENV_SIZE);
return -1;
}
@@ -929,11 +929,11 @@ static int env_init (void)
flag0 = *environment.flags;
dev_current = 1;
- addr1 = calloc (1, CFG_ENV_SIZE);
+ addr1 = calloc (1, CONFIG_ENV_SIZE);
if (addr1 == NULL) {
fprintf (stderr,
"Not enough memory for environment (%ld bytes)\n",
- CFG_ENV_SIZE);
+ CONFIG_ENV_SIZE);
return -1;
}
redundant = addr1;
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 2f40051278c..ba28fa0d3da 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -34,26 +34,26 @@
#undef __ASSEMBLY__
#if defined(CONFIG_ENV_IS_IN_FLASH)
-# ifndef CFG_ENV_ADDR
-# define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
+# ifndef CONFIG_ENV_ADDR
+# define CONFIG_ENV_ADDR (CFG_FLASH_BASE + CONFIG_ENV_OFFSET)
# endif
-# ifndef CFG_ENV_OFFSET
-# define CFG_ENV_OFFSET (CFG_ENV_ADDR - CFG_FLASH_BASE)
+# ifndef CONFIG_ENV_OFFSET
+# define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CFG_FLASH_BASE)
# endif
-# if !defined(CFG_ENV_ADDR_REDUND) && defined(CFG_ENV_OFFSET_REDUND)
-# define CFG_ENV_ADDR_REDUND (CFG_FLASH_BASE + CFG_ENV_OFFSET_REDUND)
+# if !defined(CONFIG_ENV_ADDR_REDUND) && defined(CONFIG_ENV_OFFSET_REDUND)
+# define CONFIG_ENV_ADDR_REDUND (CFG_FLASH_BASE + CONFIG_ENV_OFFSET_REDUND)
# endif
-# ifndef CFG_ENV_SIZE
-# define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
+# ifndef CONFIG_ENV_SIZE
+# define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
# endif
-# if defined(CFG_ENV_ADDR_REDUND) && !defined(CFG_ENV_SIZE_REDUND)
-# define CFG_ENV_SIZE_REDUND CFG_ENV_SIZE
+# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
+# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
# endif
-# if (CFG_ENV_ADDR >= CFG_MONITOR_BASE) && \
- ((CFG_ENV_ADDR + CFG_ENV_SIZE) <= (CFG_MONITOR_BASE + CFG_MONITOR_LEN))
+# if (CONFIG_ENV_ADDR >= CFG_MONITOR_BASE) && \
+ ((CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= (CFG_MONITOR_BASE + CFG_MONITOR_LEN))
# define ENV_IS_EMBEDDED 1
# endif
-# if defined(CFG_ENV_ADDR_REDUND) || defined(CFG_ENV_OFFSET_REDUND)
+# if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
# define CFG_REDUNDAND_ENVIRONMENT 1
# endif
#endif /* CONFIG_ENV_IS_IN_FLASH */
@@ -64,7 +64,7 @@
# define ENV_HEADER_SIZE (sizeof(uint32_t))
#endif
-#define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE)
+#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
diff --git a/tools/updater/flash_hw.c b/tools/updater/flash_hw.c
index 50b4df02b89..638844e8737 100644
--- a/tools/updater/flash_hw.c
+++ b/tools/updater/flash_hw.c
@@ -126,8 +126,8 @@ unsigned long flash_init (void)
#ifdef CONFIG_ENV_IS_IN_FLASH
/* ENV protection ON by default */
flash_protect(FLAG_PROTECT_SET,
- CFG_ENV_ADDR,
- CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
&flash_info[0]);
#endif