load.rst 1.6 KB

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