]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_fdc.c
ARM Update mach-types
[karo-tx-uboot.git] / common / cmd_fdc.c
index e4fbf29a2213d3ce278e7df60436a76e175c393f..8e18c71bf40fbd7ee467a6af6db91cf858146bb6 100644 (file)
@@ -50,8 +50,6 @@
 /*#include <rtc.h> */
 /*#endif */
 
-#if defined(CONFIG_CMD_FDC) || defined(CONFIG_CMD_FDOS)
-
 typedef struct {
        int             flags;          /* connected drives ect */
        unsigned long   blnr;           /* Logical block nr */
@@ -172,17 +170,17 @@ const static FD_GEO_STRUCT floppy_type[2] = {
 static FDC_COMMAND_STRUCT cmd; /* global command struct */
 
 /* If the boot drive number is undefined, we assume it's drive 0             */
-#ifndef CFG_FDC_DRIVE_NUMBER
-#define CFG_FDC_DRIVE_NUMBER 0
+#ifndef CONFIG_SYS_FDC_DRIVE_NUMBER
+#define CONFIG_SYS_FDC_DRIVE_NUMBER 0
 #endif
 
 /* Hardware access */
-#ifndef CFG_ISA_IO_STRIDE
-#define CFG_ISA_IO_STRIDE 1
+#ifndef CONFIG_SYS_ISA_IO_STRIDE
+#define CONFIG_SYS_ISA_IO_STRIDE 1
 #endif
 
-#ifndef CFG_ISA_IO_OFFSET
-#define CFG_ISA_IO_OFFSET 0
+#ifndef CONFIG_SYS_ISA_IO_OFFSET
+#define CONFIG_SYS_ISA_IO_OFFSET 0
 #endif
 
 
@@ -215,9 +213,9 @@ int wait_for_fdc_int(void)
 unsigned char read_fdc_reg(unsigned int addr)
 {
        volatile unsigned char *val =
-               (volatile unsigned char *)(CFG_ISA_IO_BASE_ADDRESS +
-                                          (addr * CFG_ISA_IO_STRIDE) +
-                                          CFG_ISA_IO_OFFSET);
+               (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS +
+                                          (addr * CONFIG_SYS_ISA_IO_STRIDE) +
+                                          CONFIG_SYS_ISA_IO_OFFSET);
 
        return val [0];
 }
@@ -226,9 +224,9 @@ unsigned char read_fdc_reg(unsigned int addr)
 void write_fdc_reg(unsigned int addr, unsigned char val)
 {
        volatile unsigned char *tmp =
-               (volatile unsigned char *)(CFG_ISA_IO_BASE_ADDRESS +
-                                          (addr * CFG_ISA_IO_STRIDE) +
-                                          CFG_ISA_IO_OFFSET);
+               (volatile unsigned char *)(CONFIG_SYS_ISA_IO_BASE_ADDRESS +
+                                          (addr * CONFIG_SYS_ISA_IO_STRIDE) +
+                                          CONFIG_SYS_ISA_IO_OFFSET);
        tmp[0]=val;
 }
 
@@ -512,7 +510,7 @@ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT
        if(readblk>blocks) /* is end within 1st track */
                readblk=blocks; /* yes, correct it */
        PRINTF("we read %ld blocks start %ld\n",readblk,pCMD->blnr);
-       bufferw=&buffer[0]; /* setup working buffer */
+       bufferw = &buffer[0]; /* setup working buffer */
        do {
 retryrw:
                len=sect_size * readblk;
@@ -566,7 +564,7 @@ retryrw:
                 * we need to get the results */
                fdc_terminate(pCMD);
                offset+=(sect_size*readblk); /* set up buffer pointer */
-               bufferw=&buffer[offset];
+               bufferw = &buffer[offset];
                pCMD->blnr+=readblk; /* update current block nr */
                blocks-=readblk; /* update blocks */
                if(blocks==0)
@@ -654,7 +652,7 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
        i8259_unmask_irq(6);
 #endif
 
-#ifdef CFG_FDC_HW_INIT
+#ifdef CONFIG_SYS_FDC_HW_INIT
        fdc_hw_init ();
 #endif
        /* first, we reset the FDC via the DOR */
@@ -705,7 +703,6 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG)
 
        return TRUE;
 }
-#endif
 
 #if defined(CONFIG_CMD_FDOS)
 
@@ -792,19 +789,19 @@ 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;
+               addr = CONFIG_SYS_LOAD_ADDR;
+               boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER;
                break;
        case 2:
                addr = simple_strtoul(argv[1], NULL, 16);
-               boot_drive=CFG_FDC_DRIVE_NUMBER;
+               boot_drive=CONFIG_SYS_FDC_DRIVE_NUMBER;
                break;
        case 3:
                addr = simple_strtoul(argv[1], NULL, 16);
                boot_drive=simple_strtoul(argv[2], NULL, 10);
                break;
        default:
-               printf ("Usage:\n%s\n", cmdtp->usage);
+               cmd_usage(cmdtp);
                return 1;
        }
        /* setup FDC and scan for drives  */
@@ -903,18 +900,9 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return rcode;
 }
 
-
-#endif
-
-
-/***************************************************/
-
-
-#if defined(CONFIG_CMD_FDC)
-
 U_BOOT_CMD(
        fdcboot,        3,      1,      do_fdcboot,
-       "fdcboot - boot from floppy device\n",
-       "loadAddr drive\n"
+       "boot from floppy device",
+       "loadAddr drive"
 );
 #endif