cmd_fs.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Inspired by cmd_ext_common.c, cmd_fat.c.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include <common.h>
  19. #include <command.h>
  20. #include <fs.h>
  21. int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  22. {
  23. return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY, 0);
  24. }
  25. U_BOOT_CMD(
  26. load, 7, 0, do_load_wrapper,
  27. "load binary file from a filesystem",
  28. "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
  29. " - Load binary file 'filename' from partition 'part' on device\n"
  30. " type 'interface' instance 'dev' to address 'addr' in memory.\n"
  31. " 'bytes' gives the size to load in bytes.\n"
  32. " If 'bytes' is 0 or omitted, the file is read until the end.\n"
  33. " 'pos' gives the file byte position to start reading from.\n"
  34. " If 'pos' is 0 or omitted, the file is read from the start.\n"
  35. " All numeric parameters are assumed to be decimal,\n"
  36. " unless specified otherwise using a leading \"0x\"."
  37. );
  38. int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  39. {
  40. return do_ls(cmdtp, flag, argc, argv, FS_TYPE_ANY);
  41. }
  42. U_BOOT_CMD(
  43. ls, 4, 1, do_ls_wrapper,
  44. "list files in a directory (default /)",
  45. "<interface> [<dev[:part]> [directory]]\n"
  46. " - List files in directory 'directory' of partition 'part' on\n"
  47. " device type 'interface' instance 'dev'."
  48. );