"Das U-Boot" Source Tree
at master 77 lines 1.7 kB view raw
1.. SPDX-License-Identifier: GPL-2.0+: 2 3.. index:: 4 single: load (command) 5 6load 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 46part, addr, bytes, pos are hexadecimal numbers. 47 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).