patch-2.4.4 linux/arch/sh/kernel/cf-enabler.c

Next file: linux/arch/sh/kernel/entry.S
Previous file: linux/arch/sh/kernel/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/arch/sh/kernel/cf-enabler.c linux/arch/sh/kernel/cf-enabler.c
@@ -8,13 +8,41 @@
  *  Enable the CF configuration.
  */
 
+#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#include <asm/hitachi_se.h>
+#define CF_CIS_BASE	0xb8000000
+/*
+ * You can connect Compact Flash directly to the bus of SuperH.
+ * This is the enabler for that.
+ *
+ * SIM: How generic is this really? It looks pretty board, or at
+ * least SH sub-type, specific to me.
+ * I know it doesn't work on the Overdrive!
+ */
+
+/*
+ * 0xB8000000 : Attribute
+ * 0xB8001000 : Common Memory
+ * 0xBA000000 : I/O
+ */
 
+static int __init cf_init_default(void)
+{
+#ifdef CONFIG_IDE
+	/* Enable the card, and set the level interrupt */
+	ctrl_outw(0x0042, CF_CIS_BASE+0x0200);
+#endif
+	make_imask_irq(14);
+	disable_irq(14);
+	return 0;
+}
+
+#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE)
+#include <asm/hitachi_se.h>
 
 /*
  * SolutionEngine
@@ -70,37 +98,14 @@
 	ctrl_outb(0x42, PA_MRSHPC_MW2 + 0x200);
 	return 0;
 }
-
-#define CF_CIS_BASE	0xb8000000
-/*
- * You can connect Compact Flash directly to the bus of SuperH.
- * This is the enabler for that.
- *
- * SIM: How generic is this really? It looks pretty board, or at
- * least SH sub-type, specific to me.
- * I know it doesn't work on the Overdrive!
- */
-
-/*
- * 0xB8000000 : Attribute
- * 0xB8001000 : Common Memory
- * 0xBA000000 : I/O
- */
-
-static int __init cf_init_default(void)
-{
-	/* Enable the card, and set the level interrupt */
-	ctrl_outw(0x0042, CF_CIS_BASE+0x0200);
-	make_imask_irq(14);
-	disable_irq(14);
-	return 0;
-}
+#endif
 
 int __init cf_init(void)
 {
-	if (MACH_SE) {
+#if defined(CONFIG_SH_GENERIC) || defined(CONFIG_SH_SOLUTION_ENGINE)
+	if (MACH_SE)
 		return cf_init_se();
-	}
+#endif
 	return cf_init_default();
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)