aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_mpiix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_mpiix.c')
-rw-r--r--drivers/ata/pata_mpiix.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index cb78b7bfe143..d5483087a3fa 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -201,7 +201,7 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
201 struct ata_port *ap; 201 struct ata_port *ap;
202 void __iomem *cmd_addr, *ctl_addr; 202 void __iomem *cmd_addr, *ctl_addr;
203 u16 idetim; 203 u16 idetim;
204 int irq; 204 int cmd, ctl, irq;
205 205
206 if (!printed_version++) 206 if (!printed_version++)
207 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n"); 207 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
@@ -209,6 +209,7 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
209 host = ata_host_alloc(&dev->dev, 1); 209 host = ata_host_alloc(&dev->dev, 1);
210 if (!host) 210 if (!host)
211 return -ENOMEM; 211 return -ENOMEM;
212 ap = host->ports[0];
212 213
213 /* MPIIX has many functions which can be turned on or off according 214 /* MPIIX has many functions which can be turned on or off according
214 to other devices present. Make sure IDE is enabled before we try 215 to other devices present. Make sure IDE is enabled before we try
@@ -220,25 +221,28 @@ static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
220 221
221 /* See if it's primary or secondary channel... */ 222 /* See if it's primary or secondary channel... */
222 if (!(idetim & SECONDARY)) { 223 if (!(idetim & SECONDARY)) {
224 cmd = 0x1F0;
225 ctl = 0x3F6;
223 irq = 14; 226 irq = 14;
224 cmd_addr = devm_ioport_map(&dev->dev, 0x1F0, 8);
225 ctl_addr = devm_ioport_map(&dev->dev, 0x3F6, 1);
226 } else { 227 } else {
228 cmd = 0x170;
229 ctl = 0x376;
227 irq = 15; 230 irq = 15;
228 cmd_addr = devm_ioport_map(&dev->dev, 0x170, 8);
229 ctl_addr = devm_ioport_map(&dev->dev, 0x376, 1);
230 } 231 }
231 232
233 cmd_addr = devm_ioport_map(&dev->dev, cmd, 8);
234 ctl_addr = devm_ioport_map(&dev->dev, ctl, 1);
232 if (!cmd_addr || !ctl_addr) 235 if (!cmd_addr || !ctl_addr)
233 return -ENOMEM; 236 return -ENOMEM;
234 237
238 ata_port_desc(ap, "cmd 0x%x ctl 0x%x", cmd, ctl);
239
235 /* We do our own plumbing to avoid leaking special cases for whacko 240 /* We do our own plumbing to avoid leaking special cases for whacko
236 ancient hardware into the core code. There are two issues to 241 ancient hardware into the core code. There are two issues to
237 worry about. #1 The chip is a bridge so if in legacy mode and 242 worry about. #1 The chip is a bridge so if in legacy mode and
238 without BARs set fools the setup. #2 If you pci_disable_device 243 without BARs set fools the setup. #2 If you pci_disable_device
239 the MPIIX your box goes castors up */ 244 the MPIIX your box goes castors up */
240 245
241 ap = host->ports[0];
242 ap->ops = &mpiix_port_ops; 246 ap->ops = &mpiix_port_ops;
243 ap->pio_mask = 0x1F; 247 ap->pio_mask = 0x1F;
244 ap->flags |= ATA_FLAG_SLAVE_POSS; 248 ap->flags |= ATA_FLAG_SLAVE_POSS;