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