summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-04-10 20:01:31 -0600
committerTom Rini <trini@ti.com>2014-05-29 17:49:00 -0400
commitb26440f1fa243396000536028ea00e5e185b6b6a (patch)
tree5a49215c1ccf6fcb80d4abc476f04df39556b6d0 /common
parent0098e179e1afacb3cf595c67a98b8739dc7edcde (diff)
Rename bootretry functions and remove #ifdefs
Add a bootretry_ prefix to these two functions, and remove the need for the #ifdef around everything (it moves to the Makefile). Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/autoboot.c6
-rw-r--r--common/bootretry.c4
-rw-r--r--common/cli_hush.c7
-rw-r--r--common/cli_simple.c4
-rw-r--r--common/cmd_i2c.c13
-rw-r--r--common/cmd_mem.c13
-rw-r--r--common/cmd_pci.c9
7 files changed, 16 insertions, 40 deletions
diff --git a/common/autoboot.c b/common/autoboot.c
index 5f8d9c3445c..984389885f2 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -113,11 +113,9 @@ static int abortboot_keyed(int bootdelay)
delaykey[i].retry ? "delay" :
"stop");
-# ifdef CONFIG_BOOT_RETRY_TIME
/* don't retry auto boot */
if (!delaykey[i].retry)
bootretry_dont_retry();
-# endif
abort = 1;
}
}
@@ -305,9 +303,7 @@ void bootdelay_process(void)
#if defined(CONFIG_MENU_SHOW)
bootdelay = menu_show(bootdelay);
#endif
-# ifdef CONFIG_BOOT_RETRY_TIME
- init_cmd_timeout();
-# endif /* CONFIG_BOOT_RETRY_TIME */
+ bootretry_init_cmd_timeout();
#ifdef CONFIG_POST
if (gd->flags & GD_FLG_POSTFAIL) {
diff --git a/common/bootretry.c b/common/bootretry.c
index 12653c00d0f..2d82798cd04 100644
--- a/common/bootretry.c
+++ b/common/bootretry.c
@@ -21,7 +21,7 @@ static int retry_time = -1; /* -1 so can call readline before main_loop */
/***************************************************************************
* initialize command line timeout
*/
-void init_cmd_timeout(void)
+void bootretry_init_cmd_timeout(void)
{
char *s = getenv("bootretry");
@@ -37,7 +37,7 @@ void init_cmd_timeout(void)
/***************************************************************************
* reset command line timeout to retry_time seconds
*/
-void reset_cmd_timeout(void)
+void bootretry_reset_cmd_timeout(void)
{
endtime = endtick(retry_time);
}
diff --git a/common/cli_hush.c b/common/cli_hush.c
index d6544ae6311..0f069b010a2 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -1000,12 +1000,7 @@ static void get_user_input(struct in_str *i)
int n;
static char the_command[CONFIG_SYS_CBSIZE + 1];
-#ifdef CONFIG_BOOT_RETRY_TIME
-# ifndef CONFIG_RESET_TO_RETRY
-# error "This currently only works with CONFIG_RESET_TO_RETRY enabled"
-# endif
- reset_cmd_timeout();
-#endif
+ bootretry_reset_cmd_timeout();
i->__promptme = 1;
if (i->promptmode == 1) {
n = cli_readline(CONFIG_SYS_PROMPT);
diff --git a/common/cli_simple.c b/common/cli_simple.c
index 5b7e2ce7d53..bba586ed44e 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -265,14 +265,12 @@ void cli_loop(void)
int rc = 1;
for (;;) {
-#ifdef CONFIG_BOOT_RETRY_TIME
if (rc >= 0) {
/* Saw enough of a valid command to
* restart the timeout.
*/
- reset_cmd_timeout();
+ bootretry_reset_cmd_timeout();
}
-#endif
len = cli_readline(CONFIG_SYS_PROMPT);
flag = 0; /* assume no special flags for now */
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 4fa12138c35..d714658d7f5 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -564,9 +564,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
if (argc != 3)
return CMD_RET_USAGE;
-#ifdef CONFIG_BOOT_RETRY_TIME
- reset_cmd_timeout(); /* got a good command to get here */
-#endif
+ bootretry_reset_cmd_timeout(); /* got a good command to get here */
/*
* We use the last specified parameters, unless new ones are
* entered.
@@ -623,9 +621,8 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
if (incrflag)
addr += size;
nbytes = size;
-#ifdef CONFIG_BOOT_RETRY_TIME
- reset_cmd_timeout(); /* good enough to not time out */
-#endif
+ /* good enough to not time out */
+ bootretry_reset_cmd_timeout();
}
#ifdef CONFIG_BOOT_RETRY_TIME
else if (nbytes == -2)
@@ -642,12 +639,10 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
data = be32_to_cpu(data);
nbytes = endp - console_buffer;
if (nbytes) {
-#ifdef CONFIG_BOOT_RETRY_TIME
/*
* good enough to not time out
*/
- reset_cmd_timeout();
-#endif
+ bootretry_reset_cmd_timeout();
if (i2c_write(chip, addr, alen, (uchar *)&data, size) != 0)
puts ("Error writing the chip.\n");
#ifdef CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 9bd7c0eedb9..1febddb916c 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1098,9 +1098,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
if (argc != 2)
return CMD_RET_USAGE;
-#ifdef CONFIG_BOOT_RETRY_TIME
- reset_cmd_timeout(); /* got a good command to get here */
-#endif
+ bootretry_reset_cmd_timeout(); /* got a good command to get here */
/* We use the last specified parameters, unless new ones are
* entered.
*/
@@ -1159,9 +1157,8 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
if (incrflag)
addr += nbytes ? -size : size;
nbytes = 1;
-#ifdef CONFIG_BOOT_RETRY_TIME
- reset_cmd_timeout(); /* good enough to not time out */
-#endif
+ /* good enough to not time out */
+ bootretry_reset_cmd_timeout();
}
#ifdef CONFIG_BOOT_RETRY_TIME
else if (nbytes == -2) {
@@ -1177,11 +1174,9 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
#endif
nbytes = endp - console_buffer;
if (nbytes) {
-#ifdef CONFIG_BOOT_RETRY_TIME
/* good enough to not time out
*/
- reset_cmd_timeout();
-#endif
+ bootretry_reset_cmd_timeout();
if (size == 4)
*((u32 *)ptr) = i;
#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 180b35ab0f7..a1ba42e2f3a 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -355,9 +355,8 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag
if (incrflag)
addr += nbytes ? -size : size;
nbytes = 1;
-#ifdef CONFIG_BOOT_RETRY_TIME
- reset_cmd_timeout(); /* good enough to not time out */
-#endif
+ /* good enough to not time out */
+ bootretry_reset_cmd_timeout();
}
#ifdef CONFIG_BOOT_RETRY_TIME
else if (nbytes == -2) {
@@ -369,11 +368,9 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag
i = simple_strtoul(console_buffer, &endp, 16);
nbytes = endp - console_buffer;
if (nbytes) {
-#ifdef CONFIG_BOOT_RETRY_TIME
/* good enough to not time out
*/
- reset_cmd_timeout();
-#endif
+ bootretry_reset_cmd_timeout();
pci_cfg_write (bdf, addr, size, i);
if (incrflag)
addr += size;