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