diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2007-02-16 20:40:22 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-02-16 20:40:22 -0500 |
commit | 075cb65511df94b6900ef3288a76cd92185d5170 (patch) | |
tree | bb5430e6cd40c2073c0ce6e42028bc09263ce840 /drivers | |
parent | 6e6cd4c4388f399dd5726b826f02732c53df3ba5 (diff) |
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: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/siimage.c | 59 ++++++++++++++++++++++------------------------
1 file changed, 29 insertions(+), 30 deletions(-)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/pci/siimage.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 4ff89c7d990a..cbca5f05ff87 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/siimage.c Version 1.07 Nov 30, 2003 | 2 | * linux/drivers/ide/pci/siimage.c Version 1.11 Jan 27, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2003 Red Hat <alan@redhat.com> | 5 | * Copyright (C) 2003 Red Hat <alan@redhat.com> |
6 | * Copyright (C) 2007 MontaVista Software, Inc. | ||
6 | * | 7 | * |
7 | * May be copied or modified under the terms of the GNU General Public License | 8 | * May be copied or modified under the terms of the GNU General Public License |
8 | * | 9 | * |
@@ -205,41 +206,39 @@ static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted) | |||
205 | unsigned long tfaddr = siimage_selreg(hwif, 0x02); | 206 | unsigned long tfaddr = siimage_selreg(hwif, 0x02); |
206 | 207 | ||
207 | /* cheat for now and use the docs */ | 208 | /* cheat for now and use the docs */ |
208 | switch(mode_wanted) { | 209 | switch (mode_wanted) { |
209 | case 4: | 210 | case 4: |
210 | speedp = 0x10c1; | 211 | speedp = 0x10c1; |
211 | speedt = 0x10c1; | 212 | speedt = 0x10c1; |
212 | break; | 213 | break; |
213 | case 3: | 214 | case 3: |
214 | speedp = 0x10C3; | 215 | speedp = 0x10c3; |
215 | speedt = 0x10C3; | 216 | speedt = 0x10c3; |
216 | break; | 217 | break; |
217 | case 2: | 218 | case 2: |
218 | speedp = 0x1104; | 219 | speedp = 0x1104; |
219 | speedt = 0x1281; | 220 | speedt = 0x1281; |
220 | break; | 221 | break; |
221 | case 1: | 222 | case 1: |
222 | speedp = 0x2283; | 223 | speedp = 0x2283; |
223 | speedt = 0x1281; | 224 | speedt = 0x2283; |
224 | break; | 225 | break; |
225 | case 0: | 226 | case 0: |
226 | default: | 227 | default: |
227 | speedp = 0x328A; | 228 | speedp = 0x328a; |
228 | speedt = 0x328A; | 229 | speedt = 0x328a; |
229 | break; | 230 | break; |
230 | } | 231 | } |
231 | if (hwif->mmio) | 232 | |
232 | { | 233 | if (hwif->mmio) { |
233 | hwif->OUTW(speedt, addr); | 234 | hwif->OUTW(speedp, addr); |
234 | hwif->OUTW(speedp, tfaddr); | 235 | hwif->OUTW(speedt, tfaddr); |
235 | /* Now set up IORDY */ | 236 | /* Now set up IORDY */ |
236 | if(mode_wanted == 3 || mode_wanted == 4) | 237 | if(mode_wanted == 3 || mode_wanted == 4) |
237 | hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2); | 238 | hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2); |
238 | else | 239 | else |
239 | hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2); | 240 | hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2); |
240 | } | 241 | } else { |
241 | else | ||
242 | { | ||
243 | pci_write_config_word(hwif->pci_dev, addr, speedp); | 242 | pci_write_config_word(hwif->pci_dev, addr, speedp); |
244 | pci_write_config_word(hwif->pci_dev, tfaddr, speedt); | 243 | pci_write_config_word(hwif->pci_dev, tfaddr, speedt); |
245 | pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp); | 244 | pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp); |