diff options
| author | Kim Phillips <[email protected]> | 2013-02-04 11:16:26 -0600 |
|---|---|---|
| committer | Kim Phillips <[email protected]> | 2013-02-04 11:16:26 -0600 |
| commit | 9a32084ea0cf55d22384f083002ee9932e074f31 (patch) | |
| tree | 726a2ee288654832876f3e81ff5f1d356e784e13 /common | |
| parent | 8f171a56b58e2e89d0e5e995f074f774c2d64bc3 (diff) | |
| parent | 2d795c9621de274cb0cb8cf4af5941293f89c3be (diff) | |
Merge branch 'master' of git://git.denx.de/u-boot
Diffstat (limited to 'common')
| -rw-r--r-- | common/cmd_bdinfo.c | 33 | ||||
| -rw-r--r-- | common/cmd_bootm.c | 3 | ||||
| -rw-r--r-- | common/cmd_immap.c | 2 | ||||
| -rw-r--r-- | common/cmd_time.c | 33 | ||||
| -rw-r--r-- | common/command.c | 6 | ||||
| -rw-r--r-- | common/env_mmc.c | 4 | ||||
| -rw-r--r-- | common/hush.c | 2 | ||||
| -rw-r--r-- | common/main.c | 12 | ||||
| -rw-r--r-- | common/stdio.c | 2 |
9 files changed, 46 insertions, 51 deletions
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index 48cdd16dd21..85279d5e7b8 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -51,6 +51,25 @@ static void print_eth(int idx) } __maybe_unused +static void print_eths(void) +{ + struct eth_device *dev; + int i = 0; + + do { + dev = eth_get_dev_by_index(i); + if (dev) { + printf("eth%dname = %s\n", i, dev->name); + print_eth(i); + i++; + } + } while (dev); + + printf("current eth = %s\n", eth_get_name()); + printf("ip_addr = %s\n", getenv("ipaddr")); +} + +__maybe_unused static void print_lnum(const char *name, unsigned long long value) { printf("%-12s= 0x%.8llX\n", name, value); @@ -195,10 +214,9 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_num("sram size ", (ulong)bd->bi_sramsize); #endif #if defined(CONFIG_CMD_NET) - print_eth(0); - printf("ip_addr = %s\n", getenv("ipaddr")); + print_eths(); #endif - printf("baudrate = %u bps\n", (ulong)bd->bi_baudrate); + printf("baudrate = %u bps\n", bd->bi_baudrate); return 0; } @@ -366,18 +384,19 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } #if defined(CONFIG_CMD_NET) - print_eth(0); - printf("ip_addr = %s\n", getenv("ipaddr")); + print_eths(); #endif printf("baudrate = %u bps\n", bd->bi_baudrate); #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) - print_num("TLB addr", gd->tlb_addr); + print_num("TLB addr", gd->arch.tlb_addr); #endif print_num("relocaddr", gd->relocaddr); print_num("reloc off", gd->reloc_off); print_num("irq_sp", gd->irq_sp); /* irq stack pointer */ print_num("sp start ", gd->start_addr_sp); +#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) print_num("FB base ", gd->fb_base); +#endif /* * TODO: Currently only support for davinci SOC's is added. * Remove this check once all the board implement this. @@ -463,7 +482,9 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) print_eth(0); printf("ip_addr = %s\n", getenv("ipaddr")); #endif +#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO) print_num("FB base ", gd->fb_base); +#endif return 0; } diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 1b8a8c15610..7ae5d5b2940 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -498,7 +498,8 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, return CMD_RET_USAGE; } - if (images.state >= state) { + if (images.state < BOOTM_STATE_START || + images.state >= state) { printf("Trying to execute a command out of order\n"); return CMD_RET_USAGE; } diff --git a/common/cmd_immap.c b/common/cmd_immap.c index 1f59c1e1d16..fdf9489b2e9 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -453,7 +453,7 @@ static void prbrg (int n, uint val) #if defined(CONFIG_8xx) ulong clock = gd->cpu_clk; #elif defined(CONFIG_8260) - ulong clock = gd->brg_clk; + ulong clock = gd->arch.brg_clk; #endif printf ("BRG%d:", n); diff --git a/common/cmd_time.c b/common/cmd_time.c index 6dbdbbfbe7a..9808cd66995 100644 --- a/common/cmd_time.c +++ b/common/cmd_time.c @@ -22,36 +22,6 @@ #include <common.h> #include <command.h> -/* - * TODO(clchiou): This function actually minics the bottom-half of the - * run_command() function. Since this function has ARM-dependent timer - * codes, we cannot merge it with the run_command() for now. - */ -static int run_command_and_time_it(int flag, int argc, char * const argv[], - ulong *cycles) -{ - cmd_tbl_t *cmdtp = find_cmd(argv[0]); - int retval = 0; - - if (!cmdtp) { - printf("%s: command not found\n", argv[0]); - return 1; - } - if (argc > cmdtp->maxargs) - return CMD_RET_USAGE; - - /* - * TODO(clchiou): get_timer_masked() is only defined in certain ARM - * boards. We could use the new timer API that Graeme is proposing - * so that this piece of code would be arch-independent. - */ - *cycles = get_timer_masked(); - retval = cmdtp->cmd(cmdtp, flag, argc, argv); - *cycles = get_timer_masked() - *cycles; - - return retval; -} - static void report_time(ulong cycles) { ulong minutes, seconds, milliseconds; @@ -75,11 +45,12 @@ static int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong cycles = 0; int retval = 0; + int repeatable; if (argc == 1) return CMD_RET_USAGE; - retval = run_command_and_time_it(0, argc - 1, argv + 1, &cycles); + retval = cmd_process(0, argc - 1, argv + 1, &repeatable, &cycles); report_time(cycles); return retval; diff --git a/common/command.c b/common/command.c index 50c84292c16..305a236facc 100644 --- a/common/command.c +++ b/common/command.c @@ -513,7 +513,7 @@ static int cmd_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } enum command_ret_t cmd_process(int flag, int argc, char * const argv[], - int *repeatable) + int *repeatable, ulong *ticks) { enum command_ret_t rc = CMD_RET_SUCCESS; cmd_tbl_t *cmdtp; @@ -543,7 +543,11 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[], /* If OK so far, then do the command */ if (!rc) { + if (ticks) + *ticks = get_timer(0); rc = cmd_call(cmdtp, flag, argc, argv); + if (ticks) + *ticks = get_timer(*ticks); *repeatable &= cmdtp->repeatable; } if (rc == CMD_RET_USAGE) diff --git a/common/env_mmc.c b/common/env_mmc.c index ce216712100..02bd5aed10c 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -46,13 +46,11 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_ENV_OFFSET 0 #endif -static int __mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) +__weak int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) { *env_addr = CONFIG_ENV_OFFSET; return 0; } -int mmc_get_env_addr(struct mmc *mmc, u32 *env_addr) - __attribute__((weak, alias("__mmc_get_env_addr"))); int env_init(void) { diff --git a/common/hush.c b/common/hush.c index eb6c879c534..cc81c9c3e05 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1665,7 +1665,7 @@ static int run_pipe_real(struct pipe *pi) } /* Process the command */ return cmd_process(flag, child->argc, child->argv, - &flag_repeat); + &flag_repeat, NULL); #endif } #ifndef __U_BOOT__ diff --git a/common/main.c b/common/main.c index 5d8454ea0e5..e2d2e09bf9f 100644 --- a/common/main.c +++ b/common/main.c @@ -225,6 +225,7 @@ static inline int abortboot(int bootdelay) { int abort = 0; + unsigned long ts; #ifdef CONFIG_MENUPROMPT printf(CONFIG_MENUPROMPT); @@ -248,11 +249,10 @@ int abortboot(int bootdelay) #endif while ((bootdelay > 0) && (!abort)) { - int i; - --bootdelay; - /* delay 100 * 10ms */ - for (i=0; !abort && i<100; ++i) { + /* delay 1000 ms */ + ts = get_timer(0); + do { if (tstc()) { /* we got a key press */ abort = 1; /* don't auto boot */ bootdelay = 0; /* no more delay */ @@ -264,7 +264,7 @@ int abortboot(int bootdelay) break; } udelay(10000); - } + } while (!abort && get_timer(ts) < 1000); printf("\b\b\b%2d ", bootdelay); } @@ -1452,7 +1452,7 @@ static int builtin_run_command(const char *cmd, int flag) continue; } - if (cmd_process(flag, argc, argv, &repeatable)) + if (cmd_process(flag, argc, argv, &repeatable, NULL)) rc = -1; /* Did the user stop this? */ diff --git a/common/stdio.c b/common/stdio.c index 97ff9cf4a6a..5d5117c0ed8 100644 --- a/common/stdio.c +++ b/common/stdio.c @@ -207,7 +207,7 @@ int stdio_init (void) /* Initialize the list */ INIT_LIST_HEAD(&(devs.list)); -#ifdef CONFIG_ARM_DCC_MULTI +#ifdef CONFIG_ARM_DCC drv_arm_dcc_init (); #endif #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C) |
