Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 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 | |
| 19 | #include <common.h> |
| 20 | #include <command.h> |
| 21 | #include <fs.h> |
| 22 | |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 23 | static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, |
| 24 | char * const argv[]) |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 25 | { |
Wolfgang Denk | b770e88 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 26 | return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY); |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | U_BOOT_CMD( |
Stephen Warren | f9b55e2 | 2012-10-31 11:05:07 +0000 | [diff] [blame] | 30 | load, 7, 0, do_load_wrapper, |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 31 | "load binary file from a filesystem", |
| 32 | "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n" |
| 33 | " - Load binary file 'filename' from partition 'part' on device\n" |
| 34 | " type 'interface' instance 'dev' to address 'addr' in memory.\n" |
| 35 | " 'bytes' gives the size to load in bytes.\n" |
| 36 | " If 'bytes' is 0 or omitted, the file is read until the end.\n" |
| 37 | " 'pos' gives the file byte position to start reading from.\n" |
Wolfgang Denk | b770e88 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 38 | " If 'pos' is 0 or omitted, the file is read from the start." |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 39 | ) |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 40 | |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 41 | static int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, |
| 42 | char * const argv[]) |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 43 | { |
| 44 | return do_ls(cmdtp, flag, argc, argv, FS_TYPE_ANY); |
| 45 | } |
| 46 | |
| 47 | U_BOOT_CMD( |
| 48 | ls, 4, 1, do_ls_wrapper, |
| 49 | "list files in a directory (default /)", |
| 50 | "<interface> [<dev[:part]> [directory]]\n" |
| 51 | " - List files in directory 'directory' of partition 'part' on\n" |
| 52 | " device type 'interface' instance 'dev'." |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 53 | ) |