blob: a0ce0cf5796b9dd091c004ddbbcb4ee36bbfd590 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
stroese084f67c2004-12-16 17:33:10 +00002/*
Uma Shankar71014b62012-05-25 21:21:44 +05303 * (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
stroese084f67c2004-12-16 17:33:10 +00008 * (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>
stroese084f67c2004-12-16 17:33:10 +000017 */
18
19/*
20 * Ext2fs support
21 */
Simon Glassed38aef2020-05-10 11:40:03 -060022#include <common.h>
23#include <command.h>
Stephen Warreneefbc3f2012-10-22 06:43:51 +000024#include <fs.h>
stroese084f67c2004-12-16 17:33:10 +000025
Simon Glassed38aef2020-05-10 11:40:03 -060026static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc,
27 char *const argv[])
stroese084f67c2004-12-16 17:33:10 +000028{
Stephen Warreneefbc3f2012-10-22 06:43:51 +000029 return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
stroese084f67c2004-12-16 17:33:10 +000030}
31
stroese084f67c2004-12-16 17:33:10 +000032/******************************************************************************
33 * Ext2fs boot command intepreter. Derived from diskboot
34 */
Simon Glassed38aef2020-05-10 11:40:03 -060035int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
stroese084f67c2004-12-16 17:33:10 +000036{
Wolfgang Denka10c7a52013-10-05 21:07:25 +020037 return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
stroese084f67c2004-12-16 17:33:10 +000038}
39
40U_BOOT_CMD(
Uma Shankar71014b62012-05-25 21:21:44 +053041 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'"
Simon Glass761d6022023-11-18 14:04:52 -070045);
Uma Shankar71014b62012-05-25 21:21:44 +053046
47U_BOOT_CMD(
stroese084f67c2004-12-16 17:33:10 +000048 ext2load, 6, 0, do_ext2load,
Peter Tyserdfb72b82009-01-27 18:03:12 -060049 "load binary file from a Ext2 filesystem",
Pavel Machek264ebb52014-07-09 22:40:07 +020050 "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
stroese084f67c2004-12-16 17:33:10 +000051 " - load binary file 'filename' from 'dev' on 'interface'\n"
Wolfgang Denka10c7a52013-10-05 21:07:25 +020052 " to address 'addr' from ext2 filesystem."
Simon Glass761d6022023-11-18 14:04:52 -070053);