Commit 075cb655 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Bartlomiej Zolnierkiewicz

siimage: PIO1/2 taskfile transfer overclocking fix

Fix two typos found by SiI680A documentation check.  They caused the taskfile
transfer overclocking:

- in PIO mode 1 as 0x2283 must be used for both data and taskfile transfers;

- in PIO mode 2 as data and taskfile timings are swapped when writing to the
  MMIO regs.

Fix coding style and trailing whitespace in enclosing statements while at it...
Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>

 drivers/ide/pci/siimage.c |   59 ++++++++++++++++++++++------------------------
 1 file changed, 29 insertions(+), 30 deletions(-)
parent 6e6cd4c4
/* /*
* linux/drivers/ide/pci/siimage.c Version 1.07 Nov 30, 2003 * linux/drivers/ide/pci/siimage.c Version 1.11 Jan 27, 2007
* *
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2003 Red Hat <alan@redhat.com> * Copyright (C) 2003 Red Hat <alan@redhat.com>
* Copyright (C) 2007 MontaVista Software, Inc.
* *
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
* *
...@@ -205,14 +206,14 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted) ...@@ -205,14 +206,14 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted)
unsigned long tfaddr = siimage_selreg(hwif, 0x02); unsigned long tfaddr = siimage_selreg(hwif, 0x02);
/* cheat for now and use the docs */ /* cheat for now and use the docs */
switch(mode_wanted) { switch (mode_wanted) {
case 4: case 4:
speedp = 0x10c1; speedp = 0x10c1;
speedt = 0x10c1; speedt = 0x10c1;
break; break;
case 3: case 3:
speedp = 0x10C3; speedp = 0x10c3;
speedt = 0x10C3; speedt = 0x10c3;
break; break;
case 2: case 2:
speedp = 0x1104; speedp = 0x1104;
...@@ -220,26 +221,24 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted) ...@@ -220,26 +221,24 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted)
break; break;
case 1: case 1:
speedp = 0x2283; speedp = 0x2283;
speedt = 0x1281; speedt = 0x2283;
break; break;
case 0: case 0:
default: default:
speedp = 0x328A; speedp = 0x328a;
speedt = 0x328A; speedt = 0x328a;
break; break;
} }
if (hwif->mmio)
{ if (hwif->mmio) {
hwif->OUTW(speedt, addr); hwif->OUTW(speedp, addr);
hwif->OUTW(speedp, tfaddr); hwif->OUTW(speedt, tfaddr);
/* Now set up IORDY */ /* Now set up IORDY */
if(mode_wanted == 3 || mode_wanted == 4) if(mode_wanted == 3 || mode_wanted == 4)
hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2); hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2);
else else
hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2); hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2);
} } else {
else
{
pci_write_config_word(hwif->pci_dev, addr, speedp); pci_write_config_word(hwif->pci_dev, addr, speedp);
pci_write_config_word(hwif->pci_dev, tfaddr, speedt); pci_write_config_word(hwif->pci_dev, tfaddr, speedt);
pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp); pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment