summaryrefslogtreecommitdiff
path: root/common/cmd_fdc.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_fdc.c')
-rw-r--r--common/cmd_fdc.c47
1 files changed, 28 insertions, 19 deletions
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 @@ int wait_for_fdc_int(void)
return TRUE;
}
#endif
-
+
/* Supporting Functions */
/* reads a Register of the FDC */
unsigned char read_fdc_reg(unsigned int addr)
@@ -220,14 +220,14 @@ unsigned char read_fdc_reg(unsigned int addr)
(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_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
}
-
/**************************************************************************
* int fdc_setup
* setup the fdc according the datasheet
@@ -658,7 +657,7 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
#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_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
/**************************************************************************
* 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 @@ int fdc_fdos_init (int drive)
/* 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 @@ int fdc_fdos_read (void *buffer, int len)
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 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
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 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
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 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
-
#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