summaryrefslogtreecommitdiff
path: root/common/cmd_pcmcia.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-05-18 11:30:09 +0000
committerwdenk <wdenk>2003-05-18 11:30:09 +0000
commit66fd3d1ce732d9168d6a056986231ada8dfa500e (patch)
tree4b0d3f9094ef6525c631baf01268d21317496e81 /common/cmd_pcmcia.c
parent45219c46605f9b933ab454738ee4ce543d5b70d6 (diff)
Add support for CompactFlash on ATC board
(includes support for Intel 82365 and compatible PC Card controllers, and Yenta-compatible PCI-to-CardBus controllers)
Diffstat (limited to 'common/cmd_pcmcia.c')
-rw-r--r--common/cmd_pcmcia.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c
index c009156af30..cb7600c2af2 100644
--- a/common/cmd_pcmcia.c
+++ b/common/cmd_pcmcia.c
@@ -72,16 +72,20 @@ int pcmcia_on (void);
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
static int pcmcia_off (void);
+#endif
+
+#ifdef CONFIG_I82365
+
+extern int i82365_init (void);
+extern void i82365_exit (void);
+
+#else /* ! CONFIG_I82365 */
+
+#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
static int hardware_disable(int slot);
#endif
static int hardware_enable (int slot);
static int voltage_set(int slot, int vcc, int vpp);
-#ifdef CONFIG_IDE_8xx_PCCARD
-static void print_funcid (int func);
-static void print_fixed (volatile uchar *p);
-static int identify (volatile uchar *p);
-static int check_ide_device (int slot);
-#endif /* CONFIG_IDE_8xx_PCCARD */
static u_int m8xx_get_graycode(u_int size);
#if 0
@@ -99,6 +103,15 @@ static u_int *pcmcia_pgcrx[2] = {
#define PCMCIA_PGCRX(slot) (*pcmcia_pgcrx[slot])
+#endif /* CONFIG_I82365 */
+
+#ifdef CONFIG_IDE_8xx_PCCARD
+static void print_funcid (int func);
+static void print_fixed (volatile uchar *p);
+static int identify (volatile uchar *p);
+static int check_ide_device (int slot);
+#endif /* CONFIG_IDE_8xx_PCCARD */
+
const char *indent = "\t ";
/* -------------------------------------------------------------------- */
@@ -128,6 +141,24 @@ int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* -------------------------------------------------------------------- */
+#ifdef CONFIG_I82365
+int pcmcia_on (void)
+{
+ u_int rc;
+
+ debug ("Enable PCMCIA " PCMCIA_SLOT_MSG "\n");
+
+ rc = i82365_init();
+
+ if (rc == 0)
+ {
+ rc = check_ide_device(0);
+ }
+
+ return (rc);
+}
+#else
+
#if defined(CONFIG_LWMON)
# define CFG_PCMCIA_TIMING (PCMCIA_SHT(9) | PCMCIA_SST(3) | PCMCIA_SL(12))
#else
@@ -222,11 +253,22 @@ int pcmcia_on (void)
}
return (rc);
}
+#endif /* CONFIG_I82365 */
/* -------------------------------------------------------------------- */
#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+#ifdef CONFIG_I82365
+static int pcmcia_off (void)
+{
+ printf ("Disable PCMCIA " PCMCIA_SLOT_MSG "\n");
+
+ i82365_exit();
+
+ return 0;
+}
+#else
static int pcmcia_off (void)
{
int i;
@@ -258,6 +300,7 @@ static int pcmcia_off (void)
hardware_disable(_slot_);
return 0;
}
+#endif /* CONFIG_I82365 */
#endif /* CFG_CMD_PCMCIA */