* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index 3ee342f..3030750 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -47,9 +47,9 @@
#endif
-#if (CONFIG_COMMANDS & CFG_CMD_DATE)
-#include <rtc.h>
-#endif
+/*#if (CONFIG_COMMANDS & CFG_CMD_DATE) */
+/*#include <rtc.h> */
+/*#endif */
#if ((CONFIG_COMMANDS & CFG_CMD_FDC) || (CONFIG_COMMANDS & CFG_CMD_FDOS))
@@ -211,7 +211,7 @@
return TRUE;
}
#endif
-
+
/* Supporting Functions */
/* reads a Register of the FDC */
unsigned char read_fdc_reg(unsigned int addr)
@@ -220,14 +220,14 @@
(volatile unsigned char *)(CFG_ISA_IO_BASE_ADDRESS +
(addr * CFG_ISA_IO_STRIDE) +
CFG_ISA_IO_OFFSET);
-
+
return val [0];
}
/* writes a Register of the FDC */
void write_fdc_reg(unsigned int addr, unsigned char val)
{
- volatile unsigned char *tmp =
+ volatile unsigned char *tmp =
(volatile unsigned char *)(CFG_ISA_IO_BASE_ADDRESS +
(addr * CFG_ISA_IO_STRIDE) +
CFG_ISA_IO_OFFSET);
@@ -642,7 +642,6 @@
}
-
/**************************************************************************
* int fdc_setup
* setup the fdc according the datasheet
@@ -658,7 +657,7 @@
#endif
#ifdef CFG_FDC_HW_INIT
- fdc_hw_init ();
+ fdc_hw_init ();
#endif
/* first, we reset the FDC via the DOR */
write_fdc_reg(FDC_DOR,0x00);
@@ -716,14 +715,14 @@
/**************************************************************************
* int fdc_fdos_init
-* initialize the FDC layer
-*
+* initialize the FDC layer
+*
*/
int fdc_fdos_init (int drive)
{
FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
FDC_COMMAND_STRUCT *pCMD = &cmd;
-
+
/* setup FDC and scan for drives */
if(fdc_setup(drive,pCMD,pFG)==FALSE) {
printf("\n** Error in setup FDC **\n");
@@ -748,19 +747,19 @@
/* read first block */
pCMD->blnr=0;
- return TRUE;
+ return TRUE;
}
/**************************************************************************
* int fdc_fdos_seek
-* parameter is a block number
+* parameter is a block number
*/
int fdc_fdos_seek (int where)
{
FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
FDC_COMMAND_STRUCT *pCMD = &cmd;
- pCMD -> blnr = where ;
- return (fdc_seek (pCMD, pFG));
+ pCMD -> blnr = where ;
+ return (fdc_seek (pCMD, pFG));
}
/**************************************************************************
* int fdc_fdos_read
@@ -771,7 +770,7 @@
FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
FDC_COMMAND_STRUCT *pCMD = &cmd;
- return (fdc_read_data (buffer, len, pCMD, pFG));
+ return (fdc_read_data (buffer, len, pCMD, pFG));
}
#endif /* (CONFIG_COMMANDS & CFG_CMD_FDOS) */
@@ -783,7 +782,7 @@
{
FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
FDC_COMMAND_STRUCT *pCMD = &cmd;
- unsigned long addr,imsize;
+ unsigned long addr,imsize;
image_header_t *hdr; /* used for fdc boot */
unsigned char boot_drive;
int i,nrofblk;
@@ -793,7 +792,7 @@
switch (argc) {
case 1:
addr = CFG_LOAD_ADDR;
- boot_drive=CFG_FDC_DRIVE_NUMBER;
+ boot_drive=CFG_FDC_DRIVE_NUMBER;
break;
case 2:
addr = simple_strtoul(argv[1], NULL, 16);
@@ -881,7 +880,17 @@
}
-
#endif /* CONFIG_COMMANDS & CFG_CMD_FDC */
+/***************************************************/
+
+
+#if (CONFIG_COMMANDS & CFG_CMD_FDC)
+
+cmd_tbl_t U_BOOT_CMD(FDC) = MK_CMD_ENTRY(
+ "fdcboot", 3, 1, do_fdcboot,
+ "fdcboot - boot from floppy device\n",
+ "loadAddr drive\n"
+);
+#endif