1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2022 Huang Jianan <jnhuang95@gmail.com>
5 * Author: Huang Jianan <jnhuang95@gmail.com>
7 * erofs.c: implements EROFS related commands
14 static int do_erofs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
16 return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
19 U_BOOT_CMD(erofsls, 4, 1, do_erofs_ls,
20 "List files in directory. Default: root (/).",
21 "<interface> [<dev[:part]>] [directory]\n"
22 " - list files from 'dev' on 'interface' in 'directory'\n"
25 static int do_erofs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
27 return do_load(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
30 U_BOOT_CMD(erofsload, 7, 0, do_erofs_load,
31 "load binary file from a EROFS filesystem",
32 "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
33 " - Load binary file 'filename' from 'dev' on 'interface'\n"
34 " to address 'addr' from EROFS filesystem.\n"
35 " 'pos' gives the file position to start loading from.\n"
36 " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
37 " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
38 " the load stops on end of file.\n"
39 " If either 'pos' or 'bytes' are not aligned to\n"
40 " ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
41 " be printed and performance will suffer for the load."