xref: /openbmc/u-boot/cmd/ext2.c (revision ae485b54)
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 <fs.h>
23 
24 static int do_ext2ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
25 {
26 	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
27 }
28 
29 /******************************************************************************
30  * Ext2fs boot command intepreter. Derived from diskboot
31  */
32 int do_ext2load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
33 {
34 	return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
35 }
36 
37 U_BOOT_CMD(
38 	ext2ls,	4,	1,	do_ext2ls,
39 	"list files in a directory (default /)",
40 	"<interface> <dev[:part]> [directory]\n"
41 	"    - list files from 'dev' on 'interface' in a 'directory'"
42 )
43 
44 U_BOOT_CMD(
45 	ext2load,	6,	0,	do_ext2load,
46 	"load binary file from a Ext2 filesystem",
47 	"<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
48 	"    - load binary file 'filename' from 'dev' on 'interface'\n"
49 	"      to address 'addr' from ext2 filesystem."
50 )
51