blob: 82643df7c49aff546d487fd81067b180ea153441 [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
Bartlomiej Zolnierkiewiczade2daf2008-01-26 20:13:07 +010027static int __init ide_arm_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070028{
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010029 ide_hwif_t *hwif;
Adrian Bunk99eb8a52007-07-31 00:38:19 -070030 hw_regs_t hw;
Bartlomiej Zolnierkiewicz8ac4ce72008-01-26 20:13:06 +010031 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Adrian Bunk99eb8a52007-07-31 00:38:19 -070033 memset(&hw, 0, sizeof(hw));
34 ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
35 hw.irq = IDE_ARM_IRQ;
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010036
Bartlomiej Zolnierkiewicz59bff5b2008-04-26 17:36:32 +020037 hwif = ide_find_port();
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010038 if (hwif) {
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010039 ide_init_port_hw(hwif, &hw);
Bartlomiej Zolnierkiewicz8ac4ce72008-01-26 20:13:06 +010040 idx[0] = hwif->index;
41
Bartlomiej Zolnierkiewiczc413b9b2008-02-02 19:56:31 +010042 ide_device_add(idx, NULL);
Bartlomiej Zolnierkiewiczcbb010c2008-01-26 20:13:06 +010043 }
Bartlomiej Zolnierkiewiczade2daf2008-01-26 20:13:07 +010044
45 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070046}
Bartlomiej Zolnierkiewiczade2daf2008-01-26 20:13:07 +010047
48module_init(ide_arm_init);
Adrian Bunk57ad3ea02008-04-02 21:22:03 +020049
50MODULE_LICENSE("GPL");