···11+.. SPDX-License-Identifier: GPL-2.0-or-later
22+.. Copyright 2024, Maxim Moskalets <maximmosk4@gmail.com>
33+44+.. index::
55+ single: bootelf (command)
66+77+bootelf command
88+===============
99+1010+Synopsis
1111+--------
1212+1313+::
1414+1515+ bootelf [-p|-s] [-d <fdt_addr>] [<image_addr> [<arg>]...]
1616+1717+Description
1818+-----------
1919+2020+The *bootelf* command is used to launch a ELF binary at *image_addr*. If
2121+*image_addr* is not specified, the bootelf command will try to find image in
2222+*image_load_addr* variable (*CONFIG\_SYS\_LOAD\_ADDR* by default).
2323+2424+Args after *image_addr* will be passed to application in common *argc*, *argv*
2525+format.
2626+2727+A command sequence to run a ELF image using FDT might look like
2828+2929+::
3030+3131+ load mmc 0:1 ${loadaddr} /kernel.elf
3232+ load mmc 0:1 ${fdt_addr_r} /soc-board.dtb
3333+ bootelf -d ${fdt_addr_r} ${loadaddr} ${loadaddr}
3434+3535+image_addr
3636+ Address of the ELF binary.
3737+3838+fdt_addr
3939+ Address of the device-tree. This argument in only needed if bootable
4040+ application uses FDT that requires additional setup (like /memory node).
4141+4242+arg
4343+ Any text arguments for bootable application. This is usually the address
4444+ of the device-tree.
4545+4646+Flags:
4747+4848+-p
4949+ Load ELF image via program headers.
5050+5151+-s
5252+ Load ELF image via section headers.
5353+5454+-d
5555+ Setup FDT by address.
5656+5757+Configuration
5858+-------------
5959+6060+The bootelf command is only available if CONFIG_CMD_ELF=y. FDT setup by flag -d
6161+need CONFIG_CMD_ELF_FDT_SETUP=y.