diff options
Diffstat (limited to 'drivers/ide/pci/piix.c')
-rw-r--r-- | drivers/ide/pci/piix.c | 66 |
1 files changed, 2 insertions, 64 deletions
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 17ea44edb4eb..84d3938a430a 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c | |||
@@ -106,68 +106,6 @@ | |||
106 | static int no_piix_dma; | 106 | static int no_piix_dma; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * piix_ratemask - compute rate mask for PIIX IDE | ||
110 | * @drive: IDE drive to compute for | ||
111 | * | ||
112 | * Returns the available modes for the PIIX IDE controller. | ||
113 | */ | ||
114 | |||
115 | static u8 piix_ratemask (ide_drive_t *drive) | ||
116 | { | ||
117 | struct pci_dev *dev = HWIF(drive)->pci_dev; | ||
118 | u8 mode; | ||
119 | |||
120 | switch(dev->device) { | ||
121 | case PCI_DEVICE_ID_INTEL_82801EB_1: | ||
122 | mode = 3; | ||
123 | break; | ||
124 | /* UDMA 100 capable */ | ||
125 | case PCI_DEVICE_ID_INTEL_82801BA_8: | ||
126 | case PCI_DEVICE_ID_INTEL_82801BA_9: | ||
127 | case PCI_DEVICE_ID_INTEL_82801CA_10: | ||
128 | case PCI_DEVICE_ID_INTEL_82801CA_11: | ||
129 | case PCI_DEVICE_ID_INTEL_82801E_11: | ||
130 | case PCI_DEVICE_ID_INTEL_82801DB_1: | ||
131 | case PCI_DEVICE_ID_INTEL_82801DB_10: | ||
132 | case PCI_DEVICE_ID_INTEL_82801DB_11: | ||
133 | case PCI_DEVICE_ID_INTEL_82801EB_11: | ||
134 | case PCI_DEVICE_ID_INTEL_ESB_2: | ||
135 | case PCI_DEVICE_ID_INTEL_ICH6_19: | ||
136 | case PCI_DEVICE_ID_INTEL_ICH7_21: | ||
137 | case PCI_DEVICE_ID_INTEL_ESB2_18: | ||
138 | case PCI_DEVICE_ID_INTEL_ICH8_6: | ||
139 | mode = 3; | ||
140 | break; | ||
141 | /* UDMA 66 capable */ | ||
142 | case PCI_DEVICE_ID_INTEL_82801AA_1: | ||
143 | case PCI_DEVICE_ID_INTEL_82372FB_1: | ||
144 | mode = 2; | ||
145 | break; | ||
146 | /* UDMA 33 capable */ | ||
147 | case PCI_DEVICE_ID_INTEL_82371AB: | ||
148 | case PCI_DEVICE_ID_INTEL_82443MX_1: | ||
149 | case PCI_DEVICE_ID_INTEL_82451NX: | ||
150 | case PCI_DEVICE_ID_INTEL_82801AB_1: | ||
151 | return 1; | ||
152 | /* Non UDMA capable (MWDMA2) */ | ||
153 | case PCI_DEVICE_ID_INTEL_82371SB_1: | ||
154 | case PCI_DEVICE_ID_INTEL_82371FB_1: | ||
155 | case PCI_DEVICE_ID_INTEL_82371FB_0: | ||
156 | case PCI_DEVICE_ID_INTEL_82371MX: | ||
157 | default: | ||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * If we are UDMA66 capable fall back to UDMA33 | ||
163 | * if the drive cannot see an 80pin cable. | ||
164 | */ | ||
165 | if (!eighty_ninty_three(drive)) | ||
166 | mode = min_t(u8, mode, 1); | ||
167 | return mode; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * piix_dma_2_pio - return the PIO mode matching DMA | 109 | * piix_dma_2_pio - return the PIO mode matching DMA |
172 | * @xfer_rate: transfer speed | 110 | * @xfer_rate: transfer speed |
173 | * | 111 | * |
@@ -301,7 +239,7 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
301 | ide_hwif_t *hwif = HWIF(drive); | 239 | ide_hwif_t *hwif = HWIF(drive); |
302 | struct pci_dev *dev = hwif->pci_dev; | 240 | struct pci_dev *dev = hwif->pci_dev; |
303 | u8 maslave = hwif->channel ? 0x42 : 0x40; | 241 | u8 maslave = hwif->channel ? 0x42 : 0x40; |
304 | u8 speed = ide_rate_filter(piix_ratemask(drive), xferspeed); | 242 | u8 speed = ide_rate_filter(drive, xferspeed); |
305 | int a_speed = 3 << (drive->dn * 4); | 243 | int a_speed = 3 << (drive->dn * 4); |
306 | int u_flag = 1 << drive->dn; | 244 | int u_flag = 1 << drive->dn; |
307 | int v_flag = 0x01 << drive->dn; | 245 | int v_flag = 0x01 << drive->dn; |
@@ -376,7 +314,7 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
376 | 314 | ||
377 | static int piix_config_drive_for_dma (ide_drive_t *drive) | 315 | static int piix_config_drive_for_dma (ide_drive_t *drive) |
378 | { | 316 | { |
379 | u8 speed = ide_dma_speed(drive, piix_ratemask(drive)); | 317 | u8 speed = ide_max_dma_mode(drive); |
380 | 318 | ||
381 | /* | 319 | /* |
382 | * If no DMA speed was available or the chipset has DMA bugs | 320 | * If no DMA speed was available or the chipset has DMA bugs |