diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2009-04-09 12:31:17 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-04-16 15:28:23 -0400 |
commit | e3cf95dd6d352954b663d2934110d6e30af2406d (patch) | |
tree | f3245e91c30e0c1e12a169af637373a8b5ff670a /drivers/ata/libata-sff.c | |
parent | 62afe5d744047df8ff15a369f4c1ebad71c937d4 (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/libata-sff.c')
-rw-r--r-- | drivers/ata/libata-sff.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 8332e97a9de3..bb18415d3d63 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -87,6 +87,7 @@ const struct ata_port_operations ata_bmdma32_port_ops = { | |||
87 | .inherits = &ata_bmdma_port_ops, | 87 | .inherits = &ata_bmdma_port_ops, |
88 | 88 | ||
89 | .sff_data_xfer = ata_sff_data_xfer32, | 89 | .sff_data_xfer = ata_sff_data_xfer32, |
90 | .port_start = ata_sff_port_start32, | ||
90 | }; | 91 | }; |
91 | EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); | 92 | EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); |
92 | 93 | ||
@@ -769,6 +770,9 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf, | |||
769 | void __iomem *data_addr = ap->ioaddr.data_addr; | 770 | void __iomem *data_addr = ap->ioaddr.data_addr; |
770 | unsigned int words = buflen >> 2; | 771 | unsigned int words = buflen >> 2; |
771 | int slop = buflen & 3; | 772 | int slop = buflen & 3; |
773 | |||
774 | if (!(ap->pflags & ATA_PFLAG_PIO32)) | ||
775 | return ata_sff_data_xfer(dev, buf, buflen, rw); | ||
772 | 776 | ||
773 | /* Transfer multiple of 4 bytes */ | 777 | /* Transfer multiple of 4 bytes */ |
774 | if (rw == READ) | 778 | if (rw == READ) |
@@ -2402,6 +2406,29 @@ int ata_sff_port_start(struct ata_port *ap) | |||
2402 | EXPORT_SYMBOL_GPL(ata_sff_port_start); | 2406 | EXPORT_SYMBOL_GPL(ata_sff_port_start); |
2403 | 2407 | ||
2404 | /** | 2408 | /** |
2409 | * ata_sff_port_start32 - Set port up for dma. | ||
2410 | * @ap: Port to initialize | ||
2411 | * | ||
2412 | * Called just after data structures for each port are | ||
2413 | * initialized. Allocates space for PRD table if the device | ||
2414 | * is DMA capable SFF. | ||
2415 | * | ||
2416 | * May be used as the port_start() entry in ata_port_operations for | ||
2417 | * devices that are capable of 32bit PIO. | ||
2418 | * | ||
2419 | * LOCKING: | ||
2420 | * Inherited from caller. | ||
2421 | */ | ||
2422 | int ata_sff_port_start32(struct ata_port *ap) | ||
2423 | { | ||
2424 | ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE; | ||
2425 | if (ap->ioaddr.bmdma_addr) | ||
2426 | return ata_port_start(ap); | ||
2427 | return 0; | ||
2428 | } | ||
2429 | EXPORT_SYMBOL_GPL(ata_sff_port_start32); | ||
2430 | |||
2431 | /** | ||
2405 | * ata_sff_std_ports - initialize ioaddr with standard port offsets. | 2432 | * ata_sff_std_ports - initialize ioaddr with standard port offsets. |
2406 | * @ioaddr: IO address structure to be initialized | 2433 | * @ioaddr: IO address structure to be initialized |
2407 | * | 2434 | * |