aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/falconide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/falconide.c')
-rw-r--r--drivers/ide/legacy/falconide.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index 85b69a82825f..f044048903b3 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -33,22 +33,8 @@
33 * Offsets from the above base 33 * Offsets from the above base
34 */ 34 */
35 35
36#define ATA_HD_DATA 0x00
37#define ATA_HD_ERROR 0x05 /* see err-bits */
38#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */
39#define ATA_HD_SECTOR 0x0d /* starting sector */
40#define ATA_HD_LCYL 0x11 /* starting cylinder */
41#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */
42#define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */
43#define ATA_HD_STATUS 0x1d /* see status-bits */
44#define ATA_HD_CONTROL 0x39 36#define ATA_HD_CONTROL 0x39
45 37
46static int falconide_offsets[IDE_NR_PORTS] __initdata = {
47 ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL,
48 ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1
49};
50
51
52 /* 38 /*
53 * falconide_intr_lock is used to obtain access to the IDE interrupt, 39 * falconide_intr_lock is used to obtain access to the IDE interrupt,
54 * which is shared between several drivers. 40 * which is shared between several drivers.
@@ -57,6 +43,22 @@ static int falconide_offsets[IDE_NR_PORTS] __initdata = {
57int falconide_intr_lock; 43int falconide_intr_lock;
58EXPORT_SYMBOL(falconide_intr_lock); 44EXPORT_SYMBOL(falconide_intr_lock);
59 45
46static void __init falconide_setup_ports(hw_regs_t *hw)
47{
48 int i;
49
50 memset(hw, 0, sizeof(*hw));
51
52 hw->io_ports[IDE_DATA_OFFSET] = ATA_HD_BASE;
53
54 for (i = 1; i < 8; i++)
55 hw->io_ports[i] = ATA_HD_BASE + 1 + i * 4;
56
57 hw->io_ports[IDE_CONTROL_OFFSET] = ATA_HD_CONTROL;
58
59 hw->irq = IRQ_MFP_IDE;
60 hw->ack_intr = NULL;
61}
60 62
61 /* 63 /*
62 * Probe for a Falcon IDE interface 64 * Probe for a Falcon IDE interface
@@ -64,16 +66,15 @@ EXPORT_SYMBOL(falconide_intr_lock);
64 66
65static int __init falconide_init(void) 67static int __init falconide_init(void)
66{ 68{
67 if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
68 hw_regs_t hw; 69 hw_regs_t hw;
69 ide_hwif_t *hwif; 70 ide_hwif_t *hwif;
70 71
72 if (!MACH_IS_ATARI || !ATARIHW_PRESENT(IDE))
73 return 0;
74
71 printk(KERN_INFO "ide: Falcon IDE controller\n"); 75 printk(KERN_INFO "ide: Falcon IDE controller\n");
72 76
73 ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets, 77 falconide_setup_ports(&hw);
74 0, 0, NULL,
75// falconide_iops,
76 IRQ_MFP_IDE);
77 78
78 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); 79 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
79 if (hwif) { 80 if (hwif) {
@@ -85,9 +86,8 @@ static int __init falconide_init(void)
85 86
86 ide_device_add(idx, NULL); 87 ide_device_add(idx, NULL);
87 } 88 }
88 }
89 89
90 return 0; 90 return 0;
91} 91}
92 92
93module_init(falconide_init); 93module_init(falconide_init);