aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata/pata_rb532_cf.c
AgeCommit message (Collapse)Author
2009-03-24pata-rb532-cf: platform_get_irq() fix ignored failureFlorian Fainelli
platform_get_irq() can return -ENXIO, but since 'irq' is an unsigned int, it does not show when the IRQ resource wasn't found. Make irq an int so that we can use a single variable to test the platform_get_irq() return value. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-24[libata] convert drivers to use ata.h mode mask definesErik Inge Bolsø
No functional changes in this patch. Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-24pata-rb532-cf: drop custom freeze and thawPhil Sutter
I'm not quite sure what freezing and thawing is used for. Tests showed that the port is being frozen at initialisation state and thawed right afterwards, then the functions were not called anymore. Dropping the complete custom code for handling the frozen state seems to work at least for a standard use case including mounting a partition, copying some files in it (in parallel) and finally removing them and unmounting the partition. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-24pata-rb532-cf: use ata_sff_data_xfer32()Phil Sutter
The biggest difference between rb532_pata_data_xfer() and ata_sff_data_xfer32() is the call to ata_sff_pause() at the end of rb532_pata_data_xfer() which I suppose to be unnecessary since it works without. I've also tested using ata_sff_data_xfer() as replacement, but since we know that the driver supports 32bit IO, using the optimised version should be safe. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-24pata-rb532-cf: use ata_sff_exec_command()Phil Sutter
The only difference between rb532_pata_exec_command() and ata_sff_exec_command() is added debugging output, so it can be dropped and the standard op used instead. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-24pata-rb532-cf: replace rb532_pata_finish_io()Phil Sutter
Since the delay used internally is just the same as ata_sff_pause() uses, rb532_pata_finish_io() does exactly the same as ata_sff_pause() and thus can be replaced by the later one. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-01-27pata-rb532-cf: remove set_irq_type from finish_ioPhil Sutter
The driver has been tested without the call to set_irq_type at this point and occurs to work fine, so it should be safe to remove it. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-12-01[libata] pata_rb532_cf: fix signature of the xfer functionPhil Sutter
Per definition, this function should return the number of bytes consumed. As the original parameter "buflen" is being decremented inside the read/write loop, save it in "retlen" at the beginning. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-12-01[libata] pata_rb532_cf: fix and rename register definitionsPhil Sutter
The original standalone driver uses a custom address for the error register. Use it in pata_rb532_cf, too. Rename two register definitions: - The address offset 0x0800 in fact is the ATA base, not ATA command address. - The offset 0x0C00 is not a regular ATA data address, but a buffered one allowing 4-byte IO. Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-06-04libata-sff: Fix oops reported in kerneloops.org for pnp devices with no ctlAlan Cox
- Make ata_sff_altstatus private so nobody uses it by mistake - Drop the 400nS delay from it Add ata_sff_irq_status - encapsulates the IRQ check logic This function keeps the existing behaviour for altstatus using devices. I actually suspect the logic was wrong before the changes but -rc isn't the time to play with that ata_sff_sync - ensure writes hit the device Really we want an io* operation for 'is posted' eg ioisposted(ioaddr) so that we can fix the nasty delay this causes on most systems. - ata_sff_pause - 400nS delay Ensure the command hit the device and delay 400nS - ata_sff_dma_pause Ensure the I/O hit the device and enforce an HDMA1:0 transition delay. Requires altstatus register exists, BUG if not so we don't risk corruption in MWDMA modes. (UDMA the checksum will save your backside in theory) The only other complication then is devices with their own handlers. rb532 can use dma_pause but scc needs to access its own altstatus register for internal errata workarounds so directly call the drivers own altstatus function. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-29[MIPS] ATA: Rename routerboard 500 to 532Ralf Baechle
The platform is actually named routerboard 532 so let's call it this. This patch only rename files, Kconfig and C symbols; no functional changes. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>