Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 2 | /* |
Uma Shankar | a159643 | 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 | bcd0be5 | 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 | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | /* |
| 20 | * Ext2fs support |
| 21 | */ |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 22 | #include <common.h> |
| 23 | #include <command.h> |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 24 | #include <fs.h> |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 25 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 26 | static int do_ext2ls(struct cmd_tbl *cmdtp, int flag, int argc, |
| 27 | char *const argv[]) |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 28 | { |
Stephen Warren | 045fa1e | 2012-10-22 06:43:51 +0000 | [diff] [blame] | 29 | return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EXT); |
Uma Shankar | a159643 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 30 | } |
Wolfgang Denk | 47e26b1 | 2010-07-17 01:06:04 +0200 | [diff] [blame] | 31 | |
Uma Shankar | a159643 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 32 | /****************************************************************************** |
| 33 | * Ext2fs boot command intepreter. Derived from diskboot |
| 34 | */ |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 35 | int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Uma Shankar | a159643 | 2012-05-25 21:21:44 +0530 | [diff] [blame] | 36 | { |
Wolfgang Denk | b770e88 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 37 | return do_load(cmdtp, flag, argc, argv, FS_TYPE_EXT); |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | U_BOOT_CMD( |
| 41 | ext2ls, 4, 1, do_ext2ls, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 42 | "list files in a directory (default /)", |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 43 | "<interface> <dev[:part]> [directory]\n" |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 44 | " - list files from 'dev' on 'interface' in a 'directory'" |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 45 | ) |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 46 | |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 47 | U_BOOT_CMD( |
| 48 | ext2load, 6, 0, do_ext2load, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 49 | "load binary file from a Ext2 filesystem", |
Pavel Machek | 6b36746 | 2014-07-09 22:40:07 +0200 | [diff] [blame] | 50 | "<interface> [<dev[:part]> [addr [filename [bytes [pos]]]]]\n" |
stroese | bcd0be5 | 2004-12-16 17:33:10 +0000 | [diff] [blame] | 51 | " - load binary file 'filename' from 'dev' on 'interface'\n" |
Wolfgang Denk | b770e88 | 2013-10-05 21:07:25 +0200 | [diff] [blame] | 52 | " to address 'addr' from ext2 filesystem." |
Jeroen Hofstee | 0e350f8 | 2014-06-23 00:22:08 +0200 | [diff] [blame] | 53 | ) |