Linux 2.6.20.13
[linux/fpc-iii.git] / include / asm-arm / arch-sa1100 / ide.h
blob98b10bcf9f1b87d44058bed3c1f9753415fd1de8
1 /*
2 * linux/include/asm-arm/arch-sa1100/ide.h
4 * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
6 * 18-aug-2000: Cleanup by Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
7 * Get rid of the special ide_init_hwif_ports() functions
8 * and make a generalised function that can be used by all
9 * architectures.
12 #include <asm/irq.h>
13 #include <asm/hardware.h>
14 #include <asm/mach-types.h>
16 #error "This code is broken and needs update to match with current ide support"
20 * Set up a hw structure for a specified data port, control port and IRQ.
21 * This should follow whatever the default interface uses.
23 static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
24 unsigned long ctrl_port, int *irq)
26 unsigned long reg = data_port;
27 int i;
28 int regincr = 1;
30 /* The Empeg board has the first two address lines unused */
31 if (machine_is_empeg())
32 regincr = 1 << 2;
34 /* The LART doesn't use A0 for IDE */
35 if (machine_is_lart())
36 regincr = 1 << 1;
38 memset(hw, 0, sizeof(*hw));
40 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
41 hw->io_ports[i] = reg;
42 reg += regincr;
45 hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
47 if (irq)
48 *irq = 0;
52 * This registers the standard ports for this architecture with the IDE
53 * driver.
55 static __inline__ void
56 ide_init_default_hwifs(void)
58 if (machine_is_lart()) {
59 #ifdef CONFIG_SA1100_LART
60 hw_regs_t hw;
62 /* Enable GPIO as interrupt line */
63 GPDR &= ~LART_GPIO_IDE;
64 set_irq_type(LART_IRQ_IDE, IRQT_RISING);
66 /* set PCMCIA interface timing */
67 MECR = 0x00060006;
69 /* init the interface */
70 ide_init_hwif_ports(&hw, PCMCIA_IO_0_BASE + 0x0000, PCMCIA_IO_0_BASE + 0x1000, NULL);
71 hw.irq = LART_IRQ_IDE;
72 ide_register_hw(&hw);
73 #endif