summaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/main.c
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@netinsight.net>2014-10-28 14:19:00 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2014-11-10 01:59:30 +0300
commit4b4b13d5fec8a82ed2780c487e49cfc4321a8c14 (patch)
treed021c3f9a715abfbc2b51100c7f32e5e61783d60 /arch/powerpc/boot/main.c
parent90029640fd5963343fb862d419db161bc0424120 (diff)
downloadlinux-4b4b13d5fec8a82ed2780c487e49cfc4321a8c14.tar.xz
powerpc/boot: Parse chosen/cmdline-timeout parameter
On some platforms a 5 second timeout during boot might be quite long, so make it configurable. Run the loop at least once to let the user stop the boot by holding a key pressed. If the timeout is set to 0, don't wait for input, which can be used as a workaround if the boot hangs on random data coming in on the serial port. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> [mpe: Changelog wording & whitespace] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/boot/main.c')
-rw-r--r--arch/powerpc/boot/main.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index d367a0aece2a..d80161b633f4 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -144,13 +144,24 @@ static char cmdline[BOOT_COMMAND_LINE_SIZE]
static void prep_cmdline(void *chosen)
{
+ unsigned int getline_timeout = 5000;
+ int v;
+ int n;
+
+ /* Wait-for-input time */
+ n = getprop(chosen, "linux,cmdline-timeout", &v, sizeof(v));
+ if (n == sizeof(v))
+ getline_timeout = v;
+
if (cmdline[0] == '\0')
getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1);
printf("\n\rLinux/PowerPC load: %s", cmdline);
+
/* If possible, edit the command line */
- if (console_ops.edit_cmdline)
- console_ops.edit_cmdline(cmdline, BOOT_COMMAND_LINE_SIZE);
+ if (console_ops.edit_cmdline && getline_timeout)
+ console_ops.edit_cmdline(cmdline, BOOT_COMMAND_LINE_SIZE, getline_timeout);
+
printf("\n\r");
/* Put the command line back into the devtree for the kernel */