blob: 14e3660dd8d7634e058d280bed1e457de8838066 [file] [log] [blame]
wdenkcc1c8a12002-11-02 22:58:18 +00001/*
2 * (C) Copyright 2001
3 * Dave Ellis, SIXNET, dge@sixnetio.com
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkcc1c8a12002-11-02 22:58:18 +00006 */
7
8Using autoboot configuration options
9====================================
10
11The basic autoboot configuration options are documented in the main
12U-Boot README. See it for details. They are:
13
14 bootdelay
15 bootcmd
16 CONFIG_BOOTDELAY
17 CONFIG_BOOTCOMMAND
18
19Some additional options that make autoboot safer in a production
20product are documented here.
21
22Why use them?
23-------------
24
25The basic autoboot feature allows a system to automatically boot to
26the real application (such as Linux) without a user having to enter
27any commands. If any key is pressed before the boot delay time
28expires, U-Boot stops the autoboot process, gives a U-Boot prompt
29and waits forever for a command. That's a good thing if you pressed a
30key because you wanted to get the prompt.
31
32It's not so good if the key press was a stray character on the
33console serial port, say because a user who knows nothing about
34U-Boot pressed a key before the system had time to boot. It's even
35worse on an embedded product that doesn't have a console during
36normal use. The modem plugged into that console port sends a
37character at the wrong time and the system hangs, with no clue as to
38why it isn't working.
39
40You might want the system to autoboot to recover after an external
41configuration program stops autoboot. If the configuration program
42dies or loses its connection (modems can disconnect at the worst
43time) U-Boot will patiently wait forever for it to finish.
44
45These additional configuration options can help provide a system that
46boots when it should, but still allows access to U-Boot.
47
48What they do
49------------
50
51 CONFIG_BOOT_RETRY_TIME
52 CONFIG_BOOT_RETRY_MIN
53
wdenke1599e82004-10-10 23:27:33 +000054 "bootretry" environment variable
wdenkcc1c8a12002-11-02 22:58:18 +000055
wdenk8bde7f72003-06-27 21:31:46 +000056 These options determine what happens after autoboot is
57 stopped and U-Boot is waiting for commands.
wdenkcc1c8a12002-11-02 22:58:18 +000058
wdenk8bde7f72003-06-27 21:31:46 +000059 CONFIG_BOOT_RETRY_TIME must be defined to enable the boot
wdenke1599e82004-10-10 23:27:33 +000060 retry feature. If the environment variable "bootretry" is
wdenk8bde7f72003-06-27 21:31:46 +000061 found then its value is used, otherwise the retry timeout is
62 CONFIG_BOOT_RETRY_TIME. CONFIG_BOOT_RETRY_MIN is optional and
63 defaults to CONFIG_BOOT_RETRY_TIME. All times are in seconds.
wdenkcc1c8a12002-11-02 22:58:18 +000064
wdenk8bde7f72003-06-27 21:31:46 +000065 If the retry timeout is negative, the U-Boot command prompt
66 never times out. Otherwise it is forced to be at least
67 CONFIG_BOOT_RETRY_MIN seconds. If no valid U-Boot command is
68 entered before the specified time the boot delay sequence is
69 restarted. Each command that U-Boot executes restarts the
70 timeout.
wdenkcc1c8a12002-11-02 22:58:18 +000071
wdenk8bde7f72003-06-27 21:31:46 +000072 If CONFIG_BOOT_RETRY_TIME < 0 the feature is there, but
73 doesn't do anything unless the environment variable
wdenke1599e82004-10-10 23:27:33 +000074 "bootretry" is >= 0.
wdenkcc1c8a12002-11-02 22:58:18 +000075
76 CONFIG_AUTOBOOT_KEYED
Mark Langsdorf00ddacc2013-09-10 15:20:23 -050077 CONFIG_AUTOBOOT_KEYED_CTRLC
wdenkcc1c8a12002-11-02 22:58:18 +000078 CONFIG_AUTOBOOT_PROMPT
79 CONFIG_AUTOBOOT_DELAY_STR
80 CONFIG_AUTOBOOT_STOP_STR
81 CONFIG_AUTOBOOT_DELAY_STR2
82 CONFIG_AUTOBOOT_STOP_STR2
83
wdenke1599e82004-10-10 23:27:33 +000084 "bootdelaykey" environment variable
wdenk8b74bf32004-10-11 23:10:30 +000085 "bootstopkey" environment variable
wdenke1599e82004-10-10 23:27:33 +000086 "bootdelaykey2" environment variable
87 "bootstopkey2" environment variable
wdenkcc1c8a12002-11-02 22:58:18 +000088
wdenk8bde7f72003-06-27 21:31:46 +000089 These options give more control over stopping autoboot. When
90 they are used a specific character or string is required to
91 stop or delay autoboot.
wdenkcc1c8a12002-11-02 22:58:18 +000092
93 Define CONFIG_AUTOBOOT_KEYED (no value required) to enable
wdenk8b74bf32004-10-11 23:10:30 +000094 this group of options. CONFIG_AUTOBOOT_DELAY_STR,
wdenkcc1c8a12002-11-02 22:58:18 +000095 CONFIG_AUTOBOOT_STOP_STR or both should be specified (or
96 specified by the corresponding environment variable),
97 otherwise there is no way to stop autoboot.
98
wdenk8bde7f72003-06-27 21:31:46 +000099 CONFIG_AUTOBOOT_PROMPT is displayed before the boot delay
100 selected by CONFIG_BOOTDELAY starts. If it is not defined
101 there is no output indicating that autoboot is in progress.
Stefan Roesef2302d42008-08-06 14:05:38 +0200102
103 Note that CONFIG_AUTOBOOT_PROMPT is used as the (only)
104 argument to a printf() call, so it may contain '%' format
105 specifications, provided that it also includes, sepearated by
106 commas exactly like in a printf statement, the required
107 arguments. It is the responsibility of the user to select only
108 such arguments that are valid in the given context. A
109 reasonable prompt could be defined as
110
111 #define CONFIG_AUTOBOOT_PROMPT \
112 "autoboot in %d seconds\n",bootdelay
wdenkcc1c8a12002-11-02 22:58:18 +0000113
wdenk8b74bf32004-10-11 23:10:30 +0000114 If CONFIG_AUTOBOOT_DELAY_STR or "bootdelaykey" is specified
115 and this string is received from console input before
116 autoboot starts booting, U-Boot gives a command prompt. The
117 U-Boot prompt will time out if CONFIG_BOOT_RETRY_TIME is
118 used, otherwise it never times out.
wdenkcc1c8a12002-11-02 22:58:18 +0000119
wdenk8b74bf32004-10-11 23:10:30 +0000120 If CONFIG_AUTOBOOT_STOP_STR or "bootstopkey" is specified and
121 this string is received from console input before autoboot
122 starts booting, U-Boot gives a command prompt. The U-Boot
123 prompt never times out, even if CONFIG_BOOT_RETRY_TIME is
124 used.
wdenkcc1c8a12002-11-02 22:58:18 +0000125
wdenk8bde7f72003-06-27 21:31:46 +0000126 The string recognition is not very sophisticated. If a
127 partial match is detected, the first non-matching character
128 is checked to see if starts a new match. There is no check
129 for a shorter partial match, so it's best if the first
130 character of a key string does not appear in the rest of the
131 string.
wdenkcc1c8a12002-11-02 22:58:18 +0000132
wdenk8b74bf32004-10-11 23:10:30 +0000133 Using the CONFIG_AUTOBOOT_DELAY_STR2 #define or the
134 "bootdelaykey2" environment variable and/or the
135 CONFIG_AUTOBOOT_STOP_STR2 #define or the "bootstopkey"
136 environment variable you can specify a second, alternate
137 string (which allows you to have two "password" strings).
wdenkcc1c8a12002-11-02 22:58:18 +0000138
Mark Langsdorf00ddacc2013-09-10 15:20:23 -0500139 The CONFIG_AUTOBOOT_KEYED_CTRLC #define allows for the boot
140 sequence to be interrupted by ctrl-c, in addition to the
141 "bootdelaykey" and "bootstopkey". Setting this variable
142 provides an escape sequence from the limited "password"
143 strings.
144
145
wdenkcc1c8a12002-11-02 22:58:18 +0000146 CONFIG_ZERO_BOOTDELAY_CHECK
147
wdenk8bde7f72003-06-27 21:31:46 +0000148 If this option is defined, you can stop the autoboot process
149 by hitting a key even in that case when "bootdelay" has been
150 set to 0. You can set "bootdelay" to a negative value to
151 prevent the check for console input.
wdenkcc1c8a12002-11-02 22:58:18 +0000152
153 CONFIG_RESET_TO_RETRY
154
wdenk8bde7f72003-06-27 21:31:46 +0000155 (Only effective when CONFIG_BOOT_RETRY_TIME is also set)
156 After the countdown timed out, the board will be reset to restart
157 again.