2 * Copyright (c) 2003-2004 Simtec Electronics
3 * Ben Dooks <ben@simtec.co.uk>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
11 #include <linux/module.h>
12 #include <linux/errno.h>
13 #include <linux/ide.h>
14 #include <linux/init.h>
16 #include <asm/mach-types.h>
20 #include <asm/arch/map.h>
21 #include <asm/arch/bast-map.h>
22 #include <asm/arch/bast-irq.h>
24 static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
29 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
31 memset(&hw, 0, sizeof(hw));
36 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
37 hw.io_ports[i] = (unsigned long)base;
41 hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
44 hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
51 ide_unregister(i, 0, 0);
53 ide_init_port_data(hwif, i);
55 ide_init_port_hw(hwif, &hw);
56 hwif->quirkproc = NULL;
60 ide_device_add(idx, NULL);
65 static int __init bastide_init(void)
67 /* we can treat the VR1000 and the BAST the same */
69 if (!(machine_is_bast() || machine_is_vr1000()))
72 printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
74 bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
75 bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
80 module_init(bastide_init);
82 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
83 MODULE_LICENSE("GPL");
84 MODULE_DESCRIPTION("Simtec BAST / Thorcom VR1000 IDE driver");