[PATCH 1/2] cmd: load: add load command for memory mapped

Tom Rini trini at konsulko.com
Wed Mar 23 14:22:58 CET 2022


On Tue, Mar 22, 2022 at 10:41:17AM +0000, Rui Miguel Silva wrote:

> cp.b is used a lot as a way to load binaries to memory and execute
> them, however we may need to integrate this with the efi subsystem to
> set it up as a bootdev.
> 
> So, introduce a loadm command that will be consistent with the other
> loadX commands and will call the efi API's.
> 
> ex: loadm $kernel_addr $kernel_addr_r $kernel_size
> 
> with this a kernel with CONFIG_EFI_STUB enabled will be loaded and
> then subsequently booted with bootefi command.
> 
> Signed-off-by: Rui Miguel Silva <rui.silva at linaro.org>
> ---
>  README                           |  1 +
>  cmd/Kconfig                      |  6 ++++
>  cmd/bootefi.c                    | 12 ++++++++
>  cmd/load.c                       | 48 ++++++++++++++++++++++++++++++++
>  include/efi_loader.h             |  2 ++
>  lib/efi_loader/efi_device_path.c |  9 ++++++
>  6 files changed, 78 insertions(+)
> 
> diff --git a/README b/README
> index fe3ba01865e6..2932734b3edc 100644
> --- a/README
> +++ b/README
> @@ -2693,6 +2693,7 @@ rarpboot- boot image via network using RARP/TFTP protocol
>  diskboot- boot from IDE devicebootd   - boot default, i.e., run 'bootcmd'
>  loads	- load S-Record file over serial line
>  loadb	- load binary file over serial line (kermit mode)
> +loadm   - load binary blob from source address to destination address
>  md	- memory display
>  mm	- memory modify (auto-incrementing)
>  nm	- memory modify (constant address)

There's likely a spot under doc/ that needs updating now too, as we move
to having better documentation.

> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index 564daa7bbc8d..d70e8398a558 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -1076,6 +1076,12 @@ config CMD_LOADB
>  	help
>  	  Load a binary file over serial line.
>  
> +config CMD_LOADM
> +	bool "loadm"
> +	default y
> +	help
> +	  Load a binary over memory mapped.

We don't make new commands default y for everyone, that adds to every
board.  This also needs a test, and should be enabled in sandbox so it
is tested and also passed through coverity.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220323/fc4b61ff/attachment.sig>


More information about the U-Boot mailing list