Newer
Older
* Pierre AUBERT p.aubert@staubli.com
*
* SPDX-License-Identifier: GPL-2.0+
*/
/*
* Dos floppy support
*/
#include <common.h>
#include <config.h>
#include <command.h>
#include <fdc.h>
/*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------
*/
int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *name;
char *ep;
int size;
int drive = CONFIG_SYS_FDC_DRIVE_NUMBER;
/* pre-set load_addr */
if ((ep = getenv("loadaddr")) != NULL) {
}
/* pre-set Boot file name */
if ((name = getenv("bootfile")) == NULL) {
}
switch (argc) {
case 1:
case 2:
/* only one arg - accept two forms:
* just load address, or just boot file name.
* The latter form must be written "filename" here.
*/
if (argv[1][0] == '"') { /* just boot filename */
name = argv [1];
} else { /* load address */
load_addr = simple_strtoul(argv[1], NULL, 16);
}
break;
load_addr = simple_strtoul(argv[1], NULL, 16);
name = argv [2];
break;
return CMD_RET_USAGE;
}
/* Init physical layer */
if (!fdc_fdos_init (drive)) {
/* Open file */
if (dos_open (name) < 0) {
}
if ((size = dos_read (load_addr)) < 0) {
}
flush_cache (load_addr, size);
printf("Floppy DOS load complete: %d bytes loaded to 0x%lx\n",
return bootm_maybe_autostart(cmdtp, argv[0]);
}
/*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------
*/
int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int drive = CONFIG_SYS_FDC_DRIVE_NUMBER;
}
/* Init physical layer */
if (!fdc_fdos_init (drive)) {
}
/* Open directory */
if (dos_open (path) < 0) {
}
return (dos_dir ());
}
U_BOOT_CMD(
fdosboot, 3, 0, do_fdosboot,
U_BOOT_CMD(
fdosls, 2, 0, do_fdosls,