xref: /openbmc/u-boot/cmd/ext2.c (revision 1d2c0506)
1 /*
2  * (C) Copyright 2011 - 2012 Samsung Electronics
3  * EXT4 filesystem implementation in Uboot by
4  * Uma Shankar <uma.shankar@samsung.com>
5  * Manjunatha C Achar <a.manjunatha@samsung.com>
6 
7  * (C) Copyright 2004
8  * esd gmbh <www.esd-electronics.com>
9  * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
10  *
11  * made from cmd_reiserfs by
12  *
13  * (C) Copyright 2003 - 2004
14  * Sysgo Real-Time Solutions, AG <www.elinos.com>
15  * Pavel Bartusek <pba@sysgo.com>
16  *
17  * SPDX-License-Identifier:	GPL-2.0+
18  */
19 
20 /*
21  * Ext2fs support
22  */
23 #include <fs.h>
24 
25 static int do_ext2ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
26 {
27 	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
28 }
29 
30 /******************************************************************************
31  * Ext2fs boot command intepreter. Derived from diskboot
32  */
33 int do_ext2load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
34 {
35 	return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
36 }
37 
38 U_BOOT_CMD(
39 	ext2ls,	4,	1,	do_ext2ls,
40 	"list files in a directory (default /)",
41 	"<interface> <dev[:part]> [directory]\n"
42 	"    - list files from 'dev' on 'interface' in a 'directory'"
43 )
44 
45 U_BOOT_CMD(
46 	ext2load,	6,	0,	do_ext2load,
47 	"load binary file from a Ext2 filesystem",
48 	"<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
49 	"    - load binary file 'filename' from 'dev' on 'interface'\n"
50 	"      to address 'addr' from ext2 filesystem."
51 )
52