···11+// SPDX-License-Identifier: GPL-2.0
22+/*
33+ * Copyright (C) 2020 Bootlin
44+ *
55+ * Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
66+ *
77+ * squashfs.c: implements SquashFS related commands
88+ */
99+1010+#include <command.h>
1111+#include <fs.h>
1212+#include <squashfs.h>
1313+1414+static int do_sqfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
1515+{
1616+ return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
1717+}
1818+1919+U_BOOT_CMD(sqfsls, 4, 1, do_sqfs_ls,
2020+ "List files in directory. Default: root (/).",
2121+ "<interface> [<dev[:part]>] [directory]\n"
2222+ " - list files from 'dev' on 'interface' in 'directory'\n"
2323+);
2424+2525+static int do_sqfs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
2626+{
2727+ return do_load(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
2828+}
2929+3030+U_BOOT_CMD(sqfsload, 7, 0, do_sqfs_load,
3131+ "load binary file from a SquashFS filesystem",
3232+ "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
3333+ " - Load binary file 'filename' from 'dev' on 'interface'\n"
3434+ " to address 'addr' from SquashFS filesystem.\n"
3535+ " 'pos' gives the file position to start loading from.\n"
3636+ " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
3737+ " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
3838+ " the load stops on end of file.\n"
3939+ " If either 'pos' or 'bytes' are not aligned to\n"
4040+ " ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
4141+ " be printed and performance will suffer for the load."
4242+);