Files
2024-06-17 19:55:24 +08:00

67 lines
1.8 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2002
* wangjianhui, wangjianhui@loongson.cn
*/
/*
* Boot support
*/
#include <common.h>
#include <command.h>
#include <s_record.h>
#include <net.h>
#include <ata.h>
#include <asm/io.h>
#include <mapmem.h>
#include <part.h>
#include <isofs.h>
#include <fs.h>
int do_isofs_size(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
return do_size(cmdtp, flag, argc, argv, FS_TYPE_ISOFS);
}
U_BOOT_CMD(
isosize, 4, 0, do_isofs_size,
"determine a file's size",
"<interface> <dev[:part]> <filename>\n"
" - Find file 'filename' from 'dev' on 'interface'\n"
" and determine its size."
);
int do_isofs_fsload (struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_ISOFS);
}
U_BOOT_CMD(
isoload, 7, 0, do_isofs_fsload,
"load binary file from a iso9660 filesystem",
"<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
" - Load binary file 'filename' from 'dev' on 'interface'\n"
" to address 'addr' from dos filesystem.\n"
" 'pos' gives the file position to start loading from.\n"
" If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
" 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
" the load stops on end of file.\n"
" If either 'pos' or 'bytes' are not aligned to\n"
" ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
" be printed and performance will suffer for the load."
);
static int do_isofs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_ISOFS);
}
U_BOOT_CMD(
isols, 4, 1, do_isofs_ls,
"list files in a directory (default /)",
"<interface> [<dev[:part]>] [directory]\n"
" - list files from 'dev' on 'interface' in a 'directory'"
);