1 /*
2 * linux/include/asm-arm/arch-omaha/ide.h
3 *
4 * Copyright (c) 2002 ARM Limited.
5 * Copyright (c) 2000 Steve Hill (sjhill@cotw.com)
6 *
7 * Changelog:
8 * 03-29-2000 SJH Created file placeholder
9 */
10 #include <linux/config.h>
11 #include <asm/irq.h>
12 #include <asm/system.h>
13 #include <asm/arch/hardware.h>
14
15 /*
16 * Set up a hw structure for a specified data port, control port and IRQ.
17 * This should follow whatever the default interface uses.
18 */
19 static __inline__ void
ide_init_hwif_ports(hw_regs_t * hw,int data_port,int ctrl_port,int * irq)20 ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int *irq)
21 {
22 ide_ioreg_t reg;
23 int i;
24 int regincr = 1;
25
26 memset(hw, 0, sizeof(*hw));
27
28 reg = (ide_ioreg_t)data_port;
29
30 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
31
32 hw->io_ports[i] = reg;
33
34 /* Special location in nCS2 for data register, as
35 * we need to be able to do 16-bit r/w.
36 */
37
38 if(i == IDE_DATA_OFFSET)
39 hw->io_ports[i] = reg + 0x04000000;
40
41 reg += regincr;
42 }
43
44 hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
45
46 if(irq)
47 *irq = 1;
48 }
49
50 /*
51 * This registers the standard ports for this architecture with the IDE
52 * driver.
53 */
54 static __inline__ void
ide_init_default_hwifs(void)55 ide_init_default_hwifs(void)
56 {
57 hw_regs_t hw;
58
59 /* init the interface */
60 ide_init_hwif_ports(&hw, IO_ADDRESS(0x01C00000), IO_ADDRESS(0x01C00006), NULL);
61 hw.irq = 1; // pld irq really
62 ide_register_hw(&hw, NULL);
63 }
64