diff options
Diffstat (limited to 'drivers/ide/h8300/ide-h8300.c')
-rw-r--r-- | drivers/ide/h8300/ide-h8300.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c index ecf53bb0d2aa..20fad6d542cc 100644 --- a/drivers/ide/h8300/ide-h8300.c +++ b/drivers/ide/h8300/ide-h8300.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <asm/io.h> | 8 | #include <asm/io.h> |
9 | #include <asm/irq.h> | 9 | #include <asm/irq.h> |
10 | 10 | ||
11 | #define DRV_NAME "ide-h8300" | ||
12 | |||
11 | #define bswap(d) \ | 13 | #define bswap(d) \ |
12 | ({ \ | 14 | ({ \ |
13 | u16 r; \ | 15 | u16 r; \ |
@@ -52,8 +54,6 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task) | |||
52 | if (task->tf_flags & IDE_TFLAG_FLAGGED) | 54 | if (task->tf_flags & IDE_TFLAG_FLAGGED) |
53 | HIHI = 0xFF; | 55 | HIHI = 0xFF; |
54 | 56 | ||
55 | ide_set_irq(drive, 1); | ||
56 | |||
57 | if (task->tf_flags & IDE_TFLAG_OUT_DATA) | 57 | if (task->tf_flags & IDE_TFLAG_OUT_DATA) |
58 | mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr); | 58 | mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr); |
59 | 59 | ||
@@ -98,7 +98,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /* be sure we're looking at the low order bits */ | 100 | /* be sure we're looking at the low order bits */ |
101 | outb(drive->ctl & ~0x80, io_ports->ctl_addr); | 101 | outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); |
102 | 102 | ||
103 | if (task->tf_flags & IDE_TFLAG_IN_NSECT) | 103 | if (task->tf_flags & IDE_TFLAG_IN_NSECT) |
104 | tf->nsect = inb(io_ports->nsect_addr); | 104 | tf->nsect = inb(io_ports->nsect_addr); |
@@ -112,7 +112,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task) | |||
112 | tf->device = inb(io_ports->device_addr); | 112 | tf->device = inb(io_ports->device_addr); |
113 | 113 | ||
114 | if (task->tf_flags & IDE_TFLAG_LBA48) { | 114 | if (task->tf_flags & IDE_TFLAG_LBA48) { |
115 | outb(drive->ctl | 0x80, io_ports->ctl_addr); | 115 | outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); |
116 | 116 | ||
117 | if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) | 117 | if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) |
118 | tf->hob_feature = inb(io_ports->feature_addr); | 118 | tf->hob_feature = inb(io_ports->feature_addr); |
@@ -178,6 +178,10 @@ static inline void hwif_setup(ide_hwif_t *hwif) | |||
178 | hwif->output_data = h8300_output_data; | 178 | hwif->output_data = h8300_output_data; |
179 | } | 179 | } |
180 | 180 | ||
181 | static const struct ide_port_info h8300_port_info = { | ||
182 | .host_flags = IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_NO_DMA, | ||
183 | }; | ||
184 | |||
181 | static int __init h8300_ide_init(void) | 185 | static int __init h8300_ide_init(void) |
182 | { | 186 | { |
183 | hw_regs_t hw; | 187 | hw_regs_t hw; |
@@ -185,6 +189,8 @@ static int __init h8300_ide_init(void) | |||
185 | int index; | 189 | int index; |
186 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 190 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
187 | 191 | ||
192 | printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n"); | ||
193 | |||
188 | if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300")) | 194 | if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300")) |
189 | goto out_busy; | 195 | goto out_busy; |
190 | if (!request_region(CONFIG_H8300_IDE_ALT, H8300_IDE_GAP, "ide-h8300")) { | 196 | if (!request_region(CONFIG_H8300_IDE_ALT, H8300_IDE_GAP, "ide-h8300")) { |
@@ -194,22 +200,17 @@ static int __init h8300_ide_init(void) | |||
194 | 200 | ||
195 | hw_setup(&hw); | 201 | hw_setup(&hw); |
196 | 202 | ||
197 | hwif = ide_find_port(); | 203 | hwif = ide_find_port_slot(&h8300_port_info); |
198 | if (hwif == NULL) { | 204 | if (hwif == NULL) |
199 | printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); | ||
200 | return -ENOENT; | 205 | return -ENOENT; |
201 | } | ||
202 | 206 | ||
203 | index = hwif->index; | 207 | index = hwif->index; |
204 | ide_init_port_data(hwif, index); | ||
205 | ide_init_port_hw(hwif, &hw); | 208 | ide_init_port_hw(hwif, &hw); |
206 | hwif_setup(hwif); | 209 | hwif_setup(hwif); |
207 | hwif->host_flags = IDE_HFLAG_NO_IO_32BIT; | ||
208 | printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index); | ||
209 | 210 | ||
210 | idx[0] = index; | 211 | idx[0] = index; |
211 | 212 | ||
212 | ide_device_add(idx, NULL); | 213 | ide_device_add(idx, &h8300_port_info); |
213 | 214 | ||
214 | return 0; | 215 | return 0; |
215 | 216 | ||