1 /* include/asm-arm/arch-lh7a40x/ide.h
3 * Copyright (C) 2004 Logic Product Development
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
11 #ifndef __ASM_ARCH_IDE_H
12 #define __ASM_ARCH_IDE_H
14 #if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
16 /* This implementation of ide.h only applies to the LPD CardEngines.
17 * Thankfully, there is less to do for the KEV.
20 #include <linux/config.h>
22 #include <asm/hardware.h>
23 #include <asm/arch/registers.h>
25 #define IDE_REG_LINE (1<<12) /* A12 drives !REG */
26 #define IDE_ALT_LINE (1<<11) /* Unused A11 allows non-overlapping regions */
27 #define IDE_CONTROLREG_OFFSET (0xe)
29 void lpd7a40x_hwif_ioops (struct hwif_s* hwif);
31 static __inline__ void ide_init_hwif_ports (hw_regs_t *hw, int data_port,
32 int ctrl_port, int *irq)
38 memset (hw, 0, sizeof (*hw));
40 reg = (ide_ioreg_t) data_port;
42 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
43 hw->io_ports[i] = reg;
47 hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
53 static __inline__ void ide_init_default_hwifs (void)
58 ide_init_hwif_ports (&hw,
59 CF_VIRT + IDE_REG_LINE,
60 CF_VIRT + IDE_REG_LINE + IDE_ALT_LINE
61 + IDE_CONTROLREG_OFFSET,
64 ide_register_hw (&hw, &hwif);
65 lpd7a40x_hwif_ioops (hwif); /* Override IO routines */