1 /*
2 * linux/include/asm-arm/arch-anakin/ide.h
3 *
4 * Copyright 2001 Blue Mug Inc. for Acunia N.V.
5 *
6 * 08-jun-2001: Initial clone of arch-sa1100/ide.h by Jon McClintock
7 * (jonm@bluemug.com).
8 */
9
10 #include <asm/irq.h>
11 #include <asm/hardware.h>
12
13 /*
14 * Set up a hw structure for a specified data port, control port and IRQ.
15 * This should follow whatever the default interface uses.
16 */
17 static __inline__ void
ide_init_hwif_ports(hw_regs_t * hw,int data_port,int ctrl_port,int * irq)18 ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
19 {
20 ide_ioreg_t reg;
21 int i;
22 int regincr = 4;
23
24 memset(hw, 0, sizeof(*hw));
25
26 reg = (ide_ioreg_t)data_port;
27
28 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
29 hw->io_ports[i] = reg;
30 reg += regincr;
31 }
32
33 hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
34
35 if (irq)
36 *irq = 0;
37 }
38
39
40 /*
41 * This registers the standard ports for this architecture with the IDE
42 * driver.
43 */
44 static __inline__ void
ide_init_default_hwifs(void)45 ide_init_default_hwifs(void)
46 {
47 hw_regs_t hw;
48
49 ide_init_hwif_ports(&hw, IO_BASE + COMPACTFLASH,
50 IO_BASE + COMPACTFLASH + IDE_CONTROL_OFFSET, NULL);
51 hw.irq = IRQ_COMPACTFLASH;
52 ide_register_hw(&hw, NULL);
53 }
54
55
56