blob: 7e2f2863d06755f77e5adfa8de84c8444538ea4e [file] [log] [blame]
Simon Glassaef523a2021-10-21 21:08:45 -06001.. SPDX-License-Identifier: GPL-2.0+
2
3Environment Variables
4=====================
5
Simon Glass420febd2021-10-21 21:08:50 -06006U-Boot supports user configuration using environment variables which
Simon Glass341c7ea2021-10-21 21:08:49 -06007can be made persistent by saving to persistent storage, for example flash
8memory.
Simon Glassaef523a2021-10-21 21:08:45 -06009
Simon Glass420febd2021-10-21 21:08:50 -060010Environment variables are set using "env set" (alias "setenv"), printed using
Simon Glass341c7ea2021-10-21 21:08:49 -060011"env print" (alias "printenv"), and saved to persistent storage using
12"env save" (alias "saveenv"). Using "env set"
Simon Glassaef523a2021-10-21 21:08:45 -060013without a value can be used to delete a variable from the
Simon Glass341c7ea2021-10-21 21:08:49 -060014environment. As long as you don't save the environment, you are
Simon Glassaef523a2021-10-21 21:08:45 -060015working with an in-memory copy. In case the Flash area containing the
16environment is erased by accident, a default environment is provided.
17
Patrick Delaunayaa5f43a2022-04-14 19:07:05 +020018See :doc:`cmd/env` for details.
19
Simon Glass341c7ea2021-10-21 21:08:49 -060020Some configuration is controlled by Environment Variables, so that setting the
21variable can adjust the behaviour of U-Boot (e.g. autoboot delay, autoloading
22from tftp).
Simon Glassaef523a2021-10-21 21:08:45 -060023
Simon Glass7327fe72021-10-21 21:08:46 -060024Text-based Environment
25----------------------
26
27The default environment for a board is created using a `.env` environment file
28using 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
31The file must be in the board directory and have a .env extension, so
32assuming that there is a board vendor, the resulting filename is therefore::
33
34 board/<vendor>/<board>/<CONFIG_ENV_SOURCE_FILE>.env
35
36or::
37
38 board/<vendor>/<board>/<CONFIG_SYS_BOARD>.env
39
40This is a plain text file where you can type your environment variables in
41the form `var=value`. Blank lines and multi-line variables are supported.
42The conversion script looks for a line that starts in column 1 with a string
43and has an equals sign immediately afterwards. Spaces before the = are not
44permitted. It is a good idea to indent your scripts so that only the 'var='
45appears at the start of a line.
46
47To add additional text to a variable you can use `var+=value`. This text is
48merged into the variable during the make process and made available as a
49single value to U-Boot. Variables can contain `+` characters but in the unlikely
50event that you want to have a variable name ending in plus, put a backslash
51before the `+` so that the script knows you are not adding to an existing
52variable but assigning to a new one::
53
54 maximum\+=value
55
56This file can include C-style comments. Blank lines and multi-line
57variables are supported, and you can use normal C preprocessor directives
58and CONFIG defines from your board config also.
59
60For example, for snapper9260 you would create a text file called
61`board/bluewater/snapper9260.env` containing the environment text.
62
63Example::
64
65 stdout=serial
Simon Glass52cb5042022-10-18 07:46:31 -060066 #ifdef CONFIG_VIDEO
Simon Glass395bcf22022-10-16 15:59:22 -060067 stdout+=,vidconsole
Simon Glass7327fe72021-10-21 21:08:46 -060068 #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
Simon Glass6fe20972023-07-30 21:01:46 -060084Settings which are common to a group of boards can use #include to bring in
85a common file in the `include/env` directory, containing environment
86settings. For example::
87
88 #include <env/ti/mmc.env>
89
Simon Glass185a4af2024-11-13 08:09:37 -070090Quotes are not suppressed, for example::
91
92 fdtfile=CONFIG_DEFAULT_DEVICE_TREE.dtb
93 # produces: fdtfile="sun7i-a20-pcduino3.dtb"
94
95For this particular issue you can use ``DEFAULT_DEVICE_TREE`` instead::
96
97 fdtfile=DEFAULT_DEVICE_TREE.dtb
98 # produces: fdtfile=sun7i-a20-pcduino3.dtb
99
100There is no general way to remove quotes.
101
Simon Glass7327fe72021-10-21 21:08:46 -0600102If CONFIG_ENV_SOURCE_FILE is empty and the default filename is not present, then
103the old-style C environment is used instead. See below.
104
105Old-style C environment
106-----------------------
107
108Traditionally, the default environment is created in `include/env_default.h`,
109and can be augmented by various `CONFIG` defines. See that file for details. In
Tom Rinic9edebe2022-12-04 10:03:50 -0500110particular you can define `CFG_EXTRA_ENV_SETTINGS` in your board file
Simon Glass7327fe72021-10-21 21:08:46 -0600111to add environment variables.
112
113Board maintainers are encouraged to migrate to the text-based environment as it
114is easier to maintain. The distro-board script still requires the old-style
Simon Glass16047dc2024-07-17 09:30:52 +0100115environments, so use :doc:`/develop/bootstd/index` instead.
Simon Glass7327fe72021-10-21 21:08:46 -0600116
117
118List of environment variables
119-----------------------------
120
Simon Glass420febd2021-10-21 21:08:50 -0600121Some device configuration options can be set using environment variables. In
122many cases the value in the default environment comes from a CONFIG option - see
Simon Glass341c7ea2021-10-21 21:08:49 -0600123`include/env_default.h`) for this.
124
Simon Glass7327fe72021-10-21 21:08:46 -0600125This is most-likely not complete:
Simon Glassaef523a2021-10-21 21:08:45 -0600126
Heinrich Schuchardtaa5ffb32022-09-10 09:16:37 +0200127autostart
128 If set to "yes" (actually any string starting with 1, y, Y, t, or T) an
129 image loaded with one of the commands listed below will be automatically
130 started by internally invoking the bootm command.
131
132 * bootelf - Boot from an ELF image in memory
133 * bootp - boot image via network using BOOTP/TFTP protocol
134 * dhcp - boot image via network using DHCP/TFTP protocol
135 * diskboot - boot from ide device
136 * nboot - boot from NAND device
137 * nfs - boot image via network using NFS protocol
138 * rarpboot - boot image via network using RARP/TFTP protocol
139 * scsiboot - boot from SCSI device
140 * tftpboot - boot image via network using TFTP protocol
141 * usbboot - boot from USB device
142
143 If the environment variable autostart is not set to a value starting with
144 1, y, Y, t, or T, an image passed to the "bootm" command will be copied to
145 the load address (and eventually uncompressed), but NOT be started.
146 This can be used to load and uncompress arbitrary data.
147
Simon Glassaef523a2021-10-21 21:08:45 -0600148baudrate
Simon Glass420febd2021-10-21 21:08:50 -0600149 Used to set the baudrate of the UART - it defaults to CONFIG_BAUDRATE (which
150 defaults to 115200).
Simon Glassaef523a2021-10-21 21:08:45 -0600151
152bootdelay
Simon Glass420febd2021-10-21 21:08:50 -0600153 Delay before automatically running bootcmd. During this time the user
154 can choose to enter the shell (or the boot menu if
155 CONFIG_AUTOBOOT_MENU_SHOW=y):
156
157 - 0 to autoboot with no delay, but you can stop it by key input.
158 - -1 to disable autoboot.
159 - -2 to autoboot with no delay and not check for abort
160
161 The default value is defined by CONFIG_BOOTDELAY.
162 The value of 'bootdelay' is overridden by the /config/bootdelay value in
163 the device-tree if CONFIG_OF_CONTROL=y.
Simon Glassaef523a2021-10-21 21:08:45 -0600164
165bootcmd
Simon Glass420febd2021-10-21 21:08:50 -0600166 The command that is run if the user does not enter the shell during the
167 boot delay.
Simon Glassaef523a2021-10-21 21:08:45 -0600168
169bootargs
Simon Glass420febd2021-10-21 21:08:50 -0600170 Command line arguments passed when booting an operating system or binary
171 image
Simon Glassaef523a2021-10-21 21:08:45 -0600172
173bootfile
174 Name of the image to load with TFTP
175
176bootm_low
177 Memory range available for image processing in the bootm
178 command can be restricted. This variable is given as
179 a hexadecimal number and defines lowest address allowed
180 for use by the bootm command. See also "bootm_size"
181 environment variable. Address defined by "bootm_low" is
182 also the base of the initial memory mapping for the Linux
Tom Rini6a5dccc2022-11-16 13:10:41 -0500183 kernel -- see the description of CFG_SYS_BOOTMAPSZ and
Simon Glassaef523a2021-10-21 21:08:45 -0600184 bootm_mapsize.
185
186bootm_mapsize
187 Size of the initial memory mapping for the Linux kernel.
188 This variable is given as a hexadecimal number and it
189 defines the size of the memory region starting at base
190 address bootm_low that is accessible by the Linux kernel
Tom Rini6a5dccc2022-11-16 13:10:41 -0500191 during early boot. If unset, CFG_SYS_BOOTMAPSZ is used
Simon Glassaef523a2021-10-21 21:08:45 -0600192 as the default value if it is defined, and bootm_size is
193 used otherwise.
194
195bootm_size
196 Memory range available for image processing in the bootm
197 command can be restricted. This variable is given as
198 a hexadecimal number and defines the size of the region
199 allowed for use by the bootm command. See also "bootm_low"
200 environment variable.
201
202bootstopkeysha256, bootdelaykey, bootstopkey
203 See README.autoboot
204
Caleb Connolly2259c292024-01-09 11:51:09 +0000205button_cmd_0, button_cmd_0_name ... button_cmd_N, button_cmd_N_name
206 Used to map commands to run when a button is held during boot.
207 See CONFIG_BUTTON_CMD.
208
Simon Glassaef523a2021-10-21 21:08:45 -0600209updatefile
210 Location of the software update file on a TFTP server, used
211 by the automatic software update feature. Please refer to
212 documentation in doc/README.update for more details.
213
214autoload
215 if set to "no" (any string beginning with 'n'),
Simon Glass420febd2021-10-21 21:08:50 -0600216 "bootp" and "dhcp" will just load perform a lookup of the
Simon Glassaef523a2021-10-21 21:08:45 -0600217 configuration from the BOOTP server, but not try to
Simon Glassd68e1652022-03-11 16:22:39 -0700218 load any image.
Simon Glassaef523a2021-10-21 21:08:45 -0600219
Simon Glassaef523a2021-10-21 21:08:45 -0600220fdt_high
221 if set this restricts the maximum address that the
222 flattened device tree will be copied into upon boot.
223 For example, if you have a system with 1 GB memory
224 at physical address 0x10000000, while Linux kernel
225 only recognizes the first 704 MB as low memory, you
226 may need to set fdt_high as 0x3C000000 to have the
227 device tree blob be copied to the maximum address
228 of the 704 MB low memory, so that Linux kernel can
229 access it during the boot procedure.
230
Simon Glass420febd2021-10-21 21:08:50 -0600231 If this is set to the special value 0xffffffff (32-bit machines) or
232 0xffffffffffffffff (64-bit machines) then
Simon Glassaef523a2021-10-21 21:08:45 -0600233 the fdt will not be copied at all on boot. For this
234 to work it must reside in writable memory, have
Michal Simek4d0837b2023-09-08 09:11:31 +0200235 sufficient padding on the end of it for U-Boot to
Simon Glassaef523a2021-10-21 21:08:45 -0600236 add the information it needs into it, and the memory
Tom Rini3c860b52022-06-20 10:31:28 -0400237 must be accessible by the kernel. This usage is strongly discouraged
238 however as it also stops U-Boot from ensuring the device tree starting
239 address is properly aligned and a misaligned tree will cause OS failures.
Simon Glassaef523a2021-10-21 21:08:45 -0600240
241fdtcontroladdr
242 if set this is the address of the control flattened
243 device tree used by U-Boot when CONFIG_OF_CONTROL is
244 defined.
245
246initrd_high
247 restrict positioning of initrd images:
248 If this variable is not set, initrd images will be
249 copied to the highest possible address in RAM; this
250 is usually what you want since it allows for
251 maximum initrd size. If for some reason you want to
252 make sure that the initrd image is loaded below the
Tom Rini6a5dccc2022-11-16 13:10:41 -0500253 CFG_SYS_BOOTMAPSZ limit, you can set this environment
Simon Glassaef523a2021-10-21 21:08:45 -0600254 variable to a value of "no" or "off" or "0".
255 Alternatively, you can set it to a maximum upper
256 address to use (U-Boot will still check that it
257 does not overwrite the U-Boot stack and data).
258
259 For instance, when you have a system with 16 MB
260 RAM, and want to reserve 4 MB from use by Linux,
261 you can do this by adding "mem=12M" to the value of
262 the "bootargs" variable. However, now you must make
263 sure that the initrd image is placed in the first
264 12 MB as well - this can be done with::
265
266 setenv initrd_high 00c00000
267
Simon Glass420febd2021-10-21 21:08:50 -0600268 If you set initrd_high to 0xffffffff (32-bit machines) or
269 0xffffffffffffffff (64-bit machines), this is an
Simon Glassaef523a2021-10-21 21:08:45 -0600270 indication to U-Boot that all addresses are legal
271 for the Linux kernel, including addresses in flash
272 memory. In this case U-Boot will NOT COPY the
273 ramdisk at all. This may be useful to reduce the
274 boot time on your system, but requires that this
Tom Rini3c860b52022-06-20 10:31:28 -0400275 feature is supported by your Linux kernel. This usage however requires
276 that the user ensure that there will be no overlap with other parts of the
277 image such as the Linux kernel BSS. It should not be enabled by default
278 and only done as part of optimizing a deployment.
Simon Glassaef523a2021-10-21 21:08:45 -0600279
280ipaddr
281 IP address; needed for tftpboot command
282
283loadaddr
284 Default load address for commands like "bootp",
Tom Rini3c860b52022-06-20 10:31:28 -0400285 "rarpboot", "tftpboot", "loadb" or "diskboot". Note that the optimal
286 default values here will vary between architectures. On 32bit ARM for
287 example, some offset from start of memory is used as the Linux kernel
288 zImage has a self decompressor and it's best if we stay out of where that
289 will be working.
Simon Glassaef523a2021-10-21 21:08:45 -0600290
291loads_echo
292 see CONFIG_LOADS_ECHO
293
294serverip
295 TFTP server IP address; needed for tftpboot command
296
297bootretry
298 see CONFIG_BOOT_RETRY_TIME
299
300bootdelaykey
301 see CONFIG_AUTOBOOT_DELAY_STR
302
303bootstopkey
304 see CONFIG_AUTOBOOT_STOP_STR
305
306ethprime
Simon Glass420febd2021-10-21 21:08:50 -0600307 controls which network interface is used first.
Simon Glassaef523a2021-10-21 21:08:45 -0600308
309ethact
310 controls which interface is currently active.
311 For example you can do the following::
312
313 => setenv ethact FEC
314 => ping 192.168.0.1 # traffic sent on FEC
315 => setenv ethact SCC
316 => ping 10.0.0.1 # traffic sent on SCC
317
318ethrotate
319 When set to "no" U-Boot does not go through all
320 available network interfaces.
Simon Glass420febd2021-10-21 21:08:50 -0600321 It just stays at the currently selected interface. When unset or set to
322 anything other than "no", U-Boot does go through all
323 available network interfaces.
Simon Glassaef523a2021-10-21 21:08:45 -0600324
Marek Vasut22a95082023-12-13 22:11:13 +0100325httpdstp
326 If this is set, the value is used for HTTP's TCP
327 destination port instead of the default port 80.
328
Simon Glassaef523a2021-10-21 21:08:45 -0600329netretry
330 When set to "no" each network operation will
331 either succeed or fail without retrying.
332 When set to "once" the network operation will
333 fail when all the available network interfaces
334 are tried once without success.
335 Useful on scripts which control the retry operation
336 themselves.
337
Alex Shumskydaef5ee2024-10-16 13:02:03 +0300338rng_seed_size
339 Size of random value added to device-tree node /chosen/rng-seed.
340 This variable is given as a decimal number.
341 If unset, 64 bytes is used as the default.
342
Simon Glassaef523a2021-10-21 21:08:45 -0600343silent_linux
344 If set then Linux will be told to boot silently, by
Simon Glass420febd2021-10-21 21:08:50 -0600345 adding 'console=' to its command line. If "yes" it will be
Simon Glassaef523a2021-10-21 21:08:45 -0600346 made silent. If "no" it will not be made silent. If
347 unset, then it will be made silent if the U-Boot console
348 is silent.
349
350tftpsrcp
351 If this is set, the value is used for TFTP's
352 UDP source port.
353
354tftpdstp
355 If this is set, the value is used for TFTP's UDP
Simon Glass420febd2021-10-21 21:08:50 -0600356 destination port instead of the default port 69.
Simon Glassaef523a2021-10-21 21:08:45 -0600357
358tftpblocksize
359 Block size to use for TFTP transfers; if not set,
360 we use the TFTP server's default block size
361
362tftptimeout
363 Retransmission timeout for TFTP packets (in milli-
364 seconds, minimum value is 1000 = 1 second). Defines
365 when a packet is considered to be lost so it has to
366 be retransmitted. The default is 5000 = 5 seconds.
367 Lowering this value may make downloads succeed
368 faster in networks with high packet loss rates or
369 with unreliable TFTP servers.
370
371tftptimeoutcountmax
372 maximum count of TFTP timeouts (no
373 unit, minimum value = 0). Defines how many timeouts
374 can happen during a single file transfer before that
375 transfer is aborted. The default is 10, and 0 means
376 'no timeouts allowed'. Increasing this value may help
377 downloads succeed with high packet loss rates, or with
378 unreliable TFTP servers or client hardware.
379
380tftpwindowsize
381 if this is set, the value is used for TFTP's
382 window size as described by RFC 7440.
383 This means the count of blocks we can receive before
384 sending ack to server.
385
Janne Grunau176e8f02024-04-04 08:25:52 +0200386usb_ignorelist
387 Ignore USB devices to prevent binding them to an USB device driver. This can
388 be used to ignore devices are for some reason undesirable or causes crashes
389 u-boot's USB stack.
390 An example for undesired behavior is the keyboard emulation of security keys
391 like Yubikeys. U-boot currently supports only a single USB keyboard device
392 so try to probe an useful keyboard device. The default environment blocks
393 Yubico devices as common devices emulating keyboards.
394 Devices are matched by idVendor and idProduct. The variable contains a comma
395 separated list of idVendor:idProduct pairs as hexadecimal numbers joined
396 by a colon. '*' functions as a wildcard for idProduct to block all devices
397 with the specified idVendor.
398
Simon Glassaef523a2021-10-21 21:08:45 -0600399vlan
400 When set to a value < 4095 the traffic over
401 Ethernet is encapsulated/received over 802.1q
402 VLAN tagged frames.
403
Simon Glass341c7ea2021-10-21 21:08:49 -0600404 Note: This appears not to be used in U-Boot. See `README.VLAN`.
405
Simon Glassaef523a2021-10-21 21:08:45 -0600406bootpretryperiod
407 Period during which BOOTP/DHCP sends retries.
408 Unsigned value, in milliseconds. If not set, the period will
409 be either the default (28000), or a value based on
410 CONFIG_NET_RETRY_COUNT, if defined. This value has
Chris Packham291f7312022-05-25 13:08:51 +1200411 precedence over the value based on CONFIG_NET_RETRY_COUNT.
Simon Glassaef523a2021-10-21 21:08:45 -0600412
413memmatches
414 Number of matches found by the last 'ms' command, in hex
415
416memaddr
417 Address of the last match found by the 'ms' command, in hex,
418 or 0 if none
419
420mempos
421 Index position of the last match found by the 'ms' command,
422 in units of the size (.b, .w, .l) of the search
423
424zbootbase
425 (x86 only) Base address of the bzImage 'setup' block
426
427zbootaddr
428 (x86 only) Address of the loaded bzImage, typically
429 BZIMAGE_LOAD_ADDR which is 0x100000
430
431
432Image locations
433---------------
434
435The following image location variables contain the location of images
436used in booting. The "Image" column gives the role of the image and is
437not an environment variable name. The other columns are environment
438variable names. "File Name" gives the name of the file on a TFTP
439server, "RAM Address" gives the location in RAM the image will be
440loaded to, and "Flash Location" gives the image's address in NOR
441flash or offset in NAND flash.
442
443*Note* - these variables don't have to be defined for all boards, some
444boards currently use other variables for these purposes, and some
445boards use these variables for other purposes.
446
Simon Glass341c7ea2021-10-21 21:08:49 -0600447Also note that most of these variables are just a commonly used set of variable
448names, used in some other variable definitions, but are not hard-coded anywhere
449in U-Boot code.
450
Simon Glassaef523a2021-10-21 21:08:45 -0600451================= ============== ================ ==============
452Image File Name RAM Address Flash Location
453================= ============== ================ ==============
Simon Glassaef523a2021-10-21 21:08:45 -0600454Linux kernel bootfile kernel_addr_r kernel_addr
455device tree blob fdtfile fdt_addr_r fdt_addr
456ramdisk ramdiskfile ramdisk_addr_r ramdisk_addr
457================= ============== ================ ==============
458
Tom Rini4e2630e2022-07-11 14:32:13 -0400459When setting the RAM addresses for `kernel_addr_r`, `fdt_addr_r` and
460`ramdisk_addr_r` there are several types of constraints to keep in mind. The
461one type of constraint is payload requirement. For example, a device tree MUST
462be loaded at an 8-byte aligned address as that is what the specification
463requires. In a similar manner, the operating system may define restrictions on
464where in memory space payloads can be. This is documented for example in Linux,
465with both the `Booting ARM Linux`_ and `Booting AArch64 Linux`_ documents.
466Finally, there are practical constraints. We do not know the size of a given
467payload a user will use but each payload must not overlap or it will corrupt
468the other payload. A similar problem can happen when a payload ends up being in
469the OS BSS area. For these reasons we need to ensure our default values here
470are both unlikely to lead to failure to boot and sufficiently explained so that
471they can be optimized for boot time or adjusted for smaller memory
472configurations.
473
474On different architectures we will have different constraints. It is important
475that we follow whatever documented requirements are available to best ensure
476forward compatibility. What follows are examples to highlight how to provide
477reasonable default values in different cases.
478
479Texas Instruments OMAP2PLUS (ARMv7) example
480^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
481
482On these families of processors we are on a 32bit ARMv7 core. As booting some
483form of Linux is our most common payload we will also keep in mind the
484documented requirements for booting that Linux provides. These values are also
485known to be fine for booting a number of other operating systems (or their
486loaders). In this example we define the following variables and values::
487
488 loadaddr=0x82000000
489 kernel_addr_r=${loadaddr}
490 fdt_addr_r=0x88000000
491 ramdisk_addr_r=0x88080000
492 bootm_size=0x10000000
493
494The first thing to keep in mind is that DRAM starts at 0x80000000. We set a
49532MiB buffer from the start of memory as our default load address and set
496``kernel_addr_r`` to that. This is because the Linux ``zImage`` decompressor
497will typically then be able to avoid doing a relocation itself. It also MUST be
498within the first 128MiB of memory. The next value is we set ``fdt_addr_r`` to
499be at 128MiB offset from the start of memory. This location is suggested by the
500kernel documentation and is exceedingly unlikely to be overwritten by the
501kernel itself given other architectural constraints. We then allow for the
502device tree to be up to 512KiB in size before placing the ramdisk in memory. We
503then say that everything should be within the first 256MiB of memory so that
504U-Boot can relocate things as needed to ensure proper alignment. We pick 256MiB
505as our value here because we know there are very few platforms on in this
506family with less memory. It could be as high as 768MiB and still ensure that
507everything would be visible to the kernel, but again we go with what we assume
508is the safest assumption.
Simon Glassaef523a2021-10-21 21:08:45 -0600509
510Automatically updated variables
511-------------------------------
512
513The following environment variables may be used and automatically
Jerome Forissierf5fb87e2024-12-03 14:50:51 +0100514updated by the network boot commands ("bootp", "dhcp" and "rarpboot"),
Simon Glassaef523a2021-10-21 21:08:45 -0600515depending the information provided by your boot server:
516
Jerome Forissierf5fb87e2024-12-03 14:50:51 +0100517========== ===================================================================
Simon Glassaef523a2021-10-21 21:08:45 -0600518Variable Notes
Jerome Forissierf5fb87e2024-12-03 14:50:51 +0100519========== ===================================================================
Simon Glassaef523a2021-10-21 21:08:45 -0600520bootfile see above
521dnsip IP address of your Domain Name Server
522dnsip2 IP address of your secondary Domain Name Server
523gatewayip IP address of the Gateway (Router) to use
524hostname Target hostname
525ipaddr See above
526netmask Subnet Mask
527rootpath Pathname of the root filesystem on the NFS server
528serverip see above
Jerome Forissierf5fb87e2024-12-03 14:50:51 +0100529ipaddrN IP address for interface N (>0) (NET_LWIP dhcp only)
530netmaskN Subnet mask for interface N (>0) (NET_LWIP dhcp only)
531gatewayipN IP address of the Gateway for interface N (>0) (NET_LWIP dhcp only)
532========== ===================================================================
Simon Glassaef523a2021-10-21 21:08:45 -0600533
534
535Special environment variables
536-----------------------------
537
538There are two special Environment Variables:
539
540serial#
541 contains hardware identification information such as type string and/or
542 serial number
543ethaddr
Simon Glass420febd2021-10-21 21:08:50 -0600544 Ethernet address. If CONFIG_REGEX=y, also eth*addr (where * is an integer).
Simon Glassaef523a2021-10-21 21:08:45 -0600545
546These variables can be set only once (usually during manufacturing of
547the board). U-Boot refuses to delete or overwrite these variables
Simon Glass420febd2021-10-21 21:08:50 -0600548once they have been set, unless CONFIG_ENV_OVERWRITE is enabled in the board
549configuration.
Simon Glassaef523a2021-10-21 21:08:45 -0600550
551Also:
552
553ver
554 Contains the U-Boot version string as printed
555 with the "version" command. This variable is
556 readonly (see CONFIG_VERSION_VARIABLE).
557
558Please note that changes to some configuration parameters may take
Simon Glass420febd2021-10-21 21:08:50 -0600559only effect after the next boot (yes, that's just like Windows).
Simon Glassaef523a2021-10-21 21:08:45 -0600560
Simon Glass9f3a7bf2021-10-21 21:08:48 -0600561
562External environment file
563-------------------------
564
565The `CONFIG_USE_DEFAULT_ENV_FILE` option provides a way to bypass the
566environment generation in U-Boot. If enabled, then `CONFIG_DEFAULT_ENV_FILE`
567provides the name of a file which is converted into the environment,
568completely bypassing the standard environment variables in `env_default.h`.
569
570The format is the same as accepted by the mkenvimage tool, with lines containing
571key=value pairs. Blank lines and lines beginning with # are ignored.
572
573Future work may unify this feature with the text-based environment, perhaps
574moving the contents of `env_default.h` to a text file.
Simon Glass420febd2021-10-21 21:08:50 -0600575
576Implementation
577--------------
578
579See :doc:`../develop/environment` for internal development details.
Tom Rini4e2630e2022-07-11 14:32:13 -0400580
581.. _`Booting ARM Linux`: https://www.kernel.org/doc/html/latest/arm/booting.html
582.. _`Booting AArch64 Linux`: https://www.kernel.org/doc/html/latest/arm64/booting.html