aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/at91_ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/at91_ide.c')
-rw-r--r--drivers/ide/at91_ide.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/drivers/ide/at91_ide.c b/drivers/ide/at91_ide.c
index 27547121daf..8eda552326e 100644
--- a/drivers/ide/at91_ide.c
+++ b/drivers/ide/at91_ide.c
@@ -192,15 +192,9 @@ static void at91_ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
192 struct ide_taskfile *tf = &cmd->tf; 192 struct ide_taskfile *tf = &cmd->tf;
193 u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF; 193 u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
194 194
195 if (cmd->tf_flags & IDE_FTFLAG_FLAGGED) 195 if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED)
196 HIHI = 0xFF; 196 HIHI = 0xFF;
197 197
198 if (cmd->tf_flags & IDE_FTFLAG_OUT_DATA) {
199 u16 data = (tf->hob_data << 8) | tf->data;
200
201 at91_ide_output_data(drive, NULL, &data, 2);
202 }
203
204 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) 198 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
205 ide_mm_outb(tf->hob_feature, io_ports->feature_addr); 199 ide_mm_outb(tf->hob_feature, io_ports->feature_addr);
206 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) 200 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
@@ -233,19 +227,11 @@ static void at91_ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
233 struct ide_io_ports *io_ports = &hwif->io_ports; 227 struct ide_io_ports *io_ports = &hwif->io_ports;
234 struct ide_taskfile *tf = &cmd->tf; 228 struct ide_taskfile *tf = &cmd->tf;
235 229
236 if (cmd->tf_flags & IDE_FTFLAG_IN_DATA) {
237 u16 data;
238
239 at91_ide_input_data(drive, NULL, &data, 2);
240 tf->data = data & 0xff;
241 tf->hob_data = (data >> 8) & 0xff;
242 }
243
244 /* be sure we're looking at the low order bits */ 230 /* be sure we're looking at the low order bits */
245 ide_mm_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); 231 ide_mm_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
246 232
247 if (cmd->tf_flags & IDE_TFLAG_IN_FEATURE) 233 if (cmd->tf_flags & IDE_TFLAG_IN_ERROR)
248 tf->feature = ide_mm_inb(io_ports->feature_addr); 234 tf->error = ide_mm_inb(io_ports->feature_addr);
249 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) 235 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT)
250 tf->nsect = ide_mm_inb(io_ports->nsect_addr); 236 tf->nsect = ide_mm_inb(io_ports->nsect_addr);
251 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) 237 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL)
@@ -258,18 +244,18 @@ static void at91_ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
258 tf->device = ide_mm_inb(io_ports->device_addr); 244 tf->device = ide_mm_inb(io_ports->device_addr);
259 245
260 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 246 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
261 ide_mm_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); 247 ide_mm_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
262 248
263 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 249 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR)
264 tf->hob_feature = ide_mm_inb(io_ports->feature_addr); 250 tf->hob_error = ide_mm_inb(io_ports->feature_addr);
265 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT) 251 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
266 tf->hob_nsect = ide_mm_inb(io_ports->nsect_addr); 252 tf->hob_nsect = ide_mm_inb(io_ports->nsect_addr);
267 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL) 253 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
268 tf->hob_lbal = ide_mm_inb(io_ports->lbal_addr); 254 tf->hob_lbal = ide_mm_inb(io_ports->lbal_addr);
269 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM) 255 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
270 tf->hob_lbam = ide_mm_inb(io_ports->lbam_addr); 256 tf->hob_lbam = ide_mm_inb(io_ports->lbam_addr);
271 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH) 257 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
272 tf->hob_lbah = ide_mm_inb(io_ports->lbah_addr); 258 tf->hob_lbah = ide_mm_inb(io_ports->lbah_addr);
273 } 259 }
274} 260}
275 261
@@ -295,8 +281,9 @@ static const struct ide_tp_ops at91_ide_tp_ops = {
295 .exec_command = ide_exec_command, 281 .exec_command = ide_exec_command,
296 .read_status = ide_read_status, 282 .read_status = ide_read_status,
297 .read_altstatus = ide_read_altstatus, 283 .read_altstatus = ide_read_altstatus,
298 .set_irq = ide_set_irq, 284 .write_devctl = ide_write_devctl,
299 285
286 .dev_select = ide_dev_select,
300 .tf_load = at91_ide_tf_load, 287 .tf_load = at91_ide_tf_load,
301 .tf_read = at91_ide_tf_read, 288 .tf_read = at91_ide_tf_read,
302 289