README.autoboot 6.1 KB

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