diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-11 17:54:01 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-11 17:54:01 -0400 |
commit | c15d5d43e6eed180e275f1db296eab5560a1bf59 (patch) | |
tree | 2acbe1d72e31a1018490da098ae9f9b4d7a82721 /drivers/ide/ppc/pmac.c | |
parent | f44ae58a273b1b051122784a159ad608b7205afd (diff) |
ide-pmac: PIO mode setup fixes (take 3)
* Add { 0, 0 } entry to {kauai,shasta}_pio_timings[] so kauai_lookup_timing()
always returns a valid PIO timing (fixes PIO timing not being set for devices
with minimum PIO cycle <= 120ns).
* Add setting transfer mode on the device to pmac_ide_set_pio_mode().
* Fix pmac_ide_set_pio() to always program chipset for given PIO timing instead
of only when the device we want to program PIO timing for is the currently
selected one.
* Now that pmac_ide_set_pio() is fixed there is no need to set transfer mode
on the device and program chipset for PIO in pmac_ide_tune_chipset()
(returning 0 == success is not entirely correct but is OK for now since
the upper layers are only checking ->speedproc return value for DMA modes).
v2:
* s/speed/XFER_PIO_0 + pio/ in pmac_ide_set_pio_mode() so it actually compiles.
* Removal of kauai_lookup_timing() return value checking went to separate patch.
v3:
* Use XFER_PIO_0 not XFER_PIO. (Noticed by Ben)
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ppc/pmac.c')
-rw-r--r-- | drivers/ide/ppc/pmac.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index beafdf3c1124..4da251882cc1 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * for doing DMA. | 6 | * for doing DMA. |
7 | * | 7 | * |
8 | * Copyright (C) 1998-2003 Paul Mackerras & Ben. Herrenschmidt | 8 | * Copyright (C) 1998-2003 Paul Mackerras & Ben. Herrenschmidt |
9 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz | ||
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or | 11 | * This program is free software; you can redistribute it and/or |
11 | * modify it under the terms of the GNU General Public License | 12 | * modify it under the terms of the GNU General Public License |
@@ -311,7 +312,8 @@ static struct kauai_timing kauai_pio_timings[] = | |||
311 | { 240 , 0x0800038b }, | 312 | { 240 , 0x0800038b }, |
312 | { 239 , 0x0800030c }, | 313 | { 239 , 0x0800030c }, |
313 | { 180 , 0x05000249 }, | 314 | { 180 , 0x05000249 }, |
314 | { 120 , 0x04000148 } | 315 | { 120 , 0x04000148 }, |
316 | { 0 , 0 }, | ||
315 | }; | 317 | }; |
316 | 318 | ||
317 | static struct kauai_timing kauai_mdma_timings[] = | 319 | static struct kauai_timing kauai_mdma_timings[] = |
@@ -351,7 +353,8 @@ static struct kauai_timing shasta_pio_timings[] = | |||
351 | { 240 , 0x040003cd }, | 353 | { 240 , 0x040003cd }, |
352 | { 239 , 0x040003cd }, | 354 | { 239 , 0x040003cd }, |
353 | { 180 , 0x0400028b }, | 355 | { 180 , 0x0400028b }, |
354 | { 120 , 0x0400010a } | 356 | { 120 , 0x0400010a }, |
357 | { 0 , 0 }, | ||
355 | }; | 358 | }; |
356 | 359 | ||
357 | static struct kauai_timing shasta_mdma_timings[] = | 360 | static struct kauai_timing shasta_mdma_timings[] = |
@@ -695,8 +698,10 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
695 | drive->name, pio, *timings); | 698 | drive->name, pio, *timings); |
696 | #endif | 699 | #endif |
697 | 700 | ||
698 | if (drive->select.all == HWIF(drive)->INB(IDE_SELECT_REG)) | 701 | if (pmac_ide_do_setfeature(drive, XFER_PIO_0 + pio)) |
699 | pmac_ide_do_update_timings(drive); | 702 | return; |
703 | |||
704 | pmac_ide_do_update_timings(drive); | ||
700 | } | 705 | } |
701 | 706 | ||
702 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | 707 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC |
@@ -965,7 +970,7 @@ static int pmac_ide_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
965 | case XFER_PIO_1: | 970 | case XFER_PIO_1: |
966 | case XFER_PIO_0: | 971 | case XFER_PIO_0: |
967 | pmac_ide_set_pio_mode(drive, speed & 0x07); | 972 | pmac_ide_set_pio_mode(drive, speed & 0x07); |
968 | break; | 973 | return 0; |
969 | default: | 974 | default: |
970 | ret = 1; | 975 | ret = 1; |
971 | } | 976 | } |