net: Adds Fast Ethernet Controller driver for Armada100
[oweals/u-boot.git] / drivers / pcmcia / ti_pci1410a.c
index c876d0c402556126d2953af71f30ac35b297be51..cdb0fe3d49c284e98fb47629b8447d7ba0f525c1 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2000-2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB
+ * Daniel Engström, Omicron Ceti AB
  *
  * See file CREDITS for list of people who contributed to this
  * project.
 
 int pcmcia_on(int ide_base_bus);
 
-static int  pcmcia_off(void);
 static int  hardware_disable(int slot);
 static int  hardware_enable(int slot);
 static int  voltage_set(int slot, int vcc, int vpp);
 static void print_funcid(int func);
-static void print_fixed(volatile uchar *p);
-static int  identify(volatile uchar *p);
+static void print_fixed(volatile char *p);
+static int  identify(volatile char *p);
 static int  check_ide_device(int slot, int ide_base_bus);
 
 
@@ -86,33 +85,6 @@ const char *indent = "\t   ";
 /* ------------------------------------------------------------------------- */
 
 
-int do_pinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-#ifndef CFG_FIRST_PCMCIA_BUS
-# define CFG_FIRST_PCMCIA_BUS 0
-#endif
-
-       int rcode = 0;
-
-       if (argc != 2) {
-               printf ("Usage: pinit {on | off}\n");
-               return 1;
-       }
-       if (strcmp(argv[1],"on") == 0) {
-               rcode = pcmcia_on(CFG_FIRST_PCMCIA_BUS);
-       } else if (strcmp(argv[1],"off") == 0) {
-               rcode = pcmcia_off();
-       } else {
-               printf ("Usage: pinit {on | off}\n");
-               return 1;
-       }
-
-       return rcode;
-}
-
-/* ------------------------------------------------------------------------- */
-
-
 static struct pci_device_id supported[] = {
        { PCI_VENDOR_ID_TI, 0xac50 }, /* Ti PCI1410A */
        { PCI_VENDOR_ID_TI, 0xac56 }, /* Ti PCI1510 */
@@ -148,11 +120,11 @@ int pcmcia_on(int ide_base_bus)
                debug("Enable PCMCIA Ti PCI1410A\n");
        }
 
-       pcmcia_cis_ptr = CFG_PCMCIA_CIS_WIN;
-       cis_len = CFG_PCMCIA_CIS_WIN_SIZE;
+       pcmcia_cis_ptr = CONFIG_SYS_PCMCIA_CIS_WIN;
+       cis_len = CONFIG_SYS_PCMCIA_CIS_WIN_SIZE;
 
-       io_base = CFG_PCMCIA_IO_WIN;
-       io_len = CFG_PCMCIA_IO_WIN_SIZE;
+       io_base = CONFIG_SYS_PCMCIA_IO_WIN;
+       io_len = CONFIG_SYS_PCMCIA_IO_WIN_SIZE;
 
        /*
         * Setup the PCI device.
@@ -245,7 +217,8 @@ int pcmcia_on(int ide_base_bus)
 /* ------------------------------------------------------------------------- */
 
 
-static int pcmcia_off (void)
+#if defined(CONFIG_CMD_PCMCIA)
+int pcmcia_off (void)
 {
        int slot = 0;
 
@@ -285,6 +258,7 @@ static int pcmcia_off (void)
        return 0;
 }
 
+#endif
 
 /* ------------------------------------------------------------------------- */
 
@@ -294,9 +268,9 @@ static int pcmcia_off (void)
 int ide_devices_found;
 static int check_ide_device(int slot, int ide_base_bus)
 {
-       volatile uchar *ident = NULL;
-       volatile uchar *feature_p[MAX_FEATURES];
-       volatile uchar *p, *start;
+       volatile char *ident = NULL;
+       volatile char *feature_p[MAX_FEATURES];
+       volatile char *p, *start;
        int n_features = 0;
        uchar func_id = ~0;
        uchar code, len;
@@ -314,7 +288,7 @@ static int check_ide_device(int slot, int ide_base_bus)
                return 1;
        }
 
-       start = p = (volatile uchar *) pcmcia_cis_ptr;
+       start = p = (volatile char *) pcmcia_cis_ptr;
 
        while ((p - start) < MAX_TUPEL_SZ) {
 
@@ -417,7 +391,7 @@ static int voltage_set(int slot, int vcc, int vpp)
                socket_control |= 0x30;
                break;
        case 0:
-       default:
+       default: ;
        }
 
        switch (vpp) {
@@ -431,7 +405,7 @@ static int voltage_set(int slot, int vcc, int vpp)
                socket_control |= 0x3;
                break;
        case 0:
-       default:
+       default: ;
        }
 
        writel(socket_control, reg);
@@ -537,7 +511,7 @@ static void print_funcid(int func)
 
 /* ------------------------------------------------------------------------- */
 
-static void print_fixed(volatile uchar *p)
+static void print_fixed(volatile char *p)
 {
        if (p == NULL)
                return;
@@ -605,17 +579,17 @@ static void print_fixed(volatile uchar *p)
 #define MAX_IDENT_CHARS                64
 #define        MAX_IDENT_FIELDS        4
 
-static uchar *known_cards[] = {
+static char *known_cards[] = {
        "ARGOSY PnPIDE D5",
        NULL
 };
 
-static int identify(volatile uchar *p)
+static int identify(volatile char *p)
 {
-       uchar id_str[MAX_IDENT_CHARS];
-       uchar data;
-       uchar *t;
-       uchar **card;
+       char id_str[MAX_IDENT_CHARS];
+       char data;
+       char *t;
+       char **card;
        int i, done;
 
        if (p == NULL)