summaryrefslogtreecommitdiff
path: root/common/cmd_nvedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r--common/cmd_nvedit.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 7089706..85025da 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -52,15 +52,15 @@
DECLARE_GLOBAL_DATA_PTR;
-#if !defined(CFG_ENV_IS_IN_NVRAM) && \
- !defined(CFG_ENV_IS_IN_EEPROM) && \
- !defined(CFG_ENV_IS_IN_FLASH) && \
- !defined(CFG_ENV_IS_IN_DATAFLASH) && \
- !defined(CFG_ENV_IS_IN_NAND) && \
- !defined(CFG_ENV_IS_IN_ONENAND) && \
- !defined(CFG_ENV_IS_IN_SPI_FLASH) && \
- !defined(CFG_ENV_IS_NOWHERE)
-# error Define one of CFG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE}
+#if !defined(CONFIG_ENV_IS_IN_NVRAM) && \
+ !defined(CONFIG_ENV_IS_IN_EEPROM) && \
+ !defined(CONFIG_ENV_IS_IN_FLASH) && \
+ !defined(CONFIG_ENV_IS_IN_DATAFLASH) && \
+ !defined(CONFIG_ENV_IS_IN_NAND) && \
+ !defined(CONFIG_ENV_IS_IN_ONENAND) && \
+ !defined(CONFIG_ENV_IS_IN_SPI_FLASH) && \
+ !defined(CONFIG_ENV_IS_NOWHERE)
+# error Define one of CONFIG_ENV_IS_IN_{NVRAM|EEPROM|FLASH|DATAFLASH|ONENAND|SPI_FLASH|NOWHERE}
#endif
#define XMK_STR(x) #x
@@ -72,7 +72,7 @@ DECLARE_GLOBAL_DATA_PTR;
/*
* Table with supported baudrates (defined in config_xyz.h)
*/
-static const unsigned long baudrate_table[] = CFG_BAUDRATE_TABLE;
+static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
#define N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
@@ -213,6 +213,11 @@ int _do_setenv (int flag, int argc, char *argv[])
return 1;
}
+#ifdef CONFIG_CONSOLE_MUX
+ i = iomux_doenv(console, argv[2]);
+ if (i)
+ return i;
+#else
/* Try assigning specified device */
if (console_assign (console, argv[2]) < 0)
return 1;
@@ -221,6 +226,7 @@ int _do_setenv (int flag, int argc, char *argv[])
if (serial_assign (argv[2]) < 0)
return 1;
#endif
+#endif /* CONFIG_CONSOLE_MUX */
}
/*
@@ -416,9 +422,9 @@ int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#if defined(CONFIG_CMD_ASKENV)
int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- extern char console_buffer[CFG_CBSIZE];
- char message[CFG_CBSIZE];
- int size = CFG_CBSIZE - 1;
+ extern char console_buffer[CONFIG_SYS_CBSIZE];
+ char message[CONFIG_SYS_CBSIZE];
+ int size = CONFIG_SYS_CBSIZE - 1;
int len;
char *local_args[4];
@@ -464,8 +470,8 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
}
- if (size >= CFG_CBSIZE)
- size = CFG_CBSIZE - 1;
+ if (size >= CONFIG_SYS_CBSIZE)
+ size = CONFIG_SYS_CBSIZE - 1;
if (size <= 0)
return 1;
@@ -503,7 +509,7 @@ char *getenv (char *name)
int val;
for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) {
- if (nxt >= CFG_ENV_SIZE) {
+ if (nxt >= CONFIG_ENV_SIZE) {
return (NULL);
}
}
@@ -523,7 +529,7 @@ int getenv_r (char *name, char *buf, unsigned len)
int val, n;
for (nxt=i; env_get_char(nxt) != '\0'; ++nxt) {
- if (nxt >= CFG_ENV_SIZE) {
+ if (nxt >= CONFIG_ENV_SIZE) {
return (-1);
}
}
@@ -540,11 +546,11 @@ int getenv_r (char *name, char *buf, unsigned len)
return (-1);
}
-#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CFG_ENV_IS_NOWHERE))
+ && !defined(CONFIG_ENV_IS_NOWHERE))
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
@@ -580,7 +586,7 @@ int envmatch (uchar *s1, int i2)
/**************************************************/
U_BOOT_CMD(
- printenv, CFG_MAXARGS, 1, do_printenv,
+ printenv, CONFIG_SYS_MAXARGS, 1, do_printenv,
"printenv- print environment variables\n",
"\n - print values of all environment variables\n"
"printenv name ...\n"
@@ -588,7 +594,7 @@ U_BOOT_CMD(
);
U_BOOT_CMD(
- setenv, CFG_MAXARGS, 0, do_setenv,
+ setenv, CONFIG_SYS_MAXARGS, 0, do_setenv,
"setenv - set environment variables\n",
"name value ...\n"
" - set environment variable 'name' to 'value ...'\n"
@@ -596,11 +602,11 @@ U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
-#if ((defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) \
+#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
|| (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CFG_ENV_IS_NOWHERE))
+ && !defined(CONFIG_ENV_IS_NOWHERE))
U_BOOT_CMD(
saveenv, 1, 0, do_saveenv,
"saveenv - save environment variables to persistent storage\n",
@@ -612,7 +618,7 @@ U_BOOT_CMD(
#if defined(CONFIG_CMD_ASKENV)
U_BOOT_CMD(
- askenv, CFG_MAXARGS, 1, do_askenv,
+ askenv, CONFIG_SYS_MAXARGS, 1, do_askenv,
"askenv - get environment variables from stdin\n",
"name [message] [size]\n"
" - get environment variable 'name' from stdin (max 'size' chars)\n"
@@ -629,7 +635,7 @@ U_BOOT_CMD(
#if defined(CONFIG_CMD_RUN)
int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
U_BOOT_CMD(
- run, CFG_MAXARGS, 1, do_run,
+ run, CONFIG_SYS_MAXARGS, 1, do_run,
"run - run commands in an environment variable\n",
"var [...]\n"
" - run the commands in the environment variable(s) 'var'\n"