blob: 1a03a2a285efef7081f7778056db77b15039333f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Adrian Bunk99eb8a52007-07-31 00:38:19 -07002 * ARM default IDE host driver
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Copyright (C) 2004 Bartlomiej Zolnierkiewicz
5 * Based on code by: Russell King, Ian Molton and Alexander Schulz.
6 *
7 * May be copied or modified under the terms of the GNU General Public License.
8 */
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/ide.h>
13
14#include <asm/mach-types.h>
15#include <asm/irq.h>
16
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#ifdef CONFIG_ARCH_CLPS7500
18# include <asm/arch/hardware.h>
19#
20# define IDE_ARM_IO (ISASLOT_IO + 0x1f0)
21# define IDE_ARM_IRQ IRQ_ISA_14
22#else
23# define IDE_ARM_IO 0x1f0
24# define IDE_ARM_IRQ IRQ_HARDDISK
25#endif
26
27void __init ide_arm_init(void)
28{
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010029 ide_hwif_t *hwif;
Adrian Bunk99eb8a52007-07-31 00:38:19 -070030 hw_regs_t hw;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Adrian Bunk99eb8a52007-07-31 00:38:19 -070032 memset(&hw, 0, sizeof(hw));
33 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
34 hw.irq = IDE_ARM_IRQ;
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010035
36 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
37 if (hwif) {
38 ide_init_port_data(hwif, hwif->index);
39 ide_init_port_hw(hwif, &hw);
40 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070041}