]> git.hungrycats.org Git - linux/commitdiff
[PATCH] add default ARM/ARM26 IDE host driver
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>
Wed, 19 May 2004 00:14:31 +0000 (17:14 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 19 May 2004 00:14:31 +0000 (17:14 -0700)
Add drivers/ide/arm/ide_arm.c for simple default IDE interfaces
and clean obsolete ide_init_default_hwifs() implementations
in asm-arm/arch-{cl7500,rpc,shark}/ide.h and asm-arm26/ide.h.

This allows us to kill ide_init_default_hwifs() completely
in the next patch (because lh7a40x and sa1100 are broken).

Cross-compile tested on ARM.

drivers/ide/Kconfig
drivers/ide/Makefile
drivers/ide/arm/ide_arm.c [new file with mode: 0644]
drivers/ide/ide.c
include/asm-arm/arch-cl7500/ide.h
include/asm-arm/arch-rpc/ide.h
include/asm-arm/arch-shark/ide.h
include/asm-arm26/ide.h

index 6e9badb854c0f95d45e1f9ccdc9d23b1cbf84117..ee9873d9c82e86221d4a032e437f14dc8c4b0c9b 100644 (file)
@@ -855,6 +855,9 @@ config BLK_DEV_IDE_SWARM
        bool "SWARM onboard IDE support"
        depends on SIBYTE_SWARM
 
+config IDE_ARM
+       def_bool ARM && (ARCH_A5K || ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
+
 config BLK_DEV_IDE_ICSIDE
        tristate "ICS IDE interface support"
        depends on ARM && ARCH_ACORN
index 7cc48f1f4c6aaa89b43195242823759c6c9f1828..ebddf0761b9eaafa2c2fdf22b57b0adf7cd3448e 100644 (file)
@@ -25,6 +25,9 @@ ide-core-$(CONFIG_BLK_DEV_IDE_TCQ)    += ide-tcq.o
 ide-core-$(CONFIG_PROC_FS)             += ide-proc.o
 ide-core-$(CONFIG_BLK_DEV_IDEPNP)      += ide-pnp.o
 
+# built-in only drivers from arm/
+ide-core-$(CONFIG_IDE_ARM)             += arm/ide_arm.o
+
 # built-in only drivers from legacy/
 ide-core-$(CONFIG_BLK_DEV_IDE_PC9800)  += legacy/pc9800.o
 ide-core-$(CONFIG_BLK_DEV_BUDDHA)      += legacy/buddha.o
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
new file mode 100644 (file)
index 0000000..23488c4
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * ARM/ARM26 default IDE host driver
+ *
+ * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
+ * Based on code by: Russell King, Ian Molton and Alexander Schulz.
+ *
+ * May be copied or modified under the terms of the GNU General Public License.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/ide.h>
+
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+
+#ifdef CONFIG_ARM26
+# define IDE_ARM_HOST  (machine_is_a5k())
+#else
+# define IDE_ARM_HOST  (1)
+#endif
+
+#ifdef CONFIG_ARCH_CLPS7500
+# include <asm/arch/hardware.h>
+#
+# define IDE_ARM_IO    (ISASLOT_IO + 0x1f0)
+# define IDE_ARM_IRQ   IRQ_ISA_14
+#else
+# define IDE_ARM_IO    0x1f0
+# define IDE_ARM_IRQ   IRQ_HARDDISK
+#endif
+
+void __init ide_arm_init(void)
+{
+       if (IDE_ARM_HOST) {
+               hw_regs_t hw;
+
+               memset(&hw, 0, sizeof(hw));
+               ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
+               hw.irq = IDE_ARM_IRQ;
+               ide_register_hw(&hw, NULL);
+       }
+}
index 4e2b9934b7a47cd45de96d7ab93a68ed65a53d81..ee2f5b25ec612187cc9592eee507690e416b790b 100644 (file)
@@ -272,6 +272,8 @@ static void init_hwif_default(ide_hwif_t *hwif, unsigned int index)
 #endif
 }
 
+extern void ide_arm_init(void);
+
 /*
  * init_ide_data() sets reasonable default values into all fields
  * of all instances of the hwifs and drives, but only on the first call.
@@ -320,6 +322,9 @@ static void __init init_ide_data (void)
        ide_init_default_hwifs();
        initializing = 0;
 #endif
+#ifdef CONFIG_IDE_ARM
+       ide_arm_init();
+#endif
 }
 
 /*
index 78f97a3b292d089e5446db1d8e4ae31307dc5dbc..db8b68f3ef4939e2c969c4d1068b4fe8eb9b64b2 100644 (file)
@@ -6,8 +6,6 @@
  * Modifications:
  *  29-07-1998 RMK     Major re-work of IDE architecture specific code
  */
-#include <asm/irq.h>
-#include <asm/arch/hardware.h>
 
 /*
  * Set up a hw structure for a specified data port, control port and IRQ.
@@ -35,16 +33,4 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
        hw->io_ports[IDE_IRQ_OFFSET] = 0;
 }
 
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static __inline__ void
-ide_init_default_hwifs(void)
-{
-       hw_regs_t hw;
-
-       ide_init_hwif_ports(&hw, ISASLOT_IO + 0x1f0, ISASLOT_IO + 0x3f6, NULL);
-       hw.irq = IRQ_ISA_14;
-       ide_register_hw(&hw);
-}
+static inline void ide_init_default_hwifs(void) { ; }
index 92c7030ab4f12fcad5b31f13456f1fb476cc0579..b7595a85c01081079760ebbefa7af2367304aa35 100644 (file)
@@ -10,7 +10,6 @@
  *  Modifications:
  *   29-07-1998        RMK     Major re-work of IDE architecture specific code
  */
-#include <asm/irq.h>
 
 /*
  * Set up a hw structure for a specified data port, control port and IRQ.
@@ -33,16 +32,4 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
                *irq = 0;
 }
 
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static __inline__ void
-ide_init_default_hwifs(void)
-{
-       hw_regs_t hw;
-
-       ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
-       hw.irq = IRQ_HARDDISK;
-       ide_register_hw(&hw, NULL);
-}
+static inline void ide_init_default_hwifs(void) { ; }
index f6a99b22fabb7c3b7ed0329d7bca8000d8cb8e46..3aa231a9e7c61d11648905774888cc87e75dde23 100644 (file)
@@ -8,8 +8,6 @@
  * Copyright (c) 1998 Russell King
  */
 
-#include <asm/irq.h>
-
 /*
  * Set up a hw structure for a specified data port, control port and IRQ.
  * This should follow whatever the default interface uses.
@@ -31,17 +29,4 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
                *irq = 0;
 }
 
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static __inline__ void
-ide_init_default_hwifs(void)
-{
-       hw_regs_t hw;
-
-       ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
-       hw.irq = 14;
-       ide_register_hw(&hw,NULL);
-}
-
+static inline void ide_init_default_hwifs(void) { ; }
index 3a3a6fdfeabf59b2bdb44f7864bdb2eb1ff2b7e6..ae0b3b0143a261d0618cead6c343d641d3cb1a28 100644 (file)
@@ -47,23 +47,7 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
 
 #define ide_init_default_irq(base)     (0)
 
-/*
- * This registers the standard ports for this architecture with the IDE
- * driver.
- */
-static __inline__ void ide_init_default_hwifs(void)
-{
-        if (machine_is_a5k()) {
-                hw_regs_t hw;
-
-                memset(&hw, 0, sizeof(hw));
-
-                ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, NULL);
-                hw.irq = IRQ_HARDDISK;
-                ide_register_hw(&hw,NULL);
-        }
-}
-
+static inline void ide_init_default_hwifs(void) { ; }
 
 /*
  * We always use the new IDE port registering,