* [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers
@ 2009-09-17 23:02 Jung-Ik (John) Lee
2009-09-17 23:23 ` Alan Cox
0 siblings, 1 reply; 5+ messages in thread
From: Jung-Ik (John) Lee @ 2009-09-17 23:02 UTC (permalink / raw)
To: sshtylyov, Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel
From: John(Jung-Ik) Lee <jilee@google.com>
Fix udma timings of pdc202xx_old controllers.
MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.
Signed-off-by: John(Jung-Ik) Lee <jilee@google.com>
---
drivers/ata/pata_pdc202xx_old.c | 15 +++------------
drivers/ide/pdc202xx_old.c | 8 +++++---
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 2f3c9be..ae76a9e 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -97,14 +97,6 @@ static void pdc202xx_set_dmamode(struct ata_port
*ap, struct ata_device *adev)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
int port = 0x60 + 8 * ap->port_no + 4 * adev->devno;
- static u8 udma_timing[6][2] = {
- { 0x60, 0x03 }, /* 33 Mhz Clock */
- { 0x40, 0x02 },
- { 0x20, 0x01 },
- { 0x40, 0x02 }, /* 66 Mhz Clock */
- { 0x20, 0x01 },
- { 0x20, 0x01 }
- };
static u8 mdma_timing[3][2] = {
{ 0xe0, 0x0f },
{ 0x60, 0x04 },
@@ -119,10 +111,9 @@ static void pdc202xx_set_dmamode(struct ata_port
*ap, struct ata_device *adev)
r_cp &= ~0x0F;
if (adev->dma_mode >= XFER_UDMA_0) {
- int speed = adev->dma_mode - XFER_UDMA_0;
- r_bp |= udma_timing[speed][0];
- r_cp |= udma_timing[speed][1];
-
+ /* MB=1, MC=1 for all UDMA modes of pdc2026{57} */
+ r_bp |= 0x20;
+ r_cp |= 0x01;
} else {
int speed = adev->dma_mode - XFER_MW_DMA_0;
r_bp |= mdma_timing[speed][0];
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index cb812f3..95c58dd 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -51,11 +51,13 @@ static void pdc202xx_set_mode(ide_drive_t *drive,
const u8 speed)
switch(speed) {
case XFER_UDMA_5:
- case XFER_UDMA_4: TB = 0x20; TC = 0x01; break;
- case XFER_UDMA_2: TB = 0x20; TC = 0x01; break;
+ case XFER_UDMA_4:
case XFER_UDMA_3:
- case XFER_UDMA_1: TB = 0x40; TC = 0x02; break;
+ case XFER_UDMA_2:
+ case XFER_UDMA_1:
case XFER_UDMA_0:
+ /* MB=1, MC=1 for all UDMA modes of pdc2026{57} */
+ TB = 0x20; TC = 0x01; break;
case XFER_MW_DMA_2: TB = 0x60; TC = 0x03; break;
case XFER_MW_DMA_1: TB = 0x60; TC = 0x04; break;
case XFER_MW_DMA_0: TB = 0xE0; TC = 0x0F; break;
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers
2009-09-17 23:02 [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers Jung-Ik (John) Lee
@ 2009-09-17 23:23 ` Alan Cox
2009-09-17 23:54 ` Jung-Ik (John) Lee
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2009-09-17 23:23 UTC (permalink / raw)
To: Jung-Ik (John) Lee
Cc: sshtylyov, Bartlomiej Zolnierkiewicz, Jeff Garzik, linux-ide,
linux-kernel
On Thu, 17 Sep 2009 16:02:31 -0700
"Jung-Ik (John) Lee" <jilee@google.com> wrote:
> From: John(Jung-Ik) Lee <jilee@google.com>
>
> Fix udma timings of pdc202xx_old controllers.
> MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.
On what documentation is this based ?
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers
2009-09-17 23:23 ` Alan Cox
@ 2009-09-17 23:54 ` Jung-Ik (John) Lee
2009-09-18 11:52 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Jung-Ik (John) Lee @ 2009-09-17 23:54 UTC (permalink / raw)
To: Alan Cox
Cc: sshtylyov, Bartlomiej Zolnierkiewicz, Jeff Garzik, linux-ide,
linux-kernel
On Thu, Sep 17, 2009 at 4:23 PM, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Thu, 17 Sep 2009 16:02:31 -0700
> "Jung-Ik (John) Lee" <jilee@google.com> wrote:
>
>> From: John(Jung-Ik) Lee <jilee@google.com>
>>
>> Fix udma timings of pdc202xx_old controllers.
>> MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.
>
> On what documentation is this based ?
I have two documents, 20265, and 20267, and both need to set to the
same single value for all UDMA modes.
Doc 1:
PDC20265 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
Specification Rev 2.0
#7.17.2, Ultra DMA Data Transfer Speed list
For all Ultra DMA mode, MB, MC = 01h, 01h
Doc 2:
PDC20267 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
Specification Rev 2.0
#7.17.2, Ultra DMA Data Transfer Speed list
For all Ultra DMA mode, MB, MC = 01h, 01h
Are there other pdc202xx old controllers that are different?
-John
>
> Alan
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers
2009-09-17 23:54 ` Jung-Ik (John) Lee
@ 2009-09-18 11:52 ` Sergei Shtylyov
2009-09-20 19:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2009-09-18 11:52 UTC (permalink / raw)
To: Jung-Ik (John) Lee
Cc: Alan Cox, Bartlomiej Zolnierkiewicz, Jeff Garzik, linux-ide,
linux-kernel
Hello.
Jung-Ik (John) Lee wrote:
>>>From: John(Jung-Ik) Lee <jilee@google.com>
>>>Fix udma timings of pdc202xx_old controllers.
>>>MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.
The patch should be broken in two as it's for 2 different subsystems.
>>On what documentation is this based ?
> I have two documents, 20265, and 20267, and both need to set to the
> same single value for all UDMA modes.
> Doc 1:
> PDC20265 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
> Specification Rev 2.0
> #7.17.2, Ultra DMA Data Transfer Speed list
> For all Ultra DMA mode, MB, MC = 01h, 01h
> Doc 2:
> PDC20267 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
> Specification Rev 2.0
> #7.17.2, Ultra DMA Data Transfer Speed list
> For all Ultra DMA mode, MB, MC = 01h, 01h
> Are there other pdc202xx old controllers that are different?
There are PDC20262 and PDC20246. We should ask Bart -- he probably has
the documatation for them...
> -John
>>Alan
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers
2009-09-18 11:52 ` Sergei Shtylyov
@ 2009-09-20 19:48 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-09-20 19:48 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Jung-Ik (John) Lee, Alan Cox, Jeff Garzik, linux-ide,
linux-kernel
On Friday 18 September 2009 13:52:50 Sergei Shtylyov wrote:
> Hello.
>
> Jung-Ik (John) Lee wrote:
>
> >>>From: John(Jung-Ik) Lee <jilee@google.com>
>
> >>>Fix udma timings of pdc202xx_old controllers.
> >>>MB=1, MC=1 (0x20, 0x01) for all UDMA modes of pdc2026{57}.
>
> The patch should be broken in two as it's for 2 different subsystems.
>
> >>On what documentation is this based ?
>
> > I have two documents, 20265, and 20267, and both need to set to the
> > same single value for all UDMA modes.
>
> > Doc 1:
> > PDC20265 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
> > Specification Rev 2.0
> > #7.17.2, Ultra DMA Data Transfer Speed list
> > For all Ultra DMA mode, MB, MC = 01h, 01h
>
> > Doc 2:
> > PDC20267 Bus Mastering Ultra DMA PCI –ATA/ATAPI Controller
> > Specification Rev 2.0
> > #7.17.2, Ultra DMA Data Transfer Speed list
> > For all Ultra DMA mode, MB, MC = 01h, 01h
I think that this patch is going in the right direction but it needs to also
take care of 66MHz internal clock setting:
* Please note that the same docs say that "For all Ultra DMA modes, 66MHz
internal clock will be used instead of 33MHz internal clock." and that this
is not true in case of Linux drivers.
* PDC20246 has no 66MHz internal clock AFAIK so those changes should not be
applied for this controller.
> > Are there other pdc202xx old controllers that are different?
>
> There are PDC20262 and PDC20246. We should ask Bart -- he probably has
> the documatation for them...
He doesn't, unfortunately..
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-20 19:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 23:02 [PATCH] libata:ide: Fix udma timings of pdc202xx_old controllers Jung-Ik (John) Lee
2009-09-17 23:23 ` Alan Cox
2009-09-17 23:54 ` Jung-Ik (John) Lee
2009-09-18 11:52 ` Sergei Shtylyov
2009-09-20 19:48 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).