aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_legacy.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2009-04-09 12:31:17 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-04-16 15:28:23 -0400
commite3cf95dd6d352954b663d2934110d6e30af2406d (patch)
treef3245e91c30e0c1e12a169af637373a8b5ff670a /drivers/ata/pata_legacy.c
parent62afe5d744047df8ff15a369f4c1ebad71c937d4 (diff)
ata: Report 16/32bit PIO as best we can
The legacy old IDE ioctl API for this is a bit primitive so we try and map stuff sensibly onto it. - Set PIO over DMA devices to report 32bit - Add ability to change the PIO32 settings if the controller permits it - Add that functionality into the sff drivers - Add that functionality into the VLB legacy driver - Turn on the 32bit PIO on the ninja32 and add support there Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_legacy.c')
-rw-r--r--drivers/ata/pata_legacy.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 0c6dde80417b..6f985bed8cbb 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -108,6 +108,7 @@ struct legacy_controller {
108 struct ata_port_operations *ops; 108 struct ata_port_operations *ops;
109 unsigned int pio_mask; 109 unsigned int pio_mask;
110 unsigned int flags; 110 unsigned int flags;
111 unsigned int pflags;
111 int (*setup)(struct platform_device *, struct legacy_probe *probe, 112 int (*setup)(struct platform_device *, struct legacy_probe *probe,
112 struct legacy_data *data); 113 struct legacy_data *data);
113}; 114};
@@ -285,7 +286,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
285{ 286{
286 int slop = buflen & 3; 287 int slop = buflen & 3;
287 /* 32bit I/O capable *and* we need to write a whole number of dwords */ 288 /* 32bit I/O capable *and* we need to write a whole number of dwords */
288 if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) { 289 if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)
290 && (ap->pflags & ATA_PFLAG_PIO32)) {
289 struct ata_port *ap = dev->link->ap; 291 struct ata_port *ap = dev->link->ap;
290 unsigned long flags; 292 unsigned long flags;
291 293
@@ -736,7 +738,8 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
736 struct ata_port *ap = adev->link->ap; 738 struct ata_port *ap = adev->link->ap;
737 int slop = buflen & 3; 739 int slop = buflen & 3;
738 740
739 if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) { 741 if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)
742 && (ap->pflags & ATA_PFLAG_PIO32)) {
740 if (rw == WRITE) 743 if (rw == WRITE)
741 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); 744 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
742 else 745 else
@@ -858,27 +861,30 @@ static struct ata_port_operations winbond_port_ops = {
858 861
859static struct legacy_controller controllers[] = { 862static struct legacy_controller controllers[] = {
860 {"BIOS", &legacy_port_ops, 0x1F, 863 {"BIOS", &legacy_port_ops, 0x1F,
861 ATA_FLAG_NO_IORDY, NULL }, 864 ATA_FLAG_NO_IORDY, 0, NULL },
862 {"Snooping", &simple_port_ops, 0x1F, 865 {"Snooping", &simple_port_ops, 0x1F,
863 0 , NULL }, 866 0, 0, NULL },
864 {"PDC20230", &pdc20230_port_ops, 0x7, 867 {"PDC20230", &pdc20230_port_ops, 0x7,
865 ATA_FLAG_NO_IORDY, NULL }, 868 ATA_FLAG_NO_IORDY,
869 ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, NULL },
866 {"HT6560A", &ht6560a_port_ops, 0x07, 870 {"HT6560A", &ht6560a_port_ops, 0x07,
867 ATA_FLAG_NO_IORDY, NULL }, 871 ATA_FLAG_NO_IORDY, 0, NULL },
868 {"HT6560B", &ht6560b_port_ops, 0x1F, 872 {"HT6560B", &ht6560b_port_ops, 0x1F,
869 ATA_FLAG_NO_IORDY, NULL }, 873 ATA_FLAG_NO_IORDY, 0, NULL },
870 {"OPTI82C611A", &opti82c611a_port_ops, 0x0F, 874 {"OPTI82C611A", &opti82c611a_port_ops, 0x0F,
871 0 , NULL }, 875 0, 0, NULL },
872 {"OPTI82C46X", &opti82c46x_port_ops, 0x0F, 876 {"OPTI82C46X", &opti82c46x_port_ops, 0x0F,
873 0 , NULL }, 877 0, 0, NULL },
874 {"QDI6500", &qdi6500_port_ops, 0x07, 878 {"QDI6500", &qdi6500_port_ops, 0x07,
875 ATA_FLAG_NO_IORDY, qdi_port }, 879 ATA_FLAG_NO_IORDY,
880 ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port },
876 {"QDI6580", &qdi6580_port_ops, 0x1F, 881 {"QDI6580", &qdi6580_port_ops, 0x1F,
877 0 , qdi_port }, 882 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port },
878 {"QDI6580DP", &qdi6580dp_port_ops, 0x1F, 883 {"QDI6580DP", &qdi6580dp_port_ops, 0x1F,
879 0 , qdi_port }, 884 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port },
880 {"W83759A", &winbond_port_ops, 0x1F, 885 {"W83759A", &winbond_port_ops, 0x1F,
881 0 , winbond_port } 886 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE,
887 winbond_port }
882}; 888};
883 889
884/** 890/**
@@ -1008,6 +1014,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
1008 ap->ops = ops; 1014 ap->ops = ops;
1009 ap->pio_mask = pio_modes; 1015 ap->pio_mask = pio_modes;
1010 ap->flags |= ATA_FLAG_SLAVE_POSS | iordy; 1016 ap->flags |= ATA_FLAG_SLAVE_POSS | iordy;
1017 ap->pflags |= controller->pflags;
1011 ap->ioaddr.cmd_addr = io_addr; 1018 ap->ioaddr.cmd_addr = io_addr;
1012 ap->ioaddr.altstatus_addr = ctrl_addr; 1019 ap->ioaddr.altstatus_addr = ctrl_addr;
1013 ap->ioaddr.ctl_addr = ctrl_addr; 1020 ap->ioaddr.ctl_addr = ctrl_addr;