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
);
45 * This registers the standard ports for this architecture with the IDE
48 static __inline__
void
49 ide_init_default_hwifs(void)
53 #if defined( CONFIG_SA1100_EMPEG )
54 /* First, do the SA1100 setup */
59 /* Issue 3 is much neater than issue 2 */
60 GPDR
&=~(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
62 /* Interrupts on rising edge: lines are inverted before they get to
64 GRER
&=~(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
65 GFER
|=(EMPEG_IDE1IRQ
|EMPEG_IDE2IRQ
);
67 /* Take hard drives out of reset */
68 GPSR
=(EMPEG_IDERESET
);
73 /* Sonja and her successors have two IDE ports. */
74 /* MAC 23/4/1999, swap these round so that the left hand
75 hard disk is hda when viewed from the front. This
76 doesn't match the silkscreen however. */
77 ide_init_hwif_ports(&hw
,0x10,0x1e,NULL
);
78 hw
.irq
= EMPEG_IRQ_IDE2
;
79 ide_register_hw(&hw
, NULL
);
80 ide_init_hwif_ports(&hw
,0x00,0x0e,NULL
);
81 hw
.irq
= EMPEG_IRQ_IDE1
;
82 ide_register_hw(&hw
, NULL
);
84 #elif defined( CONFIG_SA1100_VICTOR )
85 /* Enable appropriate GPIOs as interrupt lines */
90 /* set the pcmcia interface timing */
93 ide_init_hwif_ports(&hw
, 0x1f0, 0x3f6, NULL
);
95 ide_register_hw(&hw
, NULL
);
97 #error Missing IDE interface definition in include/asm/arch/ide.h