Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 2 | /* |
Uma Shankar | 71014b6 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 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 | |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 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> |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | /* |
| 20 | * Ext2fs support |
| 21 | */ |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 22 | #include <command.h> |
Stephen Warren | eefbc3f | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 23 | #include <fs.h> |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 24 | |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 25 | static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc, |
| 26 | char *const argv[]) |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 27 | { |
Stephen Warren | eefbc3f | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 28 | return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT); |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 29 | } |
| 30 | |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 31 | /****************************************************************************** |
| 32 | * Ext2fs boot command intepreter. Derived from diskboot |
| 33 | */ |
Simon Glass | ed38aef | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 34 | int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 35 | { |
Wolfgang Denk | a10c7a5 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 36 | return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT); |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | U_BOOT_CMD( |
Uma Shankar | 71014b6 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 40 | 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 Glass | 761d602 | 2023-11-18 14:04:52 -0700 | [diff] [blame] | 44 | ); |
Uma Shankar | 71014b6 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 45 | |
| 46 | U_BOOT_CMD( |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 47 | ext2load, 6, 0, do_ext2load, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 48 | "load binary file from a Ext2 filesystem", |
Pavel Machek | 264ebb5 | 2014-07-09 22:40:07 +0200 | [diff] [blame] | 49 | "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n" |
stroese | 084f67c | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 50 | " - load binary file 'filename' from 'dev' on 'interface'\n" |
Wolfgang Denk | a10c7a5 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 51 | " to address 'addr' from ext2 filesystem." |
Simon Glass | 761d602 | 2023-11-18 14:04:52 -0700 | [diff] [blame] | 52 | ); |