- USB Device:
Define the below if you wish to use the USB console.
Once firmware is rebuilt from a serial console issue the
- command "setenv stdin usbtty; setenv stdout usbtty" and
+ command "env set stdin usbtty; env set stdout usbtty" and
attach your USB cable. The Unix command "dmesg" should print
it has found a new device. The environment variable usbtty
can be set to gserial or cdc_acm to enable your device to
remaining RAM in a form that can be passed as boot
argument to Linux, for instance like that:
- setenv bootargs ... mem=\${mem}
+ env set bootargs ... mem=\${mem}
saveenv
This way you can tell Linux not to use this memory,
directly type `$name' at the command prompt.
Global environment variables are those you use
- setenv/printenv to work with. To run a command stored
+ env set/printenv to work with. To run a command stored
in such a variable, you need to use the run command,
and you must not use the '$' sign to access them.
memory (RAM or Flash). In case of a Linux kernel image, the contents
of the "bootargs" environment variable is passed to the kernel as
parameters. You can check and modify this variable using the
-"printenv" and "setenv" commands:
+"printenv" and "env set" commands:
=> printenv bootargs
bootargs=root=/dev/ram
- => setenv bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
+ => env set bootargs root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
=> printenv bootargs
bootargs=root=/dev/nfs rw nfsroot=10.0.0.2:/LinuxPPC nfsaddrs=10.0.0.99:10.0.0.2
assigning its name to the corresponding environment variable. For
example:
- setenv stdin serial <- To use the serial input
- setenv stdout video <- To use the video console
+ env set stdin serial <- To use the serial input
+ env set stdout video <- To use the video console
Do a simple "saveenv" to save the console settings in the environment
and get them working on the next startup, too.
"hwconfig=fsl_ddr:ctlr_intlv=bank" \
......
-2. Run U-Boot "setenv" command to configure the memory interleaving mode.
+2. Run U-Boot "env set" command to configure the memory interleaving mode.
Either numerical or string value is accepted.
# disable memory controller interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=null"
+ env set hwconfig "fsl_ddr:ctlr_intlv=null"
# cacheline interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=cacheline"
+ env set hwconfig "fsl_ddr:ctlr_intlv=cacheline"
# page interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=page"
+ env set hwconfig "fsl_ddr:ctlr_intlv=page"
# bank interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=bank"
+ env set hwconfig "fsl_ddr:ctlr_intlv=bank"
# superbank
- setenv hwconfig "fsl_ddr:ctlr_intlv=superbank"
+ env set hwconfig "fsl_ddr:ctlr_intlv=superbank"
# 1KB 3-way interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=3way_1KB"
+ env set hwconfig "fsl_ddr:ctlr_intlv=3way_1KB"
# 4KB 3-way interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=3way_4KB"
+ env set hwconfig "fsl_ddr:ctlr_intlv=3way_4KB"
# 8KB 3-way interleaving
- setenv hwconfig "fsl_ddr:ctlr_intlv=3way_8KB"
+ env set hwconfig "fsl_ddr:ctlr_intlv=3way_8KB"
# disable bank (chip-select) interleaving
- setenv hwconfig "fsl_ddr:bank_intlv=null"
+ env set hwconfig "fsl_ddr:bank_intlv=null"
# bank(chip-select) interleaving cs0+cs1
- setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1"
+ env set hwconfig "fsl_ddr:bank_intlv=cs0_cs1"
# bank(chip-select) interleaving cs2+cs3
- setenv hwconfig "fsl_ddr:bank_intlv=cs2_cs3"
+ env set hwconfig "fsl_ddr:bank_intlv=cs2_cs3"
# bank(chip-select) interleaving (cs0+cs1) and (cs2+cs3) (2x2)
- setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_and_cs2_cs3"
+ env set hwconfig "fsl_ddr:bank_intlv=cs0_cs1_and_cs2_cs3"
# bank(chip-select) interleaving (cs0+cs1+cs2+cs3) (4x1)
- setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_cs2_cs3"
+ env set hwconfig "fsl_ddr:bank_intlv=cs0_cs1_cs2_cs3"
# bank(chip-select) interleaving (auto)
- setenv hwconfig "fsl_ddr:bank_intlv=auto"
+ env set hwconfig "fsl_ddr:bank_intlv=auto"
This auto mode only select from cs0_cs1_cs2_cs3, cs0_cs1, null dependings
on DIMMs.
Two new files, common/iomux.c and include/iomux.h, contain the heart
(iomux_doenv()) of the environment setting implementation.
-iomux_doenv() is called in common/cmd_nvedit.c to handle setenv and in
+iomux_doenv() is called in common/cmd_nvedit.c to handle env set and in
common/console.c in console_init_r() during bootup to initialize
stdio_devices[].
A user can use a comma-separated list of devices to set stdin, stdout
-and stderr. For example: "setenv stdin serial,nc". NOTE: No spaces
+and stderr. For example: "env set stdin serial,nc". NOTE: No spaces
are allowed around the comma(s)!
The length of the list is limited by malloc(), since the array used
finds acceptable, but the code has only been tested with serial and
nc.
-iomux_doenv() prevents multiple use of the same device, e.g. "setenv
+iomux_doenv() prevents multiple use of the same device, e.g. "env set
stdin nc,nc,serial" will discard the second nc. iomux_doenv() is
not able to modify the environment, however, so that "pri stdin" still
shows "nc,nc,serial".
"if test \\\"$llfail\\\" -ne 0 -a " \
"\\\"$dhcpfail\\\" -ne 0; " \
"then " \
- "setenv ipaddr $sipaddr; " \
- "setenv netmask $snetmask; " \
- "setenv gatewayip $sgatewayip; " \
+ "env set ipaddr $sipaddr; " \
+ "env set netmask $snetmask; " \
+ "env set gatewayip $sgatewayip; " \
"fi;\0" \
and then set correct permanent ethernet MAC addresses.
# env default -a
- # setenv ethaddr XX:XX:XX:XX:XX:XX
- # setenv eth1addr XX:XX:XX:XX:XX:XX
- # setenv eth2addr YY:YY:YY:YY:YY:YY
- # setenv eth3addr ZZ:ZZ:ZZ:ZZ:ZZ:ZZ
+ # env set ethaddr XX:XX:XX:XX:XX:XX
+ # env set eth1addr XX:XX:XX:XX:XX:XX
+ # env set eth2addr YY:YY:YY:YY:YY:YY
+ # env set eth3addr ZZ:ZZ:ZZ:ZZ:ZZ:ZZ
# ...
# saveenv
The ethernet can be accessed after starting the USB subsystem in U-Boot.
The adapter does not come with a preconfigured MAC address, and hence it needs
to be set before starting USB.
-setenv usbethaddr 02:DE:AD:BE:EF:FF
+env set usbethaddr 02:DE:AD:BE:EF:FF
Note that in this example a locally managed MAC address is chosen. Care should
be taken to make these MAC addresses unique within the same subnet.
Start the USB subsystem:
-Odroid # setenv usbethaddr 02:DE:AD:BE:EF:FF
+Odroid # env set usbethaddr 02:DE:AD:BE:EF:FF
Odroid # usb start
(Re)start USB...
USB0: USB EHCI 1.00
------------------------
If the ethernet is connected to a DHCP server (router maybe with DHCP enabled),
then the below will automatically assign an ip address through DHCP.
-setenv autoload no
+env set autoload no
dhcp
-Odroid # setenv autoload no
+Odroid # env set autoload no
Odroid # dhcp
Waiting for Ethernet connection... done.
BOOTP broadcast 1
---------------------
In the case where there are no DHCP servers in the network, or you want to
set the IP address statically, it can be done by:
-Odroid # setenv ipaddr 192.168.1.10
+Odroid # env set ipaddr 192.168.1.10
Odroid # ping 192.168.1.27
Waiting for Ethernet connection... done.
Using sms0 device
Say there exists a tftp server in the network with address 192.168.1.27 and
it serves a kernel image (zImage.3.17) and a DTB blob (exynos4412-odroidu3.dtb)
that needs to be loaded and booted. It can be accomplished as below:
-(Assumes that you have setenv usbethaddr, and have not set autoload to no)
+(Assumes that you have env set usbethaddr, and have not set autoload to no)
-Odroid # setenv serverip 192.168.1.27
+Odroid # env set serverip 192.168.1.27
Odroid # tftpboot 0x40080000 zImage.3.17
Waiting for Ethernet connection... done.
Using sms0 device
Bytes transferred = 46935 (b757 hex)
Odroid # printenv bootargs
bootargs=Please use defined boot
-Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
+Odroid # env set bootargs console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootwait
Odroid # bootz 40080000 - 42000000
Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
## Flattened Device Tree blob at 42000000
3194200 bytes read in 471 ms (6.5 MiB/s)
Odroid # load usb 0:2 42000000 /boot/exynos4412-odroidu3.dtb
46935 bytes read in 233 ms (196.3 KiB/s)
-Odroid # setenv bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
+Odroid # env set bootargs console=ttySAC1,115200n8 root=/dev/sda2 rootwait
Odroid # bootz 40080000 - 42000000
Kernel image @ 0x40080000 [ 0x000000 - 0x30bd58 ]
## Flattened Device Tree blob at 42000000
*) The console can be switched to SCC by any of the following commands:
- setenv stdout serial_scc
- setenv stdin serial_scc
- setenv stderr serial_scc
+ env set stdout serial_scc
+ env set stdin serial_scc
+ env set stderr serial_scc
*) The console can be switched to SMC by any of the following commands:
- setenv stdout serial_smc
- setenv stdin serial_smc
- setenv stderr serial_smc
+ env set stdout serial_smc
+ env set stdin serial_smc
+ env set stderr serial_smc
*) If a file descriptor is set to "serial" then the current serial device
will be used which, in turn, can be switched by above commands.
*) The baudrate is the same for all serial devices. But it can be switched
just after switching the console:
- setenv sout serial_scc; setenv baudrate 38400
+ env set sout serial_scc; env set baudrate 38400
After that press 'enter' at the SCC console. Note that baudrates <38400
are not allowed on LWMON with watchdog enabled (see CFG_SYS_BAUDRATE_TABLE in
*) The default console is UART0
*) The console can be switched to UART1 by any of the following commands:
- setenv stdout serial1
- setenv stderr serial1
- setenv stdin serial1
+ env set stdout serial1
+ env set stderr serial1
+ env set stdin serial1
*) The console can be switched to UART0 by any of the following commands:
- setenv stdout serial0
- setenv stderr serial0
- setenv stdin serial0
+ env set stdout serial0
+ env set stderr serial0
+ env set stdin serial0
NorFlash.
c) Set environment variable "bootmaster" to "SRIO1" or "PCIE1" and save
environment for master.
- setenv bootmaster SRIO1
+ env set bootmaster SRIO1
or
- setenv bootmaster PCIE1
+ env set bootmaster PCIE1
saveenv
d) Restart up master and it will boot up normally from its NorFlash.
Then, it will finish necessary configurations for slave's boot from
'/tftpboot/update_uboot.itb', and set the 'updatefile' variable
appropriately, for example in the U-Boot prompt:
- setenv updatefile /tftpboot/update_uboot.itb
+ env set updatefile /tftpboot/update_uboot.itb
saveenv
Now, when the system boots up and the update TFTP server specified in the
start USB first. For example:
usb start
-setenv bootfile /tftpboot/uImage
+env set bootfile /tftpboot/uImage
bootp
For example to always use the hdmi connector, even if no cable is inserted,
using edid info when available and otherwise initalizing it at 1024x768@60Hz,
-use: "setenv video-mode sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1".
+use: "env set video-mode sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1".
TrueType fonts
2. Define CONFIG_BOOTCOMMAND for your board to load and run debrick
script after boot:
#define CONFIG_BOOTCOMMAND \
- "setenv autoload no; " \
+ "env set autoload no; " \
"bootp; " \
"if tftp 80000000 debrick.scr; then " \
"source 80000000; " \
partition table::
=> env default -f -a
- => setenv partitions $partitions_android
+ => env set partitions $partitions_android
=> env save
=> gpt write mmc 1 $partitions_android
DHCP
....
- setenv autoload no
- setenv ethrotate no
- setenv ethact eth1
+ env set autoload no
+ env set ethrotate no
+ env set ethact eth1
dhcp
PING
....
- setenv autoload no
- setenv ethrotate no
- setenv ethact eth1
+ env set autoload no
+ env set ethrotate no
+ env set ethact eth1
dhcp
ping $gatewayip
TFTP
....
- setenv autoload no
- setenv ethrotate no
- setenv ethact eth1
+ env set autoload no
+ env set ethrotate no
+ env set ethact eth1
dhcp
- setenv serverip WWW.XXX.YYY.ZZZ
+ env set serverip WWW.XXX.YYY.ZZZ
tftpboot u-boot.bin
The bridge also supports (to a lesser extent) the localhost interface, 'lo'.
TFTP
....
- setenv ethrotate no
- setenv ethact eth5
+ env set ethrotate no
+ env set ethact eth5
tftpboot u-boot.bin
1. Set up the boot arguments. Use the GUID for the partition you want to boot::
- => setenv bootargs root=/dev/disk/by-partuuid/965c59ee-1822-4326-90d2-b02446050059 ro
+ => env set bootargs root=/dev/disk/by-partuuid/965c59ee-1822-4326-90d2-b02446050059 ro
Here root= tells Linux the location of its root disk. The disk is specified
by its GUID, using '/dev/disk/by-partuuid/', a Linux path to a 'directory'
Linux has found the three partitions (sda1-3). Mercifully it doesn't print out
the GUIDs. In step 1 above we could have used::
- setenv bootargs root=/dev/sda2 ro
+ env set bootargs root=/dev/sda2 ro
instead of the GUID. However if you add another drive to your board the
numbering may change whereas the GUIDs will not. So if your boot partition
If you want to put this in a script you can use something like this::
- setenv bootargs root=UUID=b2aaf743-0418-4d90-94cc-3e6108d7d968 ro
- setenv boot zboot 03000000 0 04000000 \${filesize}
- setenv bootcmd "ext2load scsi 0:2 03000000 /boot/vmlinuz-3.13.0-58-generic; ext2load scsi 0:2 04000000 /boot/initrd.img-3.13.0-58-generic; run boot"
+ env set bootargs root=UUID=b2aaf743-0418-4d90-94cc-3e6108d7d968 ro
+ env set boot zboot 03000000 0 04000000 \${filesize}
+ env set bootcmd "ext2load scsi 0:2 03000000 /boot/vmlinuz-3.13.0-58-generic; ext2load scsi 0:2 04000000 /boot/initrd.img-3.13.0-58-generic; run boot"
saveenv
-The \ is to tell the shell not to evaluate ${filesize} as part of the setenv
+The \ is to tell the shell not to evaluate ${filesize} as part of the env set
command.
You can also bake this behaviour into your build by hard-coding the
riscv32-unknown-linux-gnu-gcc (GCC) 7.2.0
GNU ld (GNU Binutils) 2.29
- RISC-V # setenv ipaddr 10.0.4.200 ;
- RISC-V # setenv serverip 10.0.4.97 ;
+ RISC-V # env set ipaddr 10.0.4.200 ;
+ RISC-V # env set serverip 10.0.4.97 ;
RISC-V # ping 10.0.4.97 ;
Using mac@e0100000 device
host 10.0.4.97 is alive
17901268 bytes read in 4642 ms (3.7 MiB/s)
RISC-V # fatload mmc 0:0 0x2000000 ae350.dtb
1954 bytes read in 1 ms (1.9 MiB/s)
- RISC-V # setenv bootm_size 0x2000000
- RISC-V # setenv fdt_high 0x1f00000
+ RISC-V # env set bootm_size 0x2000000
+ RISC-V # env set fdt_high 0x1f00000
RISC-V # bootm 0x00600000 - 0x2000000
## Booting kernel from Legacy Image at 00600000 ...
Image Name:
SDPV: jump
# }
- FB: ucmd setenv fastboot_buffer ${loadaddr}
+ FB: ucmd env set fastboot_buffer ${loadaddr}
FB: download -f _image
- FB: ucmd if test ! -n "$fastboot_bytes"; then setenv fastboot_bytes $filesize; else true; fi
+ FB: ucmd if test ! -n "$fastboot_bytes"; then env set fastboot_bytes $filesize; else true; fi
# Burn image to nandfit partition if needed
FB: ucmd if env exists nandfit_part; then nand erase.part nandfit; nand write ${fastboot_buffer} nandfit ${fastboot_bytes}; else true; fi;
FB: ucmd nandbcb init ${fastboot_buffer} nandboot ${fastboot_bytes}
For example, Debian (stretch) can be booted by creating a script file named
'boot.txt' with the contents::
- setenv bootargs root=/dev/sda1 ro
+ env set bootargs root=/dev/sda1 ro
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} /vmlinuz
load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /initrd.img
zboot ${kernel_addr_r} - ${ramdisk_addr_r} ${filesize}
3. Update boot environment values on shell::
- => setenv bootfile vmlinuz
- => setenv bootdev scsi
+ => env set bootfile vmlinuz
+ => env set bootdev scsi
=> boot
Build Instruction for Slim Bootloader for LeafHill (APL) target
.. code-block:: none
- RISC-V # setenv kernel_addr_r 0x80200000
- RISC-V # setenv fdt_addr_r 0x82200000
+ RISC-V # env set kernel_addr_r 0x80200000
+ RISC-V # env set fdt_addr_r 0x82200000
- RISC-V # setenv ipaddr 192.168.1.5
- RISC-V # setenv netmask 255.255.255.0
- RISC-V # setenv serverip 192.168.1.3
- RISC-V # setenv gateway 192.168.1.1
+ RISC-V # env set ipaddr 192.168.1.5
+ RISC-V # env set netmask 255.255.255.0
+ RISC-V # env set serverip 192.168.1.3
+ RISC-V # env set gateway 192.168.1.1
RISC-V # tftpboot ${kernel_addr_r} uImage
ethernet@20112000: PHY present at 9
- Setup kernel bootargs::
- # setenv bootargs "console=ttymxc3,115200 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait quiet rw"
+ # env set bootargs "console=ttymxc3,115200 root=/dev/mmcblk0p1 rootfstype=ext4 rootwait quiet rw"
- Prepare args::
- Setup the IP server::
- # setenv serverip <server_ip_address>
+ # env set serverip <server_ip_address>
- Download dtb file::
- Setup kernel bootargs::
- # setenv bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw"
+ # env set bootargs "console=ttymxc0,115200 root=/dev/mmcblk1p1 rootfstype=ext4 rootwait quiet rw"
- Prepare args::
base 0
rsip_ipl_boot_ca0= /* Start TFA BL31, OPTEE-OS, U-Boot, Linux on Cortex-A720AE core 0 */ \
- setenv ipaddr 192.168.1.10 && \
- setenv serverip 192.168.1.1 && \
- setenv netmask 255.255.255.0 && \
+ env set ipaddr 192.168.1.10 && \
+ env set serverip 192.168.1.1 && \
+ env set netmask 255.255.255.0 && \
\
tftp ${rsip_ipl_scp_ep} scp.bin && \
tftp ${rsip_ipl_tfa_ep} bl31.bin && \
rproc load 13 ${rsip_ipl_tfa_ep} 4 && /* Set up Cortex-A720AE Core 0 */ \
rproc start 13 /* Start Cortex-A720AE Core 0 */
-
.. note::
U-Boot on RSIP environment is not persistent across reboots,
.. prompt:: bash =>
- setenv partitions_linux $partitions
- setenv partitions $partitions_android
+ env set partitions_linux $partitions
+ env set partitions $partitions_android
env save
Format eMMC to have Android partition table:
.. code-block:: bash
- setenv mmcroot 2
- setenv console ttySAC0,115200n8
- setenv kernel_file Image
- setenv fdtfile exynos/exynos850-e850-96.dtb
- setenv loadaddr 0x80000000
- setenv fdt_addr_r 0x8c000000
+ env set mmcroot 2
+ env set console ttySAC0,115200n8
+ env set kernel_file Image
+ env set fdtfile exynos/exynos850-e850-96.dtb
+ env set loadaddr 0x80000000
+ env set fdt_addr_r 0x8c000000
echo Booting Linux from eMMC...
mmc dev $mmcdev
mmc rescan
- setenv bootargs console=$console root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw
+ env set bootargs console=$console root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw
load mmc $mmcdev:$mmcroot $fdt_addr_r /boot/$fdtfile
load mmc $mmcdev:$mmcroot $loadaddr /boot/$kernel_file
booti $loadaddr - $fdt_addr_r
.. prompt:: bash =>
- setenv bootdev usb
+ env set bootdev usb
env save
Another thing to be aware of: in order to perform USB boot the USB PHY kernel
.. prompt:: bash =>
- setenv bootdev usb
+ env set bootdev usb
env save
6. Erase eMMC partition table to make U-Boot use ESP from USB drive:
.. code-block:: none
- => setenv ipaddr 10.206.7.133
- => setenv netmask 255.255.252.0
- => setenv serverip 10.206.4.143
- => setenv gateway 10.206.4.1
+ => env set ipaddr 10.206.7.133
+ => env set netmask 255.255.252.0
+ => env set serverip 10.206.4.143
+ => env set gateway 10.206.4.1
If you want to use a flat kernel image such as Image file
1000 Bytes/s
done
Bytes transferred = 5614 (15ee hex)
- => setenv bootargs "root=/dev/ram rw console=ttySIF0 ip=dhcp earlycon=sbi"
+ => env set bootargs "root=/dev/ram rw console=ttySIF0 ip=dhcp earlycon=sbi"
=> booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
## Loading init Ramdisk from Legacy Image at 88300000 ...
Image Name: Linux RootFS
a) prepare GPT on eMMC,
example with 3 partitions, fip, bootfs and roots::
- # setenv emmc_part "name=fip,size=4MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
+ # env set emmc_part "name=fip,size=4MiB;name=bootfs,type=linux,bootable,size=64MiB;name=rootfs,type=linux,size=512"
# gpt write mmc 1 ${emmc_part}
b) copy FSBL, TF-A_ or SPL, on first eMMC boot partition
.. code-block:: console
- setenv fdtfile my_device-tree.dtb
+ env set fdtfile my_device-tree.dtb
env save
Power switch
::
- setenv fdtfile my_device-tree.dtb
+ env set fdtfile my_device-tree.dtb
env save
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to set to
::
- setenv fdtfile my_device-tree.dtb
+ env set fdtfile my_device-tree.dtb
env save
or the configuration variable CONFIG_DEFAULT_FDT_FILE can be used to provide
.. prompt:: bash =>
- setenv mmcdev 0
- setenv bootpart 0
+ env set mmcdev 0
+ env set bootpart 0
boot
OSPI:
.. prompt:: bash =>
- setenv boot ubi
+ env set boot ubi
boot
UART:
.. prompt:: bash =>
- setenv autoload no
+ env set autoload no
usb start
dhcp
mmc dev 1 1
.. prompt:: bash =>
- setenv addr_uboot 0x87000000
- setenv filesize <size in hex of u-boot-spi.gph rounded to hex 0x10000>
+ env set addr_uboot 0x87000000
+ env set filesize <size in hex of u-boot-spi.gph rounded to hex 0x10000>
run burn_uboot_spi
Once U-Boot prompt is available, power off the EVM. Set the SW1 dip switch to
.. prompt:: bash =>
- setenv filesize <size in hex of MLO rounded to hex 0x10000>
+ env set filesize <size in hex of MLO rounded to hex 0x10000>
run burn_uboot_nand
Once U-Boot prompt is available, Power OFF the EVM. Set the SW1 dip switch to
.. code-block:: bash
- setenv ethact <FEC>
+ env set ethact <FEC>
***********
Boot source
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id
eth0: ethernet@ff0e0000
Hit any key to stop autoboot: 0
- ZynqMP> setenv autoload no
+ ZynqMP> env set autoload no
ZynqMP> dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.0.167 (8 ms)
376 KiB/s
done
Bytes transferred = 2075464 (1fab48 hex)
- ZynqMP> setenv autostart no
+ ZynqMP> env set autostart no
ZynqMP> bootelf -p 20000000
ZynqMP> cpu 4 release 10000000 lockstep
Using TCM jump trampoline for address 0x10000000
This environment variable can be used to control the list of bootdevs searched
and their ordering, for example::
- setenv boot_targets "mmc0 mmc1 usb pxe"
+ env set boot_targets "mmc0 mmc1 usb pxe"
Entries may be removed or re-ordered in this list to affect the boot order. If
the variable is empty, the default ordering is used, based on the priority of
This environment variable can be used to control the list of bootmeths used and
their ordering for example::
- setenv bootmeths "extlinux efi"
+ env set bootmeths "extlinux efi"
Entries may be removed or re-ordered in this list to affect the order the
bootmeths are tried on each bootdev. If the variable is empty, the default
scan_dev_for_extlinux:
If you want to disable extlinux.conf on all disks, set the value to something
- innocuous, e.g. setenv scan_dev_for_extlinux true.
+ innocuous, e.g. env set scan_dev_for_extlinux true.
scan_dev_for_scripts:
If you want to disable boot.scr on all disks, set the value to something
- innocuous, e.g. setenv scan_dev_for_scripts true.
+ innocuous, e.g. env set scan_dev_for_scripts true.
boot_net_usb_start:
If you want to prevent USB enumeration by distro boot commands which execute
- network operations, set the value to something innocuous, e.g. setenv
+ network operations, set the value to something innocuous, e.g. env set
boot_net_usb_start true. This would be useful if you know your Ethernet
device is not attached to USB, and you wish to increase boot speed by
avoiding unnecessary actions.
boot_net_pci_enum:
If you want to prevent PCI enumeration by distro boot commands which execute
- network operations, set the value to something innocuous, e.g. setenv
+ network operations, set the value to something innocuous, e.g. env set
boot_net_pci_enum true. This would be useful if you know your Ethernet
device is not attached to PCI, and you wish to increase boot speed by
avoiding unnecessary actions.
.. code-block:: bash
ext4load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image
- setenv kernel_size ${filesize}
+ env set kernel_size ${filesize}
ext4load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}Initrd
- setenv initrd_size ${filesize}
+ env set initrd_size ${filesize}
zboot ${kernel_addr_r} ${kernel_size} ${ramdisk_addr_r} ${initrd_size}
Extlinux configuration
Now in U-Boot install the keys on your board::
fatload mmc 0:1 <tmpaddr> PK.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize PK
+ env set -e -nv -bs -rt -at -i <tmpaddr>:$filesize PK
fatload mmc 0:1 <tmpaddr> KEK.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize KEK
+ env set -e -nv -bs -rt -at -i <tmpaddr>:$filesize KEK
fatload mmc 0:1 <tmpaddr> db.auth
- setenv -e -nv -bs -rt -at -i <tmpaddr>:$filesize db
+ env set -e -nv -bs -rt -at -i <tmpaddr>:$filesize db
Set up boot parameters on your board::
.. code-block:: console
- => setenv -e -nv -bs -rt -v OsIndications =0x0000000000000004
+ => env set -e -nv -bs -rt -v OsIndications =0x0000000000000004
Since U-Boot doesn't currently support SetVariable at runtime, its value
won't be taken over across the reboot. If this is the case, you can skip
We need to preset the "httpserverip" environment variable to proceed the wget::
- setenv httpserverip 192.168.1.1
+ env set httpserverip 192.168.1.1
UEFI HTTP(s) Boot using lwIP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Below you can find the output of an example session::
- => setenv efi_selftest simple network protocol
+ => env set efi_selftest simple network protocol
=> bootefi selftest
Testing EFI API implementation
Selected test: 'simple network protocol'
::
- => setenv bootcmd 'echo Hello World'
+ => env set bootcmd 'echo Hello World'
=> bootd
Hello World
- => setenv bootcmd true
+ => env set bootcmd true
=> bootd; echo $?
0
- => setenv bootcmd false
+ => env set bootcmd false
=> bootd; echo $?
1
::
- setenv bootargs root=/dev/vda1
+ env set bootargs root=/dev/vda1
load mmc 0:1 $fdt_addr_r dtb
load mmc 0:1 $kernel_addr_r vmlinux
load mmc 0:1 $initrd_addr_r intird
::
- => setenv bootargs 'Greetings to the world'
+ => env set bootargs 'Greetings to the world'
=> bootefi hello
Booting /MemoryMapped(0x0,0x10001000,0x1000)
Hello, world!
::
- => setenv efi_selftest list
+ => env set efi_selftest list
=> bootefi selftest
Available tests:
::
- => setenv efi_selftest 'block image transfer'
+ => env set efi_selftest 'block image transfer'
=> bootefi selftest
Some of the tests execute the ExitBootServices() UEFI boot service and will not
::
- => setenv kernel_comp_addr_r 0x50000000
- => setenv kernel_comp_size 0x04000000
+ => env set kernel_comp_addr_r 0x50000000
+ => env set kernel_comp_size 0x04000000
=> load mmc 0:1 $fdt_addr_r dtb-5.10.0-3-arm64
27530 bytes read in 6 ms (4.4 MiB/s)
=> load mmc 0:1 $kernel_addr_r vmlinuz-5.10.0-3-arm64.gz
Example environment::
- setenv bootmenu_0 Boot 1. kernel=bootm 0x82000000 # Set first menu entry
- setenv bootmenu_1 Boot 2. kernel=bootm 0x83000000 # Set second menu entry
- setenv bootmenu_2 Reset board=reset # Set third menu entry
- setenv bootmenu_3 U-Boot boot order=boot # Set fourth menu entry
+ env set bootmenu_0 Boot 1. kernel=bootm 0x82000000 # Set first menu entry
+ env set bootmenu_1 Boot 2. kernel=bootm 0x83000000 # Set second menu entry
+ env set bootmenu_2 Reset board=reset # Set third menu entry
+ env set bootmenu_3 U-Boot boot order=boot # Set fourth menu entry
bootmenu 20 # Run bootmenu with autoboot delay 20s
::
button button1
- setenv status1 $?
+ env set status1 $?
A list of all available buttons and their status can be displayed using
Writes the settings to environment variables. For each menu item the selected
ID and its text string are written, similar to:
- setenv c.<name> <selected_id>
- setenv c.<name>-str <selected_id's text string>
+ env set c.<name> <selected_id>
+ env set c.<name>-str <selected_id's text string>
The `-v` flag enables verbose mode, where each variable is printed before it is
set.
| |-- stderr
|-- serial (IO)
|-- usbkbd (I)
- => setenv stdin pl011@9000000,usbkbd
+ => env set stdin pl011@9000000,usbkbd
=> coninfo
List of available devices
|-- pl011@9000000 (IO)
::
- => setenv var X; echo "a)" ${var} 'b)' '${var}' c) ${var}
+ => env set var X; echo "a)" ${var} 'b)' '${var}' c) ${var}
a) X b) ${var} c) X
=>
To do auto boot according to the UEFI BootOrder variable,
add "bootefi bootmgr" entry as a default or first bootmenu entry::
- CONFIG_PREBOOT="setenv bootmenu_0 UEFI Boot Manager=bootefi bootmgr; setenv bootmenu_1 UEFI Maintenance Menu=eficonfig"
+ CONFIG_PREBOOT="env set bootmenu_0 UEFI Boot Manager=bootefi bootmgr; env set bootmenu_1 UEFI Maintenance Menu=eficonfig"
UEFI Secure Boot Configuration
''''''''''''''''''''''''''''''
U-Boot console. In this case, the bootmenu can be used to invoke "eficonfig"::
CONFIG_USE_PREBOOT=y
- CONFIG_PREBOOT="setenv bootmenu_0 UEFI Maintenance Menu=eficonfig"
+ CONFIG_PREBOOT="env set bootmenu_0 UEFI Maintenance Menu=eficonfig"
The only way U-Boot can currently store EFI variables on a tamper
resistant medium is via OP-TEE. The Kconfig option that enables that is::
::
- => setenv inner 'echo entry inner; exit; echo inner done'
- => setenv outer 'echo entry outer; run inner; echo outer done'
+ => env set inner 'echo entry inner; exit; echo inner done'
+ => env set outer 'echo entry outer; run inner; echo outer done'
=> run outer
entry outer
entry inner
::
- => setenv extension_overlay_addr 0x88080000
- => setenv extension_overlay_cmd 'load mmc 0:1 ${extension_overlay_addr} /boot/${extension_overlay_name}'
+ => env set extension_overlay_addr 0x88080000
+ => env set extension_overlay_cmd 'load mmc 0:1 ${extension_overlay_addr} /boot/${extension_overlay_name}'
3. Detect the plugged extension board
::
- => setenv c
+ => env set c
=> for c in 1 2 3; do echo item ${c}; done
item 1
item 2
item 3
=> echo ${c}
3
- => setenv c x
+ => env set c x
=> for c in 1 2 3; do echo item ${c}; done
item x
item x
is in 'partition list' (separated by ','), the bootable flag is set, otherwise
it is cleared. CONFIG_CMD_GPT_RENAME=y is required.
-gpt setenv
-~~~~~~~~~~
+gpt env set
+~~~~~~~~~~~
-The 'gpt setenv' command will set a series of environment variables with
+The 'gpt env set' command will set a series of environment variables with
information about the partition named '<partition name>'. The variables are:
gpt_partition_addr
Create 6 partitions on a disk::
- => setenv gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;\
+ => env set gpt_parts 'uuid_disk=bec9fc2a-86c1-483d-8a0e-0109732277d7;\
name=boot,start=4M,size=128M,bootable,type=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7;\
name=rootfs,size=3072M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\
name=system-data,size=512M,type=0fc63daf-8483-4772-8e79-3d69d8477de4;\
Get the information about the partition named 'rootfs'::
- => gpt setenv mmc 0 rootfs
+ => gpt env set mmc 0 rootfs
=> echo ${gpt_partition_addr}
2000
=> echo ${gpt_partition_size}
Swap the order of the 'boot' and 'rootfs' partition table entries::
- => gpt setenv mmc 0 rootfs
+ => gpt env set mmc 0 rootfs
=> echo ${gpt_partition_entry}
2
- => gpt setenv mmc 0 boot
+ => gpt env set mmc 0 boot
=> echo ${gpt_partition_entry}
1
=> gpt transpose mmc 0 1 2
- => gpt setenv mmc 0 rootfs
+ => gpt env set mmc 0 rootfs
=> echo ${gpt_partition_entry}
1
- => gpt setenv mmc 0 boot
+ => gpt env set mmc 0 boot
=> echo ${gpt_partition_entry}
2
Other example: a disk with known partition types::
- => setenv gpt_parts 'name=u-boot,size=32M,type=data;\
+ => env set gpt_parts 'name=u-boot,size=32M,type=data;\
name=env,size=1M,type=u-boot-env;
name=ESP,size=128M,type=system;
name=rootfs,size=3072M,type=linux;
.. code-block:: console
- => setenv verify no
+ => env set verify no
=> imxtract $loadaddr kernel-1 $kernel_addr_r
## Copying 'kernel-1' subimage from FIT image at 40200000 ...
sha256+ sha512+ Loading part 0 ... OK
.. code-block:: console
- => setenv verify yes
+ => env set verify yes
=> imxtract $loadaddr kernel-1 $kernel_addr_r
## Copying 'kernel-1' subimage from FIT image at 40200000 ...
sha256 error!
::
- => setenv mbr_parts 'name=boot,start=4M,size=128M,bootable,id=0x0e;
+ => env set mbr_parts 'name=boot,start=4M,size=128M,bootable,id=0x0e;
name=rootfs,size=3072M,id=0x83;
name=system-data,size=512M,id=0x83;
name=[ext],size=-,id=0x05;
::
- => setenv .foo bar
+ => env set .foo bar
=> printenv
arch=sandbox
baudrate=115200
Really kill this window [y/n]
$ srec_cat out.srec -offset -1337982976 -Output out.txt -binary 2>/dev/null
$ cat out.txt
- setenv autoload no
+ env set autoload no
dhcp
load mmc 0:1 $fdt_addr_r dtb
load mmc 0:1 $kernel_addr_r snp.efi
::
- => setenv ntpserverip 109.190.177.205
+ => env set ntpserverip 109.190.177.205
=> date
Date: 2025-06-16 (Monday) Time: 15:19:35
=> date reset
Date: 2025-06-16 Time: 15:19:43
=> date
Date: 2025-06-16 (Monday) Time: 15:19:47
- => setenv timeoffset 7200
+ => env set timeoffset 7200
=> sntp
Date: 2025-06-16 Time: 17:19:55
=> date
::
- => setenv autoload no
+ => env set autoload no
=> dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.1.40 (7 ms)
::
- => setenv autoload no
+ => env set autoload no
=> dhcp
BOOTP broadcast 1
*** Unhandled DHCP Option in OFFER/ACK: 23
- special characters ('$', ';') can be escaped by prefixing with '\',
for example::
- setenv bootcmd bootm \${address}
+ env set bootcmd bootm \${address}
- You can also escape text by enclosing in single apostrophes, for example::
- setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'
+ env set addip 'env set bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname::off'
Hush shell
----------
- `while` ... `do` ... `done`
- `until` ... `do` ... `done`
-Hush supports environment ("global") variables (through setenv / saveenv
+Hush supports environment ("global") variables (through env set / saveenv
commands) and local shell variables (through standard shell syntax
`name=value`); only environment variables can be used with the "run" command
layout and even set a new *dfu_alt_info* for the newly created partitions.
Such a script would look like::
- setenv dfu_alt_info ...
- setenv mbr_parts ...
+ env set dfu_alt_info ...
+ env set mbr_parts ...
mbr write ...
Please note that this means the user will be able to execute any
/* U-Boot script for booting */
if [ -z ${tftpserverip} ]; then
- echo "Use 'setenv tftpserverip a.b.c.d' to set IP address."
+ echo "Use 'env set tftpserverip a.b.c.d' to set IP address."
fi
- usb start; setenv autoload n; bootp;
+ usb start; env set autoload n; bootp;
tftpboot ${tftpserverip}:
bootm
failed=
sure that the initrd image is placed in the first
12 MB as well - this can be done with::
- setenv initrd_high 00c00000
+ env set initrd_high 00c00000
If you set initrd_high to 0xffffffff (32-bit machines) or
0xffffffffffffffff (64-bit machines), this is an
controls which interface is currently active.
For example you can do the following::
- => setenv ethact FEC
+ => env set ethact FEC
=> ping 192.168.0.1 # traffic sent on FEC
- => setenv ethact SCC
+ => env set ethact SCC
=> ping 10.0.0.1 # traffic sent on SCC
ethrotate
::
- => setenv fdtaddr 0x87f00000
- => setenv fdtovaddr 0x87fc0000
+ => env set fdtaddr 0x87f00000
+ => env set fdtovaddr 0x87fc0000
2. Load the base binary device-tree and the binary device-tree overlay.
Boot the board using the commands below::
- setenv bootargs console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
+ env set bootargs console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
ext2load mmc 0:2 82000000 /boot/image.fit
bootm 82000000
You should then see something like this::
- U-Boot# setenv bootargs console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
+ U-Boot# env set bootargs console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
U-Boot# ext2load mmc 0:2 82000000 /boot/image.fit
7824930 bytes read in 589 ms (12.7 MiB/s)
U-Boot# bootm 82000000
[on the target system]::
=> print nfsargs
- nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
+ nfsargs=env set bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
=> print addip
- addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1
+ addip=env set bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1
=> run nfsargs addip
=> tftp 900000 /path/to/tftp/location/kernel.itb
Using FEC device
uninitialized to permit manual configuration. For example, PC-style
configuration could be simulated by issuing a fatload in bootcmd::
- # setenv bootcmd fatload mmc 0 $confaddr plan9.ini; ...; bootm
+ # env set bootcmd fatload mmc 0 $confaddr plan9.ini; ...; bootm