Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | Environment Variables |
| 4 | ===================== |
| 5 | |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 6 | U-Boot supports user configuration using environment variables which |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 7 | can be made persistent by saving to persistent storage, for example flash |
| 8 | memory. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 9 | |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 10 | Environment variables are set using "env set" (alias "setenv"), printed using |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 11 | "env print" (alias "printenv"), and saved to persistent storage using |
| 12 | "env save" (alias "saveenv"). Using "env set" |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 13 | without a value can be used to delete a variable from the |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 14 | environment. As long as you don't save the environment, you are |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 15 | working with an in-memory copy. In case the Flash area containing the |
| 16 | environment is erased by accident, a default environment is provided. |
| 17 | |
Patrick Delaunay | aa5f43a | 2022-04-14 19:07:05 +0200 | [diff] [blame] | 18 | See :doc:`cmd/env` for details. |
| 19 | |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 20 | Some configuration is controlled by Environment Variables, so that setting the |
| 21 | variable can adjust the behaviour of U-Boot (e.g. autoboot delay, autoloading |
| 22 | from tftp). |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 23 | |
Simon Glass | 7327fe7 | 2021-10-21 21:08:46 -0600 | [diff] [blame] | 24 | Text-based Environment |
| 25 | ---------------------- |
| 26 | |
| 27 | The default environment for a board is created using a `.env` environment file |
| 28 | using a simple text format. The base filename for this is defined by |
| 29 | `CONFIG_ENV_SOURCE_FILE`, or `CONFIG_SYS_BOARD` if that is empty. |
| 30 | |
| 31 | The file must be in the board directory and have a .env extension, so |
| 32 | assuming that there is a board vendor, the resulting filename is therefore:: |
| 33 | |
| 34 | board/<vendor>/<board>/<CONFIG_ENV_SOURCE_FILE>.env |
| 35 | |
| 36 | or:: |
| 37 | |
| 38 | board/<vendor>/<board>/<CONFIG_SYS_BOARD>.env |
| 39 | |
| 40 | This is a plain text file where you can type your environment variables in |
| 41 | the form `var=value`. Blank lines and multi-line variables are supported. |
| 42 | The conversion script looks for a line that starts in column 1 with a string |
| 43 | and has an equals sign immediately afterwards. Spaces before the = are not |
| 44 | permitted. It is a good idea to indent your scripts so that only the 'var=' |
| 45 | appears at the start of a line. |
| 46 | |
| 47 | To add additional text to a variable you can use `var+=value`. This text is |
| 48 | merged into the variable during the make process and made available as a |
| 49 | single value to U-Boot. Variables can contain `+` characters but in the unlikely |
| 50 | event that you want to have a variable name ending in plus, put a backslash |
| 51 | before the `+` so that the script knows you are not adding to an existing |
| 52 | variable but assigning to a new one:: |
| 53 | |
| 54 | maximum\+=value |
| 55 | |
| 56 | This file can include C-style comments. Blank lines and multi-line |
| 57 | variables are supported, and you can use normal C preprocessor directives |
| 58 | and CONFIG defines from your board config also. |
| 59 | |
| 60 | For example, for snapper9260 you would create a text file called |
| 61 | `board/bluewater/snapper9260.env` containing the environment text. |
| 62 | |
| 63 | Example:: |
| 64 | |
| 65 | stdout=serial |
| 66 | #ifdef CONFIG_LCD |
| 67 | stdout+=,lcd |
| 68 | #endif |
| 69 | bootcmd= |
| 70 | /* U-Boot script for booting */ |
| 71 | |
| 72 | if [ -z ${tftpserverip} ]; then |
| 73 | echo "Use 'setenv tftpserverip a.b.c.d' to set IP address." |
| 74 | fi |
| 75 | |
| 76 | usb start; setenv autoload n; bootp; |
| 77 | tftpboot ${tftpserverip}: |
| 78 | bootm |
| 79 | failed= |
| 80 | /* Print a message when boot fails */ |
| 81 | echo CONFIG_SYS_BOARD boot failed - please check your image |
| 82 | echo Load address is CONFIG_SYS_LOAD_ADDR |
| 83 | |
| 84 | If CONFIG_ENV_SOURCE_FILE is empty and the default filename is not present, then |
| 85 | the old-style C environment is used instead. See below. |
| 86 | |
| 87 | Old-style C environment |
| 88 | ----------------------- |
| 89 | |
| 90 | Traditionally, the default environment is created in `include/env_default.h`, |
| 91 | and can be augmented by various `CONFIG` defines. See that file for details. In |
| 92 | particular you can define `CONFIG_EXTRA_ENV_SETTINGS` in your board file |
| 93 | to add environment variables. |
| 94 | |
| 95 | Board maintainers are encouraged to migrate to the text-based environment as it |
| 96 | is easier to maintain. The distro-board script still requires the old-style |
| 97 | environment but work is underway to address this. |
| 98 | |
| 99 | |
| 100 | List of environment variables |
| 101 | ----------------------------- |
| 102 | |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 103 | Some device configuration options can be set using environment variables. In |
| 104 | many cases the value in the default environment comes from a CONFIG option - see |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 105 | `include/env_default.h`) for this. |
| 106 | |
Simon Glass | 7327fe7 | 2021-10-21 21:08:46 -0600 | [diff] [blame] | 107 | This is most-likely not complete: |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 108 | |
| 109 | baudrate |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 110 | Used to set the baudrate of the UART - it defaults to CONFIG_BAUDRATE (which |
| 111 | defaults to 115200). |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 112 | |
| 113 | bootdelay |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 114 | Delay before automatically running bootcmd. During this time the user |
| 115 | can choose to enter the shell (or the boot menu if |
| 116 | CONFIG_AUTOBOOT_MENU_SHOW=y): |
| 117 | |
| 118 | - 0 to autoboot with no delay, but you can stop it by key input. |
| 119 | - -1 to disable autoboot. |
| 120 | - -2 to autoboot with no delay and not check for abort |
| 121 | |
| 122 | The default value is defined by CONFIG_BOOTDELAY. |
| 123 | The value of 'bootdelay' is overridden by the /config/bootdelay value in |
| 124 | the device-tree if CONFIG_OF_CONTROL=y. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 125 | |
| 126 | bootcmd |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 127 | The command that is run if the user does not enter the shell during the |
| 128 | boot delay. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 129 | |
| 130 | bootargs |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 131 | Command line arguments passed when booting an operating system or binary |
| 132 | image |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 133 | |
| 134 | bootfile |
| 135 | Name of the image to load with TFTP |
| 136 | |
| 137 | bootm_low |
| 138 | Memory range available for image processing in the bootm |
| 139 | command can be restricted. This variable is given as |
| 140 | a hexadecimal number and defines lowest address allowed |
| 141 | for use by the bootm command. See also "bootm_size" |
| 142 | environment variable. Address defined by "bootm_low" is |
| 143 | also the base of the initial memory mapping for the Linux |
| 144 | kernel -- see the description of CONFIG_SYS_BOOTMAPSZ and |
| 145 | bootm_mapsize. |
| 146 | |
| 147 | bootm_mapsize |
| 148 | Size of the initial memory mapping for the Linux kernel. |
| 149 | This variable is given as a hexadecimal number and it |
| 150 | defines the size of the memory region starting at base |
| 151 | address bootm_low that is accessible by the Linux kernel |
| 152 | during early boot. If unset, CONFIG_SYS_BOOTMAPSZ is used |
| 153 | as the default value if it is defined, and bootm_size is |
| 154 | used otherwise. |
| 155 | |
| 156 | bootm_size |
| 157 | Memory range available for image processing in the bootm |
| 158 | command can be restricted. This variable is given as |
| 159 | a hexadecimal number and defines the size of the region |
| 160 | allowed for use by the bootm command. See also "bootm_low" |
| 161 | environment variable. |
| 162 | |
| 163 | bootstopkeysha256, bootdelaykey, bootstopkey |
| 164 | See README.autoboot |
| 165 | |
| 166 | updatefile |
| 167 | Location of the software update file on a TFTP server, used |
| 168 | by the automatic software update feature. Please refer to |
| 169 | documentation in doc/README.update for more details. |
| 170 | |
| 171 | autoload |
| 172 | if set to "no" (any string beginning with 'n'), |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 173 | "bootp" and "dhcp" will just load perform a lookup of the |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 174 | configuration from the BOOTP server, but not try to |
Simon Glass | d68e165 | 2022-03-11 16:22:39 -0700 | [diff] [blame] | 175 | load any image. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 176 | |
| 177 | autostart |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 178 | if set to "yes", an image loaded using the "bootp", "dhcp", |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 179 | "rarpboot", "tftpboot" or "diskboot" commands will |
| 180 | be automatically started (by internally calling |
| 181 | "bootm") |
| 182 | |
Simon Glass | 46b530a | 2021-10-21 21:08:52 -0600 | [diff] [blame] | 183 | If unset, or set to "1"/"yes"/"true" (case insensitive, just the first |
| 184 | character is enough), a standalone image |
| 185 | passed to the "bootm" command will be copied to the load address |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 186 | (and eventually uncompressed), but NOT be started. |
| 187 | This can be used to load and uncompress arbitrary |
| 188 | data. |
| 189 | |
| 190 | fdt_high |
| 191 | if set this restricts the maximum address that the |
| 192 | flattened device tree will be copied into upon boot. |
| 193 | For example, if you have a system with 1 GB memory |
| 194 | at physical address 0x10000000, while Linux kernel |
| 195 | only recognizes the first 704 MB as low memory, you |
| 196 | may need to set fdt_high as 0x3C000000 to have the |
| 197 | device tree blob be copied to the maximum address |
| 198 | of the 704 MB low memory, so that Linux kernel can |
| 199 | access it during the boot procedure. |
| 200 | |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 201 | If this is set to the special value 0xffffffff (32-bit machines) or |
| 202 | 0xffffffffffffffff (64-bit machines) then |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 203 | the fdt will not be copied at all on boot. For this |
| 204 | to work it must reside in writable memory, have |
| 205 | sufficient padding on the end of it for u-boot to |
| 206 | add the information it needs into it, and the memory |
Tom Rini | 3c860b5 | 2022-06-20 10:31:28 -0400 | [diff] [blame] | 207 | must be accessible by the kernel. This usage is strongly discouraged |
| 208 | however as it also stops U-Boot from ensuring the device tree starting |
| 209 | address is properly aligned and a misaligned tree will cause OS failures. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 210 | |
| 211 | fdtcontroladdr |
| 212 | if set this is the address of the control flattened |
| 213 | device tree used by U-Boot when CONFIG_OF_CONTROL is |
| 214 | defined. |
| 215 | |
| 216 | initrd_high |
| 217 | restrict positioning of initrd images: |
| 218 | If this variable is not set, initrd images will be |
| 219 | copied to the highest possible address in RAM; this |
| 220 | is usually what you want since it allows for |
| 221 | maximum initrd size. If for some reason you want to |
| 222 | make sure that the initrd image is loaded below the |
| 223 | CONFIG_SYS_BOOTMAPSZ limit, you can set this environment |
| 224 | variable to a value of "no" or "off" or "0". |
| 225 | Alternatively, you can set it to a maximum upper |
| 226 | address to use (U-Boot will still check that it |
| 227 | does not overwrite the U-Boot stack and data). |
| 228 | |
| 229 | For instance, when you have a system with 16 MB |
| 230 | RAM, and want to reserve 4 MB from use by Linux, |
| 231 | you can do this by adding "mem=12M" to the value of |
| 232 | the "bootargs" variable. However, now you must make |
| 233 | sure that the initrd image is placed in the first |
| 234 | 12 MB as well - this can be done with:: |
| 235 | |
| 236 | setenv initrd_high 00c00000 |
| 237 | |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 238 | If you set initrd_high to 0xffffffff (32-bit machines) or |
| 239 | 0xffffffffffffffff (64-bit machines), this is an |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 240 | indication to U-Boot that all addresses are legal |
| 241 | for the Linux kernel, including addresses in flash |
| 242 | memory. In this case U-Boot will NOT COPY the |
| 243 | ramdisk at all. This may be useful to reduce the |
| 244 | boot time on your system, but requires that this |
Tom Rini | 3c860b5 | 2022-06-20 10:31:28 -0400 | [diff] [blame] | 245 | feature is supported by your Linux kernel. This usage however requires |
| 246 | that the user ensure that there will be no overlap with other parts of the |
| 247 | image such as the Linux kernel BSS. It should not be enabled by default |
| 248 | and only done as part of optimizing a deployment. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 249 | |
| 250 | ipaddr |
| 251 | IP address; needed for tftpboot command |
| 252 | |
| 253 | loadaddr |
| 254 | Default load address for commands like "bootp", |
Tom Rini | 3c860b5 | 2022-06-20 10:31:28 -0400 | [diff] [blame] | 255 | "rarpboot", "tftpboot", "loadb" or "diskboot". Note that the optimal |
| 256 | default values here will vary between architectures. On 32bit ARM for |
| 257 | example, some offset from start of memory is used as the Linux kernel |
| 258 | zImage has a self decompressor and it's best if we stay out of where that |
| 259 | will be working. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 260 | |
| 261 | loads_echo |
| 262 | see CONFIG_LOADS_ECHO |
| 263 | |
| 264 | serverip |
| 265 | TFTP server IP address; needed for tftpboot command |
| 266 | |
| 267 | bootretry |
| 268 | see CONFIG_BOOT_RETRY_TIME |
| 269 | |
| 270 | bootdelaykey |
| 271 | see CONFIG_AUTOBOOT_DELAY_STR |
| 272 | |
| 273 | bootstopkey |
| 274 | see CONFIG_AUTOBOOT_STOP_STR |
| 275 | |
| 276 | ethprime |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 277 | controls which network interface is used first. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 278 | |
| 279 | ethact |
| 280 | controls which interface is currently active. |
| 281 | For example you can do the following:: |
| 282 | |
| 283 | => setenv ethact FEC |
| 284 | => ping 192.168.0.1 # traffic sent on FEC |
| 285 | => setenv ethact SCC |
| 286 | => ping 10.0.0.1 # traffic sent on SCC |
| 287 | |
| 288 | ethrotate |
| 289 | When set to "no" U-Boot does not go through all |
| 290 | available network interfaces. |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 291 | It just stays at the currently selected interface. When unset or set to |
| 292 | anything other than "no", U-Boot does go through all |
| 293 | available network interfaces. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 294 | |
| 295 | netretry |
| 296 | When set to "no" each network operation will |
| 297 | either succeed or fail without retrying. |
| 298 | When set to "once" the network operation will |
| 299 | fail when all the available network interfaces |
| 300 | are tried once without success. |
| 301 | Useful on scripts which control the retry operation |
| 302 | themselves. |
| 303 | |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 304 | silent_linux |
| 305 | If set then Linux will be told to boot silently, by |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 306 | adding 'console=' to its command line. If "yes" it will be |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 307 | made silent. If "no" it will not be made silent. If |
| 308 | unset, then it will be made silent if the U-Boot console |
| 309 | is silent. |
| 310 | |
| 311 | tftpsrcp |
| 312 | If this is set, the value is used for TFTP's |
| 313 | UDP source port. |
| 314 | |
| 315 | tftpdstp |
| 316 | If this is set, the value is used for TFTP's UDP |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 317 | destination port instead of the default port 69. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 318 | |
| 319 | tftpblocksize |
| 320 | Block size to use for TFTP transfers; if not set, |
| 321 | we use the TFTP server's default block size |
| 322 | |
| 323 | tftptimeout |
| 324 | Retransmission timeout for TFTP packets (in milli- |
| 325 | seconds, minimum value is 1000 = 1 second). Defines |
| 326 | when a packet is considered to be lost so it has to |
| 327 | be retransmitted. The default is 5000 = 5 seconds. |
| 328 | Lowering this value may make downloads succeed |
| 329 | faster in networks with high packet loss rates or |
| 330 | with unreliable TFTP servers. |
| 331 | |
| 332 | tftptimeoutcountmax |
| 333 | maximum count of TFTP timeouts (no |
| 334 | unit, minimum value = 0). Defines how many timeouts |
| 335 | can happen during a single file transfer before that |
| 336 | transfer is aborted. The default is 10, and 0 means |
| 337 | 'no timeouts allowed'. Increasing this value may help |
| 338 | downloads succeed with high packet loss rates, or with |
| 339 | unreliable TFTP servers or client hardware. |
| 340 | |
| 341 | tftpwindowsize |
| 342 | if this is set, the value is used for TFTP's |
| 343 | window size as described by RFC 7440. |
| 344 | This means the count of blocks we can receive before |
| 345 | sending ack to server. |
| 346 | |
| 347 | vlan |
| 348 | When set to a value < 4095 the traffic over |
| 349 | Ethernet is encapsulated/received over 802.1q |
| 350 | VLAN tagged frames. |
| 351 | |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 352 | Note: This appears not to be used in U-Boot. See `README.VLAN`. |
| 353 | |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 354 | bootpretryperiod |
| 355 | Period during which BOOTP/DHCP sends retries. |
| 356 | Unsigned value, in milliseconds. If not set, the period will |
| 357 | be either the default (28000), or a value based on |
| 358 | CONFIG_NET_RETRY_COUNT, if defined. This value has |
Chris Packham | 291f731 | 2022-05-25 13:08:51 +1200 | [diff] [blame] | 359 | precedence over the value based on CONFIG_NET_RETRY_COUNT. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 360 | |
| 361 | memmatches |
| 362 | Number of matches found by the last 'ms' command, in hex |
| 363 | |
| 364 | memaddr |
| 365 | Address of the last match found by the 'ms' command, in hex, |
| 366 | or 0 if none |
| 367 | |
| 368 | mempos |
| 369 | Index position of the last match found by the 'ms' command, |
| 370 | in units of the size (.b, .w, .l) of the search |
| 371 | |
| 372 | zbootbase |
| 373 | (x86 only) Base address of the bzImage 'setup' block |
| 374 | |
| 375 | zbootaddr |
| 376 | (x86 only) Address of the loaded bzImage, typically |
| 377 | BZIMAGE_LOAD_ADDR which is 0x100000 |
| 378 | |
| 379 | |
| 380 | Image locations |
| 381 | --------------- |
| 382 | |
| 383 | The following image location variables contain the location of images |
| 384 | used in booting. The "Image" column gives the role of the image and is |
| 385 | not an environment variable name. The other columns are environment |
| 386 | variable names. "File Name" gives the name of the file on a TFTP |
| 387 | server, "RAM Address" gives the location in RAM the image will be |
| 388 | loaded to, and "Flash Location" gives the image's address in NOR |
| 389 | flash or offset in NAND flash. |
| 390 | |
| 391 | *Note* - these variables don't have to be defined for all boards, some |
| 392 | boards currently use other variables for these purposes, and some |
| 393 | boards use these variables for other purposes. |
| 394 | |
Simon Glass | 341c7ea | 2021-10-21 21:08:49 -0600 | [diff] [blame] | 395 | Also note that most of these variables are just a commonly used set of variable |
| 396 | names, used in some other variable definitions, but are not hard-coded anywhere |
| 397 | in U-Boot code. |
| 398 | |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 399 | ================= ============== ================ ============== |
| 400 | Image File Name RAM Address Flash Location |
| 401 | ================= ============== ================ ============== |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 402 | Linux kernel bootfile kernel_addr_r kernel_addr |
| 403 | device tree blob fdtfile fdt_addr_r fdt_addr |
| 404 | ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr |
| 405 | ================= ============== ================ ============== |
| 406 | |
| 407 | |
| 408 | Automatically updated variables |
| 409 | ------------------------------- |
| 410 | |
| 411 | The following environment variables may be used and automatically |
| 412 | updated by the network boot commands ("bootp" and "rarpboot"), |
| 413 | depending the information provided by your boot server: |
| 414 | |
| 415 | ========= =================================================== |
| 416 | Variable Notes |
| 417 | ========= =================================================== |
| 418 | bootfile see above |
| 419 | dnsip IP address of your Domain Name Server |
| 420 | dnsip2 IP address of your secondary Domain Name Server |
| 421 | gatewayip IP address of the Gateway (Router) to use |
| 422 | hostname Target hostname |
| 423 | ipaddr See above |
| 424 | netmask Subnet Mask |
| 425 | rootpath Pathname of the root filesystem on the NFS server |
| 426 | serverip see above |
| 427 | ========= =================================================== |
| 428 | |
| 429 | |
| 430 | Special environment variables |
| 431 | ----------------------------- |
| 432 | |
| 433 | There are two special Environment Variables: |
| 434 | |
| 435 | serial# |
| 436 | contains hardware identification information such as type string and/or |
| 437 | serial number |
| 438 | ethaddr |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 439 | Ethernet address. If CONFIG_REGEX=y, also eth*addr (where * is an integer). |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 440 | |
| 441 | These variables can be set only once (usually during manufacturing of |
| 442 | the board). U-Boot refuses to delete or overwrite these variables |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 443 | once they have been set, unless CONFIG_ENV_OVERWRITE is enabled in the board |
| 444 | configuration. |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 445 | |
| 446 | Also: |
| 447 | |
| 448 | ver |
| 449 | Contains the U-Boot version string as printed |
| 450 | with the "version" command. This variable is |
| 451 | readonly (see CONFIG_VERSION_VARIABLE). |
| 452 | |
| 453 | Please note that changes to some configuration parameters may take |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 454 | only effect after the next boot (yes, that's just like Windows). |
Simon Glass | aef523a | 2021-10-21 21:08:45 -0600 | [diff] [blame] | 455 | |
Simon Glass | 9f3a7bf | 2021-10-21 21:08:48 -0600 | [diff] [blame] | 456 | |
| 457 | External environment file |
| 458 | ------------------------- |
| 459 | |
| 460 | The `CONFIG_USE_DEFAULT_ENV_FILE` option provides a way to bypass the |
| 461 | environment generation in U-Boot. If enabled, then `CONFIG_DEFAULT_ENV_FILE` |
| 462 | provides the name of a file which is converted into the environment, |
| 463 | completely bypassing the standard environment variables in `env_default.h`. |
| 464 | |
| 465 | The format is the same as accepted by the mkenvimage tool, with lines containing |
| 466 | key=value pairs. Blank lines and lines beginning with # are ignored. |
| 467 | |
| 468 | Future work may unify this feature with the text-based environment, perhaps |
| 469 | moving the contents of `env_default.h` to a text file. |
Simon Glass | 420febd | 2021-10-21 21:08:50 -0600 | [diff] [blame] | 470 | |
| 471 | Implementation |
| 472 | -------------- |
| 473 | |
| 474 | See :doc:`../develop/environment` for internal development details. |