blob: bfa45c6f36c39fb1e51aa4449c2d630d952dab5b [file] [log] [blame]
Heinrich Schuchardt321759c2021-01-27 21:07:40 +01001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: load (command)
5
Heinrich Schuchardt321759c2021-01-27 21:07:40 +01006load command
7============
8
9Synopsis
10--------
11
12::
13
14 load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
15
16Description
17-----------
18
19The load command is used to read a file from a filesystem into memory.
20
21The number of transferred bytes is saved in the environment variable filesize.
22The load address is saved in the environment variable fileaddr.
23
24interface
25 interface for accessing the block device (mmc, sata, scsi, usb, ....)
26
27dev
28 device number
29
30part
31 partition number, defaults to 0 (whole device)
32
33addr
34 load address, defaults to environment variable loadaddr or if loadaddr is
35 not set to configuration variable CONFIG_SYS_LOAD_ADDR
36
37filename
38 path to file, defaults to environment variable bootfile
39
40bytes
41 maximum number of bytes to load
42
43pos
44 number of bytes to skip
45
Mickaƫl Tansorier975baac2023-09-16 00:11:53 +020046part, addr, bytes, pos are hexadecimal numbers.
Heinrich Schuchardt321759c2021-01-27 21:07:40 +010047
48Example
49-------
50
51::
52
53 => load mmc 0:1 ${kernel_addr_r} snp.efi
54 149280 bytes read in 11 ms (12.9 MiB/s)
55 =>
56 => load mmc 0:1 ${kernel_addr_r} snp.efi 1000000
57 149280 bytes read in 9 ms (15.8 MiB/s)
58 =>
59 => load mmc 0:1 ${kernel_addr_r} snp.efi 1000000 100
60 149024 bytes read in 10 ms (14.2 MiB/s)
61 =>
62 => load mmc 0:1 ${kernel_addr_r} snp.efi 10
63 16 bytes read in 1 ms (15.6 KiB/s)
64 =>
65
66Configuration
67-------------
68
69The load command is only available if CONFIG_CMD_FS_GENERIC=y.
70
71Return value
72------------
73
74The return value $? is set to 0 (true) if the file was successfully loaded
75even if the number of bytes is less then the specified length.
76
77If an error occurs, the return value $? is set to 1 (false).