Heinrich Schuchardt | fa6cce7 | 2021-02-17 12:19:35 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 3 | .. index:: |
| 4 | single: booti (command) |
| 5 | |
Heinrich Schuchardt | fa6cce7 | 2021-02-17 12:19:35 +0100 | [diff] [blame] | 6 | booti command |
| 7 | ============= |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | booti [<addr> [<initrd>[:<size>]] [<fdt>]] |
| 15 | |
| 16 | Description |
| 17 | ----------- |
| 18 | |
| 19 | The booti command is used to boot a Linux kernel in flat or compressed |
| 20 | 'Image' format. Which compressed formats are supported is configurable. |
| 21 | |
| 22 | addr |
| 23 | address of kernel image, defaults to CONFIG_SYS_LOAD_ADDR. |
| 24 | |
| 25 | initrd |
| 26 | address of the initial RAM disk. Use '-' to boot a kernel with a device |
| 27 | tree but without an initial RAM disk. |
| 28 | |
| 29 | size |
| 30 | size of the initial RAM disk. This parameter must be specified for raw |
| 31 | initial RAM disks. |
| 32 | |
| 33 | fdt |
| 34 | address of the device tree. |
| 35 | |
| 36 | To support compressed Image files the following environment variables must be |
| 37 | set: |
| 38 | |
| 39 | kernel_comp_addr_r |
| 40 | start of memory area used for decompression |
| 41 | |
| 42 | kernel_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 | |
| 47 | Example |
| 48 | ------- |
| 49 | |
| 50 | This 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 | |
| 69 | The 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 | |
| 76 | Here 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 | |
| 98 | Configuration |
| 99 | ------------- |
| 100 | |
| 101 | The booti command is only available if CONFIG_CMD_BOOTI=y. |
| 102 | |
| 103 | Which 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 | |
| 112 | Return value |
| 113 | ------------ |
| 114 | |
| 115 | Normally this command does not return. If an error occurs, the return value $? |
| 116 | is set to 1 (false). If the operating system returns to U-Boot, the system is |
| 117 | reset. |