aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-16 16:29:56 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-16 16:29:56 -0400
commit1c54a93d4de34c87be9c63fe5094157e10995d6b (patch)
tree9da94f64f4d432ca222547f555c9c1bb10bf2e25 /drivers/ide
parent3135469e1f679b1728fa047ed43b0c63cdf50c84 (diff)
it8213/piix/slc90e66: "de-couple" PIO and UDMA modes
Don't force PIO4 when programming UDMA mode (suggested by Sergei). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pci/it8213.c9
-rw-r--r--drivers/ide/pci/piix.c11
-rw-r--r--drivers/ide/pci/slc90e66.c10
3 files changed, 13 insertions, 17 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 069152dd4697..2102167e4f08 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -93,7 +93,7 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
93 int w_flag = 0x10 << drive->dn; 93 int w_flag = 0x10 << drive->dn;
94 int u_speed = 0; 94 int u_speed = 0;
95 u16 reg4042, reg4a; 95 u16 reg4042, reg4a;
96 u8 reg48, reg54, reg55, pio; 96 u8 reg48, reg54, reg55;
97 97
98 pci_read_config_word(dev, maslave, &reg4042); 98 pci_read_config_word(dev, maslave, &reg4042);
99 pci_read_config_byte(dev, 0x48, &reg48); 99 pci_read_config_byte(dev, 0x48, &reg48);
@@ -134,10 +134,9 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
134 pci_write_config_byte(dev, 0x54, reg54 | v_flag); 134 pci_write_config_byte(dev, 0x54, reg54 | v_flag);
135 } else 135 } else
136 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 136 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
137
138 pio = 4;
139 } else { 137 } else {
140 const u8 mwdma_to_pio[] = { 0, 3, 4 }; 138 const u8 mwdma_to_pio[] = { 0, 3, 4 };
139 u8 pio;
141 140
142 if (reg48 & u_flag) 141 if (reg48 & u_flag)
143 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); 142 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
@@ -152,9 +151,9 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
152 pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 151 pio = mwdma_to_pio[speed - XFER_MW_DMA_0];
153 else 152 else
154 pio = 2; /* only SWDMA2 is allowed */ 153 pio = 2; /* only SWDMA2 is allowed */
155 }
156 154
157 it8213_set_pio_mode(drive, pio); 155 it8213_set_pio_mode(drive, pio);
156 }
158} 157}
159 158
160/** 159/**
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index d5a31e9f5727..b0f06161eb8e 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/piix.c Version 0.52 Jul 14, 2007 2 * linux/drivers/ide/pci/piix.c Version 0.53 Aug 9, 2007
3 * 3 *
4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
@@ -194,7 +194,7 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed)
194 int u_speed = 0; 194 int u_speed = 0;
195 int sitre; 195 int sitre;
196 u16 reg4042, reg4a; 196 u16 reg4042, reg4a;
197 u8 reg48, reg54, reg55, pio; 197 u8 reg48, reg54, reg55;
198 198
199 pci_read_config_word(dev, maslave, &reg4042); 199 pci_read_config_word(dev, maslave, &reg4042);
200 sitre = (reg4042 & 0x4000) ? 1 : 0; 200 sitre = (reg4042 & 0x4000) ? 1 : 0;
@@ -231,10 +231,9 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed)
231 pci_write_config_byte(dev, 0x54, reg54 | v_flag); 231 pci_write_config_byte(dev, 0x54, reg54 | v_flag);
232 } else 232 } else
233 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag); 233 pci_write_config_byte(dev, 0x54, reg54 & ~v_flag);
234
235 pio = 4;
236 } else { 234 } else {
237 const u8 mwdma_to_pio[] = { 0, 3, 4 }; 235 const u8 mwdma_to_pio[] = { 0, 3, 4 };
236 u8 pio;
238 237
239 if (reg48 & u_flag) 238 if (reg48 & u_flag)
240 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); 239 pci_write_config_byte(dev, 0x48, reg48 & ~u_flag);
@@ -249,9 +248,9 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed)
249 pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 248 pio = mwdma_to_pio[speed - XFER_MW_DMA_0];
250 else 249 else
251 pio = 2; /* only SWDMA2 is allowed */ 250 pio = 2; /* only SWDMA2 is allowed */
252 }
253 251
254 piix_set_pio_mode(drive, pio); 252 piix_set_pio_mode(drive, pio);
253 }
255} 254}
256 255
257/** 256/**
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index bf21f1dfb7b5..106ca7942cec 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/slc90e66.c Version 0.17 Aug 2, 2007 2 * linux/drivers/ide/pci/slc90e66.c Version 0.18 Aug 9, 2007
3 * 3 *
4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> 5 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>
@@ -82,7 +82,6 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
82 int sitre = 0, a_speed = 7 << (drive->dn * 4); 82 int sitre = 0, a_speed = 7 << (drive->dn * 4);
83 int u_speed = 0, u_flag = 1 << drive->dn; 83 int u_speed = 0, u_flag = 1 << drive->dn;
84 u16 reg4042, reg44, reg48, reg4a; 84 u16 reg4042, reg44, reg48, reg4a;
85 u8 pio;
86 85
87 pci_read_config_word(dev, maslave, &reg4042); 86 pci_read_config_word(dev, maslave, &reg4042);
88 sitre = (reg4042 & 0x4000) ? 1 : 0; 87 sitre = (reg4042 & 0x4000) ? 1 : 0;
@@ -111,10 +110,9 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
111 pci_read_config_word(dev, 0x4a, &reg4a); 110 pci_read_config_word(dev, 0x4a, &reg4a);
112 pci_write_config_word(dev, 0x4a, reg4a|u_speed); 111 pci_write_config_word(dev, 0x4a, reg4a|u_speed);
113 } 112 }
114
115 pio = 4;
116 } else { 113 } else {
117 const u8 mwdma_to_pio[] = { 0, 3, 4 }; 114 const u8 mwdma_to_pio[] = { 0, 3, 4 };
115 u8 pio;
118 116
119 if (reg48 & u_flag) 117 if (reg48 & u_flag)
120 pci_write_config_word(dev, 0x48, reg48 & ~u_flag); 118 pci_write_config_word(dev, 0x48, reg48 & ~u_flag);
@@ -125,9 +123,9 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
125 pio = mwdma_to_pio[speed - XFER_MW_DMA_0]; 123 pio = mwdma_to_pio[speed - XFER_MW_DMA_0];
126 else 124 else
127 pio = 2; /* only SWDMA2 is allowed */ 125 pio = 2; /* only SWDMA2 is allowed */
128 }
129 126
130 slc90e66_set_pio_mode(drive, pio); 127 slc90e66_set_pio_mode(drive, pio);
128 }
131} 129}
132 130
133static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) 131static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)