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