blob: 45c8b353b58643333499a136a544ce1a56b09dc1 [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 <command.h>
Stephen Warreneefbc3f2012-10-22 06:43:51 +000023#include <fs.h>
stroese084f67c2004-12-16 17:33:10 +000024
Simon Glassed38aef2020-05-10 11:40:03 -060025static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc,
26 char *const argv[])
stroese084f67c2004-12-16 17:33:10 +000027{
Stephen Warreneefbc3f2012-10-22 06:43:51 +000028 return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
stroese084f67c2004-12-16 17:33:10 +000029}
30
stroese084f67c2004-12-16 17:33:10 +000031/******************************************************************************
32 * Ext2fs boot command intepreter. Derived from diskboot
33 */
Simon Glassed38aef2020-05-10 11:40:03 -060034int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
stroese084f67c2004-12-16 17:33:10 +000035{
Wolfgang Denka10c7a52013-10-05 21:07:25 +020036 return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
stroese084f67c2004-12-16 17:33:10 +000037}
38
39U_BOOT_CMD(
Uma Shankar71014b62012-05-25 21:21:44 +053040 ext2ls, 4, 1, do_ext2ls,
41 "list files in a directory (default /)",
42 "<interface> <dev[:part]> [directory]\n"
43 " - list files from 'dev' on 'interface' in a 'directory'"
Simon Glass761d6022023-11-18 14:04:52 -070044);
Uma Shankar71014b62012-05-25 21:21:44 +053045
46U_BOOT_CMD(
stroese084f67c2004-12-16 17:33:10 +000047 ext2load, 6, 0, do_ext2load,
Peter Tyserdfb72b82009-01-27 18:03:12 -060048 "load binary file from a Ext2 filesystem",
Pavel Machek264ebb52014-07-09 22:40:07 +020049 "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
stroese084f67c2004-12-16 17:33:10 +000050 " - load binary file 'filename' from 'dev' on 'interface'\n"
Wolfgang Denka10c7a52013-10-05 21:07:25 +020051 " to address 'addr' from ext2 filesystem."
Simon Glass761d6022023-11-18 14:04:52 -070052);