diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:01:33 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:01:33 +0200 |
commit | a5bf47e33a17e9131dc7bcdbd1b449292b00a81d (patch) | |
tree | f0430efc3b29061ef9416488d2b59f569cc27c62 | |
parent | a9ff695f4773d4155558038987fbb73a32043380 (diff) | |
download | barebox-a5bf47e33a17e9131dc7bcdbd1b449292b00a81d.tar.gz barebox-a5bf47e33a17e9131dc7bcdbd1b449292b00a81d.tar.xz |
svn_rev_207
move several config options to kconfig
-rw-r--r-- | common/Kconfig | 67 | ||||
-rw-r--r-- | common/Makefile | 1 | ||||
-rw-r--r-- | common/cmd_autoscript.c | 4 | ||||
-rw-r--r-- | common/cmd_bedbug.c | 2 | ||||
-rw-r--r-- | common/cmd_boot.c | 4 | ||||
-rw-r--r-- | common/cmd_bootm.c | 8 | ||||
-rw-r--r-- | common/cmd_diag.c | 2 | ||||
-rw-r--r-- | common/cmd_display.c | 2 | ||||
-rw-r--r-- | common/command.c | 26 | ||||
-rw-r--r-- | common/env.c | 4 | ||||
-rw-r--r-- | common/hush.c | 14 | ||||
-rw-r--r-- | common/kgdb.c | 2 | ||||
-rw-r--r-- | common/main.c | 44 |
13 files changed, 124 insertions, 56 deletions
diff --git a/common/Kconfig b/common/Kconfig index 39c6dd5580..3035f3cf86 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -12,6 +12,44 @@ config PROMPT prompt "U-Boot command prompt" default "uboot> " +config BAUDRATE + int + prompt "Default baudrate" + default 115200 + +config CMDLINE_EDITING + bool + prompt "Enable command line editing" + +config LONGHELP + bool + prompt "Enable long help texts" + +config CBSIZE + int + prompt "Buffer size for input from the Console" + default 1024 + +config MAXARGS + int + prompt "max. Number of arguments accepted for monitor commands" + default 16 + +config HUSH_PARSER + bool + prompt "Use hush parser" + +config PROMPT_HUSH_PS2 + string + depends on HUSH_PARSER + prompt "hush PS2" + default "> " + +config ZERO_BOOTDELAY_CHECK + bool + prompt "Eanble stop boot process with bootdelay = 0" + default y + endmenu menu "Commands" @@ -32,6 +70,25 @@ config CMD_MEMORY bool prompt "md, mm, mw and several others" +config CMD_MTEST + bool + prompt "mtest" + +config CMD_MTEST_ALTERNATIVE + bool + depends on CMD_MTEST + prompt "use alternative mtest implementation" + +config CMD_MTEST_START + hex + depends on CMD_MTEST + prompt "mtest start address" + +config CMD_MTEST_END + hex + depends on CMD_MTEST + prompt "mtest end address" + config CMD_I2C bool prompt "i2c" @@ -82,3 +139,13 @@ config CMD_BOOTM_BZLIB prompt "bootm with bzlib support" endmenu + +menu "Debugging" + +config SKIP_LOWLEVEL_INIT + bool + depends on ARM + prompt "Skip lowlevel init" + + +endmenu diff --git a/common/Makefile b/common/Makefile index 42bd5f79b5..bbbf8ad0c9 100644 --- a/common/Makefile +++ b/common/Makefile @@ -83,6 +83,7 @@ obj-$(CONFIG_CMD_SPLASH) += cmd_splash.o # obj-y += fpga.o # obj-y += altera.o # obj-y += cyclon2.o +obj-$(CONFIG_CMD_MTEST) += cmd_memtest.o obj-$(CONFIG_CMD_SLEEP) += cmd_misc.o obj-y += mtdpart.o diff --git a/common/cmd_autoscript.c b/common/cmd_autoscript.c index 092d114d4d..c8b7fbe661 100644 --- a/common/cmd_autoscript.c +++ b/common/cmd_autoscript.c @@ -43,7 +43,7 @@ #if defined(CONFIG_8xx) #include <mpc8xx.h> #endif -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER #include <hush.h> #endif @@ -113,7 +113,7 @@ autoscript (ulong addr) memmove (cmd, (char *)len_ptr, len); *(cmd + len) = 0; -#ifdef CFG_HUSH_PARSER /*?? */ +#ifdef CONFIG_HUSH_PARSER /*?? */ rcode = parse_string_outer (cmd, FLAG_PARSE_SEMICOLON); #else { diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c index 48086a6280..3cb4e4692b 100644 --- a/common/cmd_bedbug.c +++ b/common/cmd_bedbug.c @@ -220,7 +220,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs) int flag; /* Command flags */ int rc = 0; /* Result from run_command */ char prompt_str[20]; /* Prompt string */ - static char lastcommand[CFG_CBSIZE] = { 0 }; /* previous command */ + static char lastcommand[CONFIG_CBSIZE] = { 0 }; /* previous command */ /* -------------------------------------------------- */ if (bug_ctx.clear) diff --git a/common/cmd_boot.c b/common/cmd_boot.c index 182e2ab980..3b77784bdc 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -74,7 +74,7 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* -------------------------------------------------------------------- */ U_BOOT_CMD( - go, CFG_MAXARGS, 1, do_go, + go, CONFIG_MAXARGS, 1, do_go, "go - start application at address 'addr'\n", "addr [arg ...]\n - start application at address 'addr'\n" " passing 'arg' as arguments\n" @@ -83,7 +83,7 @@ U_BOOT_CMD( extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( - reset, CFG_MAXARGS, 1, do_reset, + reset, CONFIG_MAXARGS, 1, do_reset, "reset - Perform RESET of the CPU\n", NULL ); diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 03319da30e..c3c047fa6b 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -48,7 +48,7 @@ DECLARE_GLOBAL_DATA_PTR; #include <rtc.h> #endif -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER #include <hush.h> #endif @@ -446,7 +446,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - bootm, CFG_MAXARGS, 1, do_bootm, + bootm, CONFIG_MAXARGS, 1, do_bootm, "bootm - boot application image from memory\n", "[addr [arg ...]]\n - boot application image stored in memory\n" "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n" @@ -1126,7 +1126,7 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag, int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int rcode = 0; -#ifndef CFG_HUSH_PARSER +#ifndef CONFIG_HUSH_PARSER if (run_command (getenv ("bootcmd"), flag) < 0) rcode = 1; #else if (parse_string_outer(getenv("bootcmd"), @@ -1208,7 +1208,7 @@ static int image_info (ulong addr) } U_BOOT_CMD( - iminfo, CFG_MAXARGS, 1, do_iminfo, + iminfo, CONFIG_MAXARGS, 1, do_iminfo, "iminfo - print header information for application image\n", "addr [addr ...]\n" " - print header information for application image starting at\n" diff --git a/common/cmd_diag.c b/common/cmd_diag.c index 45c4b31f5f..c3b31220d1 100644 --- a/common/cmd_diag.c +++ b/common/cmd_diag.c @@ -67,7 +67,7 @@ int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) /***************************************************/ U_BOOT_CMD( - diag, CFG_MAXARGS, 0, do_diag, + diag, CONFIG_MAXARGS, 0, do_diag, "diag - perform board diagnostics\n", " - print list of available tests\n" "diag [test1 [test2]]\n" diff --git a/common/cmd_display.c b/common/cmd_display.c index abee8444e2..3ee781f7e1 100644 --- a/common/cmd_display.c +++ b/common/cmd_display.c @@ -72,7 +72,7 @@ int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /***************************************************/ U_BOOT_CMD( - display, CFG_MAXARGS, 1, do_display, + display, CONFIG_MAXARGS, 1, do_display, "display- display string on dot matrix display\n", "[<string>]\n" " - with <string> argument: display <string> on dot matrix display\n" diff --git a/common/command.c b/common/command.c index cd6265e1f3..2eaa72dcd4 100644 --- a/common/command.c +++ b/common/command.c @@ -70,7 +70,7 @@ do_echo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - echo, CFG_MAXARGS, 1, do_echo, + echo, CONFIG_MAXARGS, 1, do_echo, "echo - echo args to console\n", "[args..]\n" " - echo args to console; \\c suppresses newline\n" @@ -78,7 +78,7 @@ U_BOOT_CMD( #endif /* CONFIG_CMD_ECHO */ -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER int do_test (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -193,7 +193,7 @@ do_test (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - test, CFG_MAXARGS, 1, do_test, + test, CONFIG_MAXARGS, 1, do_test, "test - minimal test like /bin/sh\n", "[args..]\n" " - test functionality\n" @@ -277,7 +277,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) */ for (i = 1; i < argc; ++i) { if ((cmdtp = find_cmd (argv[i])) != NULL) { -#ifdef CFG_LONGHELP +#ifdef CONFIG_LONGHELP /* found - print (long) help info */ puts (cmdtp->name); putc (' '); @@ -291,7 +291,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) #else /* no long help available */ if (cmdtp->usage) puts (cmdtp->usage); -#endif /* CFG_LONGHELP */ +#endif /* CONFIG_LONGHELP */ } else { printf ("Unknown command '%s' - try 'help'" " without arguments for list of all" @@ -305,7 +305,7 @@ int do_help (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) U_BOOT_CMD( - help, CFG_MAXARGS, 1, do_help, + help, CONFIG_MAXARGS, 1, do_help, "help - print online help\n", "[command ...]\n" " - show help information (for 'command')\n" @@ -316,18 +316,18 @@ U_BOOT_CMD( ); /* This do not ust the U_BOOT_CMD macro as ? can't be used in symbol names */ -#ifdef CFG_LONGHELP +#ifdef CONFIG_LONGHELP cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = { - "?", CFG_MAXARGS, 1, do_help, + "?", CONFIG_MAXARGS, 1, do_help, "? - alias for 'help'\n", NULL }; #else cmd_tbl_t __u_boot_cmd_question_mark Struct_Section = { - "?", CFG_MAXARGS, 1, do_help, + "?", CONFIG_MAXARGS, 1, do_help, "? - alias for 'help'\n" }; -#endif /* CFG_LONGHELP */ +#endif /* CONFIG_LONGHELP */ /*************************************************************************** * find command table entry for a command @@ -555,12 +555,12 @@ static int find_common_prefix(char *argv[]) return len; } -static char tmp_buf[CFG_CBSIZE]; /* copy of console I/O buffer */ +static char tmp_buf[CONFIG_CBSIZE]; /* copy of console I/O buffer */ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp) { int n = *np, col = *colp; - char *argv[CFG_MAXARGS + 1]; /* NULL terminated */ + char *argv[CONFIG_MAXARGS + 1]; /* NULL terminated */ char *cmdv[20]; char *s, *t; const char *sep; @@ -616,7 +616,7 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp) if (s != NULL) { k = len + seplen; /* make sure it fits */ - if (n + k >= CFG_CBSIZE - 2) { + if (n + k >= CONFIG_CBSIZE - 2) { putc('\a'); return 1; } diff --git a/common/env.c b/common/env.c index 241110f588..29151d1a6e 100644 --- a/common/env.c +++ b/common/env.c @@ -253,7 +253,7 @@ int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - printenv, CFG_MAXARGS, 1, do_printenv, + printenv, CONFIG_MAXARGS, 1, do_printenv, "printenv- print environment variables\n", "\n - print values of all environment variables\n" "printenv name ...\n" @@ -273,7 +273,7 @@ int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - setenv, CFG_MAXARGS, 0, do_setenv, + setenv, CONFIG_MAXARGS, 0, do_setenv, "setenv - set environment variables\n", "name value ...\n" " - set environment variable 'name' to 'value ...'\n" diff --git a/common/hush.c b/common/hush.c index f7550b9cdf..c378f6def7 100644 --- a/common/hush.c +++ b/common/hush.c @@ -97,7 +97,7 @@ /*cmd_boot.c*/ extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); /* do_bootd */ #endif -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER #ifndef __U_BOOT__ #include <ctype.h> /* isalpha, isdigit */ #include <unistd.h> /* getpid */ @@ -1012,9 +1012,9 @@ static void get_user_input(struct in_str *i) fflush(stdout); i->p = the_command; #else - extern char console_buffer[CFG_CBSIZE]; + extern char console_buffer[CONFIG_CBSIZE]; int n; - static char the_command[CFG_CBSIZE]; + static char the_command[CONFIG_CBSIZE]; #ifdef CONFIG_BOOT_RETRY_TIME # ifdef CONFIG_RESET_TO_RETRY @@ -1026,9 +1026,9 @@ static void get_user_input(struct in_str *i) #endif i->__promptme = 1; if (i->promptmode == 1) { - n = readline(CFG_PROMPT); + n = readline(CONFIG_PROMPT); } else { - n = readline(CFG_PROMPT_HUSH_PS2); + n = readline(CONFIG_PROMPT_HUSH_PS2); } #ifdef CONFIG_BOOT_RETRY_TIME if (n == -2) { @@ -1068,7 +1068,7 @@ static void get_user_input(struct in_str *i) else { if (console_buffer[0] != '\n') { if (strlen(the_command) + strlen(console_buffer) - < CFG_CBSIZE) { + < CONFIG_CBSIZE) { n = strlen(the_command); the_command[n-1] = ' '; strcpy(&the_command[n],console_buffer); @@ -3545,5 +3545,5 @@ static char * make_string(char ** inp) return str; } -#endif /* CFG_HUSH_PARSER */ +#endif /* CONFIG_HUSH_PARSER */ /****************************************************************************/ diff --git a/common/kgdb.c b/common/kgdb.c index 6de6ec99a2..5f20c5890a 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -574,7 +574,7 @@ do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } U_BOOT_CMD( - kgdb, CFG_MAXARGS, 1, do_kgdb, + kgdb, CONFIG_MAXARGS, 1, do_kgdb, "kgdb - enter gdb remote debug mode\n", "[arg0 arg1 .. argN]\n" " - executes a breakpoint so that kgdb mode is\n" diff --git a/common/main.c b/common/main.c index 3b0e073716..779dd885c9 100644 --- a/common/main.c +++ b/common/main.c @@ -34,7 +34,7 @@ #include <malloc.h> /* for free() prototype */ #endif -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER #include <hush.h> #endif @@ -56,7 +56,7 @@ static int abortboot(int); #undef DEBUG_PARSER -char console_buffer[CFG_CBSIZE]; /* console I/O buffer */ +char console_buffer[CONFIG_CBSIZE]; /* console I/O buffer */ #ifndef CONFIG_CMDLINE_EDITING static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen); @@ -290,8 +290,8 @@ static __inline__ int abortboot(int bootdelay) void main_loop (void) { -#ifndef CFG_HUSH_PARSER - static char lastcommand[CFG_CBSIZE] = { 0, }; +#ifndef CONFIG_HUSH_PARSER + static char lastcommand[CONFIG_CBSIZE] = { 0, }; int len; int rc = 1; int flag; @@ -321,7 +321,7 @@ void main_loop (void) bootlimit = bcs ? simple_strtoul (bcs, NULL, 10) : 0; #endif /* CONFIG_BOOTCOUNT_LIMIT */ -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER u_boot_hush_start (); #endif @@ -335,7 +335,7 @@ void main_loop (void) int prev = disable_ctrlc(1); /* disable Control C checking */ # endif -# ifndef CFG_HUSH_PARSER +# ifndef CONFIG_HUSH_PARSER run_command (p, 0); # else parse_string_outer(p, FLAG_PARSE_SEMICOLON | @@ -375,7 +375,7 @@ void main_loop (void) int prev = disable_ctrlc(1); /* disable Control C checking */ # endif -# ifndef CFG_HUSH_PARSER +# ifndef CONFIG_HUSH_PARSER run_command (s, 0); # else parse_string_outer(s, FLAG_PARSE_SEMICOLON | @@ -391,7 +391,7 @@ void main_loop (void) if (menukey == CONFIG_MENUKEY) { s = getenv("menucmd"); if (s) { -# ifndef CFG_HUSH_PARSER +# ifndef CONFIG_HUSH_PARSER run_command (s, 0); # else parse_string_outer(s, FLAG_PARSE_SEMICOLON | @@ -405,7 +405,7 @@ void main_loop (void) /* * Main Loop for Monitor Command Processing */ -#ifdef CFG_HUSH_PARSER +#ifdef CONFIG_HUSH_PARSER parse_file_outer(); /* This point is never reached */ for (;;); @@ -450,7 +450,7 @@ void main_loop (void) lastcommand[0] = 0; } } -#endif /*CFG_HUSH_PARSER*/ +#endif /*CONFIG_HUSH_PARSER*/ } #ifdef CONFIG_BOOT_RETRY_TIME @@ -965,7 +965,7 @@ int readline (const char *const prompt) /* * Must be a normal character then */ - if (n < CFG_CBSIZE-2) { + if (n < CONFIG_CBSIZE-2) { if (c == '\t') { /* expand TABs */ #ifdef CONFIG_AUTO_COMPLETE /* if auto completion triggered just continue */ @@ -1034,7 +1034,7 @@ int parse_line (char *line, char *argv[]) #ifdef DEBUG_PARSER printf ("parse_line: \"%s\"\n", line); #endif - while (nargs < CFG_MAXARGS) { + while (nargs < CONFIG_MAXARGS) { /* skip any white space */ while ((*line == ' ') || (*line == '\t')) { @@ -1067,7 +1067,7 @@ int parse_line (char *line, char *argv[]) *line++ = '\0'; /* terminate current arg */ } - printf ("** Too many args (max. %d) **\n", CFG_MAXARGS); + printf ("** Too many args (max. %d) **\n", CONFIG_MAXARGS); #ifdef DEBUG_PARSER printf ("parse_line: nargs=%d\n", nargs); @@ -1082,7 +1082,7 @@ static void process_macros (const char *input, char *output) char c, prev; const char *varname_start = NULL; int inputcnt = strlen (input); - int outputcnt = CFG_CBSIZE; + int outputcnt = CONFIG_CBSIZE; int state = 0; /* 0 = waiting for '$' */ /* 1 = waiting for '(' or '{' */ @@ -1142,7 +1142,7 @@ static void process_macros (const char *input, char *output) case 2: /* Waiting for ) */ if (c == ')' || c == '}') { int i; - char envname[CFG_CBSIZE], *envval; + char envname[CONFIG_CBSIZE], *envval; int envcnt = input - varname_start - 1; /* Varname # of chars */ /* Get the varname */ @@ -1191,7 +1191,7 @@ static void process_macros (const char *input, char *output) * 0 - command executed but not repeatable, interrupted commands are * always considered not repeatable * -1 - not executed (unrecognized, bootd recursion or too many args) - * (If cmd is NULL or "" or longer than CFG_CBSIZE-1 it is + * (If cmd is NULL or "" or longer than CONFIG_CBSIZE-1 it is * considered unrecognized) * * WARNING: @@ -1205,12 +1205,12 @@ static void process_macros (const char *input, char *output) int run_command (const char *cmd, int flag) { cmd_tbl_t *cmdtp; - char cmdbuf[CFG_CBSIZE]; /* working copy of cmd */ + char cmdbuf[CONFIG_CBSIZE]; /* working copy of cmd */ char *token; /* start of token in cmdbuf */ char *sep; /* end of token (separator) in cmdbuf */ - char finaltoken[CFG_CBSIZE]; + char finaltoken[CONFIG_CBSIZE]; char *str = cmdbuf; - char *argv[CFG_MAXARGS + 1]; /* NULL terminated */ + char *argv[CONFIG_MAXARGS + 1]; /* NULL terminated */ int argc, inquotes; int repeatable = 1; int rc = 0; @@ -1227,7 +1227,7 @@ int run_command (const char *cmd, int flag) return -1; /* empty command */ } - if (strlen(cmd) >= CFG_CBSIZE) { + if (strlen(cmd) >= CONFIG_CBSIZE) { puts ("## Command too long!\n"); return -1; } @@ -1345,7 +1345,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) printf ("## Error: \"%s\" not defined\n", argv[i]); return 1; } -#ifndef CFG_HUSH_PARSER +#ifndef CONFIG_HUSH_PARSER if (run_command (arg, flag) == -1) return 1; #else @@ -1359,7 +1359,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); U_BOOT_CMD( - run, CFG_MAXARGS, 1, do_run, + run, CONFIG_MAXARGS, 1, do_run, "run - run commands in an environment variable\n", "var [...]\n" " - run the commands in the environment variable(s) 'var'\n" |