Commit 20ebd12c authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] add default ARM/ARM26 IDE host driver

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.
parent 1487e210
......@@ -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
......
......@@ -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
......
/*
* 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);
}
}
......@@ -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
}
/*
......
......@@ -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) { ; }
......@@ -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) { ; }
......@@ -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) { ; }
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment