summaryrefslogtreecommitdiff
path: root/doc/usage/booti.rst
blob: d631fb571de9824ddd273d7f88db0495516b1100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.. SPDX-License-Identifier: GPL-2.0+:

booti command
=============

Synopsis
--------

::

    booti [<addr> [<initrd>[:<size>]] [<fdt>]]

Description
-----------

The booti command is used to boot a Linux kernel in flat or compressed
'Image' format. Which compressed formats are supported is configurable.

addr
    address of kernel image, defaults to CONFIG_SYS_LOAD_ADDR.

initrd
    address of the initial RAM disk. Use '-' to boot a kernel with a device
    tree but without an initial RAM disk.

size
    size of the initial RAM disk. This parameter must be specified for raw
    initial RAM disks.

fdt
    address of the device tree.

To support compressed Image files the following environment variables must be
set:

kernel_comp_addr_r
    start of memory area used for decompression

kernel_comp_size
    size of the compressed file. The value has to be at least the size of
    loaded image for decompression to succeed. For the booti command the
    maximum decompressed size is 10 times this value.

Example
-------

This is the boot log of an Odroid C2 board:

::

    => load mmc 0:1 $fdt_addr_r dtb-5.10.0-3-arm64
    27530 bytes read in 7 ms (3.7 MiB/s)
    => load mmc 0:1 $kernel_addr_r vmlinuz-5.10.0-3-arm64
    26990448 bytes read in 1175 ms (21.9 MiB/s)
    => load mmc 0:1 $ramdisk_addr_r initrd.img-5.10.0-3-arm64
    27421776 bytes read in 1209 ms (21.6 MiB/s)
    => booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r
    Moving Image from 0x8080000 to 0x8200000, end=9c60000
    ## Flattened Device Tree blob at 08008000
       Booting using the fdt blob at 0x8008000
       Loading Ramdisk to 7a52a000, end 7bf50c50 ... OK
       Loading Device Tree to 000000007a520000, end 000000007a529b89 ... OK

    Starting kernel ...

The kernel can be compressed with gzip:

.. code-block:: bash

    cd /boot
    gzip -k vmlinuz-5.10.0-3-arm64

Here is the boot log for the compressed kernel:

::

    => setenv kernel_comp_addr_r 0x50000000
    => setenv 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
    9267730 bytes read in 402 ms (22 MiB/s)
    => load mmc 0:1 $ramdisk_addr_r initrd.img-5.10.0-3-arm64
    27421776 bytes read in 1181 ms (22.1 MiB/s)
    => booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdt_addr_r
       Uncompressing Kernel Image
    Moving Image from 0x8080000 to 0x8200000, end=9c60000
    ## Flattened Device Tree blob at 08008000
       Booting using the fdt blob at 0x8008000
       Loading Ramdisk to 7a52a000, end 7bf50c50 ... OK
       Loading Device Tree to 000000007a520000, end 000000007a529b89 ... OK

    Starting kernel ...

Configuration
-------------

The booti command is only available if CONFIG_CMD_BOOTI=y.

Which compression types are supported depends on:

* CONFIG_BZIP2
* CONFIG_GZIP
* CONFIG_LZ4
* CONFIG_LZMA
* CONFIG_LZO
* CONFIG_ZSTD

Return value
------------

Normally this command does not return. If an error occurs, the return value $?
is set to 1 (false). If the operating system returns to U-Boot, the system is
reset.