/*
* (C) Copyright 2002
- * Stäubli Faverges - <www.staubli.com>
+ * Stäubli Faverges - <www.staubli.com>
* Pierre AUBERT p.aubert@staubli.com
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier: GPL-2.0+
*/
/*
#include <command.h>
#include <fdc.h>
-#if (CONFIG_COMMANDS & CFG_CMD_FDOS)
-
/*-----------------------------------------------------------------------------
* do_fdosboot --
*-----------------------------------------------------------------------------
*/
-int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *name;
char *ep;
int size;
- int rcode = 0;
- char buf [10];
- int drive = CFG_FDC_DRIVE_NUMBER;
+ int drive = CONFIG_SYS_FDC_DRIVE_NUMBER;
/* pre-set load_addr */
if ((ep = getenv("loadaddr")) != NULL) {
name = argv [2];
break;
default:
- printf ("Usage:\n%s\n", cmdtp->usage);
- break;
+ return CMD_RET_USAGE;
}
/* Init physical layer */
}
flush_cache (load_addr, size);
- sprintf(buf, "%x", size);
- setenv("filesize", buf);
+ setenv_hex("filesize", size);
printf("Floppy DOS load complete: %d bytes loaded to 0x%lx\n",
size, load_addr);
- /* Check if we should attempt an auto-start */
- if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
- char *local_args[2];
- extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
- local_args[0] = argv[0];
- local_args[1] = NULL;
- printf ("Automatic boot of image at addr 0x%08lX ...\n", load_addr);
- rcode = do_bootm (cmdtp, 0, 1, local_args);
- }
- return rcode;
+ return bootm_maybe_autostart(cmdtp, argv[0]);
}
/*-----------------------------------------------------------------------------
* do_fdosls --
*-----------------------------------------------------------------------------
*/
-int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *path = "";
- int drive = CFG_FDC_DRIVE_NUMBER;
+ int drive = CONFIG_SYS_FDC_DRIVE_NUMBER;
switch (argc) {
case 1:
return (dos_dir ());
}
-cmd_tbl_t U_BOOT_CMD(FDOS_BOOT) = MK_CMD_ENTRY(
- "fdosboot", 3, 0, do_fdosboot,
- "fdosboot- boot from a dos floppy file\n",
- "[loadAddr] [filename]\n"
+U_BOOT_CMD(
+ fdosboot, 3, 0, do_fdosboot,
+ "boot from a dos floppy file",
+ "[loadAddr] [filename]"
);
-cmd_tbl_t U_BOOT_CMD(FDOS_LS) = MK_CMD_ENTRY(
- "fdosls", 2, 0, do_fdosls,
- "fdosls - list files in a directory\n",
- "[directory]\n"
+U_BOOT_CMD(
+ fdosls, 2, 0, do_fdosls,
+ "list files in a directory",
+ "[directory]"
);
-
-#endif /* CONFIG_COMMANDS & CFG_CMD_FDOS */