blob: 57a99516a6ac15844b69027c01c9d3458f504cef [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
stroesebcd0be52004-12-16 17:33:10 +00002/*
Uma Shankara1596432012-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
stroesebcd0be52004-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>
stroesebcd0be52004-12-16 17:33:10 +000017 */
18
19/*
20 * Ext2fs support
21 */
Simon Glass09140112020-05-10 11:40:03 -060022#include <common.h>
23#include <command.h>
Stephen Warren045fa1e2012-10-22 06:43:51 +000024#include <fs.h>
stroesebcd0be52004-12-16 17:33:10 +000025
Simon Glass09140112020-05-10 11:40:03 -060026static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc,
27 char *const argv[])
stroesebcd0be52004-12-16 17:33:10 +000028{
Stephen Warren045fa1e2012-10-22 06:43:51 +000029 return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT);
Uma Shankara1596432012-05-25 21:21:44 +053030}
Wolfgang Denk47e26b12010-07-17 01:06:04 +020031
Uma Shankara1596432012-05-25 21:21:44 +053032/******************************************************************************
33 * Ext2fs boot command intepreter. Derived from diskboot
34 */
Simon Glass09140112020-05-10 11:40:03 -060035int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Uma Shankara1596432012-05-25 21:21:44 +053036{
Wolfgang Denkb770e882013-10-05 21:07:25 +020037 return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT);
stroesebcd0be52004-12-16 17:33:10 +000038}
39
40U_BOOT_CMD(
41 ext2ls, 4, 1, do_ext2ls,
Peter Tyser2fb26042009-01-27 18:03:12 -060042 "list files in a directory (default /)",
stroesebcd0be52004-12-16 17:33:10 +000043 "<interface> <dev[:part]> [directory]\n"
Wolfgang Denka89c33d2009-05-24 17:06:54 +020044 " - list files from 'dev' on 'interface' in a 'directory'"
Jeroen Hofstee0e350f82014-06-23 00:22:08 +020045)
stroesebcd0be52004-12-16 17:33:10 +000046
stroesebcd0be52004-12-16 17:33:10 +000047U_BOOT_CMD(
48 ext2load, 6, 0, do_ext2load,
Peter Tyser2fb26042009-01-27 18:03:12 -060049 "load binary file from a Ext2 filesystem",
Pavel Machek6b367462014-07-09 22:40:07 +020050 "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n"
stroesebcd0be52004-12-16 17:33:10 +000051 " - load binary file 'filename' from 'dev' on 'interface'\n"
Wolfgang Denkb770e882013-10-05 21:07:25 +020052 " to address 'addr' from ext2 filesystem."
Jeroen Hofstee0e350f82014-06-23 00:22:08 +020053)