blob: 313efb83cc6a9e91dd5df26276fbce80ce4b92d7 [file] [log] [blame]
Heinrich Schuchardtfa6cce72021-02-17 12:19:35 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: booti (command)
5
Heinrich Schuchardtfa6cce72021-02-17 12:19:35 +01006booti command
7=============
8
9Synopsis
10--------
11
12::
13
14 booti [<addr> [<initrd>[:<size>]] [<fdt>]]
15
16Description
17-----------
18
19The booti command is used to boot a Linux kernel in flat or compressed
20'Image' format. Which compressed formats are supported is configurable.
21
22addr
23 address of kernel image, defaults to CONFIG_SYS_LOAD_ADDR.
24
25initrd
26 address of the initial RAM disk. Use '-' to boot a kernel with a device
27 tree but without an initial RAM disk.
28
29size
30 size of the initial RAM disk. This parameter must be specified for raw
31 initial RAM disks.
32
33fdt
34 address of the device tree.
35
36To support compressed Image files the following environment variables must be
37set:
38
39kernel_comp_addr_r
40 start of memory area used for decompression
41
42kernel_comp_size
43 size of the compressed file. The value has to be at least the size of
44 loaded image for decompression to succeed. For the booti command the
45 maximum decompressed size is 10 times this value.
46
47Example
48-------
49
50This is the boot log of an Odroid C2 board:
51
52::
53
54 => load mmc 0:1 $fdt_addr_r dtb-5.10.0-3-arm64
55 27530 bytes read in 7 ms (3.7 MiB/s)
56 => load mmc 0:1 $kernel_addr_r vmlinuz-5.10.0-3-arm64
57 26990448 bytes read in 1175 ms (21.9 MiB/s)
58 => load mmc 0:1 $ramdisk_addr_r initrd.img-5.10.0-3-arm64
59 27421776 bytes read in 1209 ms (21.6 MiB/s)
60 => booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r
61 Moving Image from 0x8080000 to 0x8200000, end=9c60000
62 ## Flattened Device Tree blob at 08008000
63 Booting using the fdt blob at 0x8008000
64 Loading Ramdisk to 7a52a000, end 7bf50c50 ... OK
65 Loading Device Tree to 000000007a520000, end 000000007a529b89 ... OK
66
67 Starting kernel ...
68
69The kernel can be compressed with gzip:
70
71.. code-block:: bash
72
73 cd /boot
74 gzip -k vmlinuz-5.10.0-3-arm64
75
76Here is the boot log for the compressed kernel:
77
78::
79
80 => setenv kernel_comp_addr_r 0x50000000
81 => setenv kernel_comp_size 0x04000000
82 => load mmc 0:1 $fdt_addr_r dtb-5.10.0-3-arm64
83 27530 bytes read in 6 ms (4.4 MiB/s)
84 => load mmc 0:1 $kernel_addr_r vmlinuz-5.10.0-3-arm64.gz
85 9267730 bytes read in 402 ms (22 MiB/s)
86 => load mmc 0:1 $ramdisk_addr_r initrd.img-5.10.0-3-arm64
87 27421776 bytes read in 1181 ms (22.1 MiB/s)
88 => booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r
89 Uncompressing Kernel Image
90 Moving Image from 0x8080000 to 0x8200000, end=9c60000
91 ## Flattened Device Tree blob at 08008000
92 Booting using the fdt blob at 0x8008000
93 Loading Ramdisk to 7a52a000, end 7bf50c50 ... OK
94 Loading Device Tree to 000000007a520000, end 000000007a529b89 ... OK
95
96 Starting kernel ...
97
98Configuration
99-------------
100
101The booti command is only available if CONFIG_CMD_BOOTI=y.
102
103Which compression types are supported depends on:
104
105* CONFIG_BZIP2
106* CONFIG_GZIP
107* CONFIG_LZ4
108* CONFIG_LZMA
109* CONFIG_LZO
110* CONFIG_ZSTD
111
112Return value
113------------
114
115Normally this command does not return. If an error occurs, the return value $?
116is set to 1 (false). If the operating system returns to U-Boot, the system is
117reset.