2 * linux/include/asm-arm/arch-sa1100/ide.h
4 * Copyright (c) 1998 Hugo Fiennes & Nicolas Pitre
8 #include <linux/config.h>
10 #ifdef CONFIG_BLK_DEV_IDE
13 #include <asm/arch/hardware.h>
16 * Set up a hw structure for a specified data port, control port and IRQ.
17 * This should follow whatever the default interface uses.
19 static __inline__
void
20 ide_init_hwif_ports(hw_regs_t
*hw
, int data_port
, int ctrl_port
, int irq
)
25 memset(hw
, 0, sizeof(*hw
));
27 #ifdef CONFIG_SA1100_EMPEG
28 /* The Empeg board has the first two address lines unused */
34 reg
= (ide_ioreg_t
) (data_port
<< IO_SHIFT
);
35 for (i
= IDE_DATA_OFFSET
; i
<= IDE_STATUS_OFFSET
; i
++) {
36 hw
->io_ports
[i
] = reg
;
37 reg
+= (1 << IO_SHIFT
);
39 hw
->io_ports
[IDE_CONTROL_OFFSET
] = (ide_ioreg_t
) (ctrl_port
<< IO_SHIFT
);
44 * This registers the standard ports for this architecture with the IDE
47 static __inline__
void
48 ide_init_default_hwifs(void)
52 #if defined( CONFIG_SA1100_EMPEG )
53 /* First, do the SA1100 setup */
58 /* Issue 3 is much neater than issue 2 */
59 GPDR
&=~(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
61 /* Interrupts on rising edge: lines are inverted before they get to
63 GRER
&=~(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
64 GFER
|=(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
66 /* Take hard drives out of reset */
67 GPSR
=(EMPEG_IDERESET
);
72 /* Sonja and her successors have two IDE ports. */
73 /* MAC 23/4/1999, swap these round so that the left hand
74 hard disk is hda when viewed from the front. This
75 doesn't match the silkscreen however. */
76 ide_init_hwif_ports(&hw
,0x10,0x1e,EMPEG_IRQ_IDE2
);
77 ide_register_hw(&hw
, NULL
);
78 ide_init_hwif_ports(&hw
,0x00,0x0e,EMPEG_IRQ_IDE1
);
79 ide_register_hw(&hw
, NULL
);
81 #elif defined( CONFIG_SA1100_VICTOR )
82 /* Enable appropriate GPIOs as interrupt lines */
87 /* set the pcmcia interface timing */
90 ide_init_hwif_ports(&hw
, 0x1f0, 0x3f6, IRQ_GPIO7
);
91 ide_register_hw(&hw
, NULL
);
93 #error Missing IDE interface definition in include/asm/arch/ide.h