1cc1c8a13Swdenk/* 2cc1c8a13Swdenk * (C) Copyright 2001 3cc1c8a13Swdenk * Dave Ellis, SIXNET, dge@sixnetio.com 4cc1c8a13Swdenk * 5cc1c8a13Swdenk * See file CREDITS for list of people who contributed to this 6cc1c8a13Swdenk * project. 7cc1c8a13Swdenk * 8cc1c8a13Swdenk * This program is free software; you can redistribute it and/or 9cc1c8a13Swdenk * modify it under the terms of the GNU General Public License as 10cc1c8a13Swdenk * published by the Free Software Foundation; either version 2 of 11cc1c8a13Swdenk * the License, or (at your option) any later version. 12cc1c8a13Swdenk * 13cc1c8a13Swdenk * This program is distributed in the hope that it will be useful, 14cc1c8a13Swdenk * but WITHOUT ANY WARRANTY; without even the implied warranty of 15cc1c8a13Swdenk * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16cc1c8a13Swdenk * GNU General Public License for more details. 17cc1c8a13Swdenk * 18cc1c8a13Swdenk * You should have received a copy of the GNU General Public License 19cc1c8a13Swdenk * along with this program; if not, write to the Free Software 20cc1c8a13Swdenk * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21cc1c8a13Swdenk * MA 02111-1307 USA 22cc1c8a13Swdenk */ 23cc1c8a13Swdenk 24cc1c8a13SwdenkUsing autoboot configuration options 25cc1c8a13Swdenk==================================== 26cc1c8a13Swdenk 27cc1c8a13SwdenkThe basic autoboot configuration options are documented in the main 28cc1c8a13SwdenkU-Boot README. See it for details. They are: 29cc1c8a13Swdenk 30cc1c8a13Swdenk bootdelay 31cc1c8a13Swdenk bootcmd 32cc1c8a13Swdenk CONFIG_BOOTDELAY 33cc1c8a13Swdenk CONFIG_BOOTCOMMAND 34cc1c8a13Swdenk 35cc1c8a13SwdenkSome additional options that make autoboot safer in a production 36cc1c8a13Swdenkproduct are documented here. 37cc1c8a13Swdenk 38cc1c8a13SwdenkWhy use them? 39cc1c8a13Swdenk------------- 40cc1c8a13Swdenk 41cc1c8a13SwdenkThe basic autoboot feature allows a system to automatically boot to 42cc1c8a13Swdenkthe real application (such as Linux) without a user having to enter 43cc1c8a13Swdenkany commands. If any key is pressed before the boot delay time 44cc1c8a13Swdenkexpires, U-Boot stops the autoboot process, gives a U-Boot prompt 45cc1c8a13Swdenkand waits forever for a command. That's a good thing if you pressed a 46cc1c8a13Swdenkkey because you wanted to get the prompt. 47cc1c8a13Swdenk 48cc1c8a13SwdenkIt's not so good if the key press was a stray character on the 49cc1c8a13Swdenkconsole serial port, say because a user who knows nothing about 50cc1c8a13SwdenkU-Boot pressed a key before the system had time to boot. It's even 51cc1c8a13Swdenkworse on an embedded product that doesn't have a console during 52cc1c8a13Swdenknormal use. The modem plugged into that console port sends a 53cc1c8a13Swdenkcharacter at the wrong time and the system hangs, with no clue as to 54cc1c8a13Swdenkwhy it isn't working. 55cc1c8a13Swdenk 56cc1c8a13SwdenkYou might want the system to autoboot to recover after an external 57cc1c8a13Swdenkconfiguration program stops autoboot. If the configuration program 58cc1c8a13Swdenkdies or loses its connection (modems can disconnect at the worst 59cc1c8a13Swdenktime) U-Boot will patiently wait forever for it to finish. 60cc1c8a13Swdenk 61cc1c8a13SwdenkThese additional configuration options can help provide a system that 62cc1c8a13Swdenkboots when it should, but still allows access to U-Boot. 63cc1c8a13Swdenk 64cc1c8a13SwdenkWhat they do 65cc1c8a13Swdenk------------ 66cc1c8a13Swdenk 67cc1c8a13Swdenk CONFIG_BOOT_RETRY_TIME 68cc1c8a13Swdenk CONFIG_BOOT_RETRY_MIN 69cc1c8a13Swdenk 70*e1599e83Swdenk "bootretry" environment variable 71cc1c8a13Swdenk 72cc1c8a13Swdenk These options determine what happens after autoboot is 73cc1c8a13Swdenk stopped and U-Boot is waiting for commands. 74cc1c8a13Swdenk 75cc1c8a13Swdenk CONFIG_BOOT_RETRY_TIME must be defined to enable the boot 76*e1599e83Swdenk retry feature. If the environment variable "bootretry" is 77cc1c8a13Swdenk found then its value is used, otherwise the retry timeout is 78cc1c8a13Swdenk CONFIG_BOOT_RETRY_TIME. CONFIG_BOOT_RETRY_MIN is optional and 79cc1c8a13Swdenk defaults to CONFIG_BOOT_RETRY_TIME. All times are in seconds. 80cc1c8a13Swdenk 81cc1c8a13Swdenk If the retry timeout is negative, the U-Boot command prompt 82cc1c8a13Swdenk never times out. Otherwise it is forced to be at least 83cc1c8a13Swdenk CONFIG_BOOT_RETRY_MIN seconds. If no valid U-Boot command is 84cc1c8a13Swdenk entered before the specified time the boot delay sequence is 85cc1c8a13Swdenk restarted. Each command that U-Boot executes restarts the 86cc1c8a13Swdenk timeout. 87cc1c8a13Swdenk 88cc1c8a13Swdenk If CONFIG_BOOT_RETRY_TIME < 0 the feature is there, but 89cc1c8a13Swdenk doesn't do anything unless the environment variable 90*e1599e83Swdenk "bootretry" is >= 0. 91cc1c8a13Swdenk 92cc1c8a13Swdenk CONFIG_AUTOBOOT_KEYED 93cc1c8a13Swdenk CONFIG_AUTOBOOT_PROMPT 94cc1c8a13Swdenk CONFIG_AUTOBOOT_DELAY_STR 95cc1c8a13Swdenk CONFIG_AUTOBOOT_STOP_STR 96cc1c8a13Swdenk CONFIG_AUTOBOOT_DELAY_STR2 97cc1c8a13Swdenk CONFIG_AUTOBOOT_STOP_STR2 98cc1c8a13Swdenk 99*e1599e83Swdenk "bootdelaykey" environment variable 100*e1599e83Swdenk "bootstopkey" environment variable 101*e1599e83Swdenk "bootdelaykey2" environment variable 102*e1599e83Swdenk "bootstopkey2" environment variable 103cc1c8a13Swdenk 104cc1c8a13Swdenk These options give more control over stopping autoboot. When 105cc1c8a13Swdenk they are used a specific character or string is required to 106cc1c8a13Swdenk stop or delay autoboot. 107cc1c8a13Swdenk 108cc1c8a13Swdenk Define CONFIG_AUTOBOOT_KEYED (no value required) to enable 109cc1c8a13Swdenk this group of options. CONFIG_AUTOBOOT_DELAY_STR, 110cc1c8a13Swdenk CONFIG_AUTOBOOT_STOP_STR or both should be specified (or 111cc1c8a13Swdenk specified by the corresponding environment variable), 112cc1c8a13Swdenk otherwise there is no way to stop autoboot. 113cc1c8a13Swdenk 114cc1c8a13Swdenk CONFIG_AUTOBOOT_PROMPT is displayed before the boot delay 115cc1c8a13Swdenk selected by CONFIG_BOOTDELAY starts. If it is not defined 116cc1c8a13Swdenk there is no output indicating that autoboot is in progress. 117cc1c8a13Swdenk If "%d" is included, it is replaced by the number of seconds 118cc1c8a13Swdenk remaining before autoboot will start, but it does not count 119cc1c8a13Swdenk down the seconds. "autoboot in %d seconds\n" is a reasonable 120cc1c8a13Swdenk prompt. 121cc1c8a13Swdenk 122*e1599e83Swdenk If CONFIG_AUTOBOOT_DELAY_STR or "bootdelaykey" is specified 123*e1599e83Swdenk and this string is received from console input before 124*e1599e83Swdenk autoboot starts booting, U-Boot gives a command prompt. The 125*e1599e83Swdenk U-Boot prompt will time out if CONFIG_BOOT_RETRY_TIME is 126*e1599e83Swdenk used, otherwise it never times out. 127cc1c8a13Swdenk 128*e1599e83Swdenk If CONFIG_AUTOBOOT_STOP_STR or "bootstopkey" is specified and 129cc1c8a13Swdenk this string is received from console input before autoboot 130cc1c8a13Swdenk starts booting, U-Boot gives a command prompt. The U-Boot 131cc1c8a13Swdenk prompt never times out, even if CONFIG_BOOT_RETRY_TIME is 132cc1c8a13Swdenk used. 133cc1c8a13Swdenk 134cc1c8a13Swdenk The string recognition is not very sophisticated. If a 135cc1c8a13Swdenk partial match is detected, the first non-matching character 136cc1c8a13Swdenk is checked to see if starts a new match. There is no check 137cc1c8a13Swdenk for a shorter partial match, so it's best if the first 138cc1c8a13Swdenk character of a key string does not appear in the rest of the 139cc1c8a13Swdenk string. 140cc1c8a13Swdenk 141*e1599e83Swdenk Using the CONFIG_AUTOBOOT_DELAY_STR2 #define or the 142*e1599e83Swdenk "bootdelaykey2" environment variable and/or the 143*e1599e83Swdenk CONFIG_AUTOBOOT_STOP_STR2 #define or the "bootstopkey" 144*e1599e83Swdenk environment variable you can specify a second, alternate 1458564acf9Swdenk string (which allows you to have two "password" strings). 146cc1c8a13Swdenk 147cc1c8a13Swdenk CONFIG_ZERO_BOOTDELAY_CHECK 148cc1c8a13Swdenk 149cc1c8a13Swdenk If this option is defined, you can stop the autoboot process 150cc1c8a13Swdenk by hitting a key even in that case when "bootdelay" has been 151cc1c8a13Swdenk set to 0. You can set "bootdelay" to a negative value to 152cc1c8a13Swdenk prevent the check for console input. 153cc1c8a13Swdenk 154cc1c8a13Swdenk CONFIG_RESET_TO_RETRY 155cc1c8a13Swdenk 156cc1c8a13Swdenk (Only effective when CONFIG_BOOT_RETRY_TIME is also set) 157cc1c8a13Swdenk After the countdown timed out, the board will be reset to restart 158cc1c8a13Swdenk again. 159