aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-h8300.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-h8300.c')
-rw-r--r--drivers/ide/ide-h8300.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/drivers/ide/ide-h8300.c b/drivers/ide/ide-h8300.c
index ff8339ed59ab..dac9a6d44963 100644
--- a/drivers/ide/ide-h8300.c
+++ b/drivers/ide/ide-h8300.c
@@ -54,9 +54,6 @@ static void h8300_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
54 if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) 54 if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED)
55 HIHI = 0xFF; 55 HIHI = 0xFF;
56 56
57 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA)
58 mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr);
59
60 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) 57 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
61 outb(tf->hob_feature, io_ports->feature_addr); 58 outb(tf->hob_feature, io_ports->feature_addr);
62 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) 59 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
@@ -90,18 +87,11 @@ static void h8300_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
90 struct ide_io_ports *io_ports = &hwif->io_ports; 87 struct ide_io_ports *io_ports = &hwif->io_ports;
91 struct ide_taskfile *tf = &cmd->tf; 88 struct ide_taskfile *tf = &cmd->tf;
92 89
93 if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) {
94 u16 data = mm_inw(io_ports->data_addr);
95
96 tf->data = data & 0xff;
97 tf->hob_data = (data >> 8) & 0xff;
98 }
99
100 /* be sure we're looking at the low order bits */ 90 /* be sure we're looking at the low order bits */
101 outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); 91 outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
102 92
103 if (cmd->tf_flags & IDE_TFLAG_IN_FEATURE) 93 if (cmd->tf_flags & IDE_TFLAG_IN_ERROR)
104 tf->feature = inb(io_ports->feature_addr); 94 tf->error = inb(io_ports->feature_addr);
105 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) 95 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT)
106 tf->nsect = inb(io_ports->nsect_addr); 96 tf->nsect = inb(io_ports->nsect_addr);
107 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) 97 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL)
@@ -114,18 +104,18 @@ static void h8300_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
114 tf->device = inb(io_ports->device_addr); 104 tf->device = inb(io_ports->device_addr);
115 105
116 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 106 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
117 outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); 107 outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
118 108
119 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 109 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR)
120 tf->hob_feature = inb(io_ports->feature_addr); 110 tf->hob_error = inb(io_ports->feature_addr);
121 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT) 111 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
122 tf->hob_nsect = inb(io_ports->nsect_addr); 112 tf->hob_nsect = inb(io_ports->nsect_addr);
123 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL) 113 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
124 tf->hob_lbal = inb(io_ports->lbal_addr); 114 tf->hob_lbal = inb(io_ports->lbal_addr);
125 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM) 115 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
126 tf->hob_lbam = inb(io_ports->lbam_addr); 116 tf->hob_lbam = inb(io_ports->lbam_addr);
127 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH) 117 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
128 tf->hob_lbah = inb(io_ports->lbah_addr); 118 tf->hob_lbah = inb(io_ports->lbah_addr);
129 } 119 }
130} 120}
131 121
@@ -159,9 +149,9 @@ static const struct ide_tp_ops h8300_tp_ops = {
159 .exec_command = ide_exec_command, 149 .exec_command = ide_exec_command,
160 .read_status = ide_read_status, 150 .read_status = ide_read_status,
161 .read_altstatus = ide_read_altstatus, 151 .read_altstatus = ide_read_altstatus,
152 .write_devctl = ide_write_devctl,
162 153
163 .set_irq = ide_set_irq, 154 .dev_select = ide_dev_select,
164
165 .tf_load = h8300_tf_load, 155 .tf_load = h8300_tf_load,
166 .tf_read = h8300_tf_read, 156 .tf_read = h8300_tf_read,
167 157