diff options
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 86 |
1 files changed, 36 insertions, 50 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 2b118f80fab6..cbf78edfe00b 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/ide.h> | 22 | #include <linux/ide.h> |
23 | 23 | ||
24 | #define DRV_NAME "amd74xx" | ||
25 | |||
24 | enum { | 26 | enum { |
25 | AMD_IDE_CONFIG = 0x41, | 27 | AMD_IDE_CONFIG = 0x41, |
26 | AMD_CABLE_DETECT = 0x42, | 28 | AMD_CABLE_DETECT = 0x42, |
@@ -204,9 +206,9 @@ static const struct ide_port_ops amd_port_ops = { | |||
204 | IDE_HFLAG_IO_32BIT | \ | 206 | IDE_HFLAG_IO_32BIT | \ |
205 | IDE_HFLAG_UNMASK_IRQS) | 207 | IDE_HFLAG_UNMASK_IRQS) |
206 | 208 | ||
207 | #define DECLARE_AMD_DEV(name_str, swdma, udma) \ | 209 | #define DECLARE_AMD_DEV(swdma, udma) \ |
208 | { \ | 210 | { \ |
209 | .name = name_str, \ | 211 | .name = DRV_NAME, \ |
210 | .init_chipset = init_chipset_amd74xx, \ | 212 | .init_chipset = init_chipset_amd74xx, \ |
211 | .init_hwif = init_hwif_amd74xx, \ | 213 | .init_hwif = init_hwif_amd74xx, \ |
212 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ | 214 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ |
@@ -218,9 +220,9 @@ static const struct ide_port_ops amd_port_ops = { | |||
218 | .udma_mask = udma, \ | 220 | .udma_mask = udma, \ |
219 | } | 221 | } |
220 | 222 | ||
221 | #define DECLARE_NV_DEV(name_str, udma) \ | 223 | #define DECLARE_NV_DEV(udma) \ |
222 | { \ | 224 | { \ |
223 | .name = name_str, \ | 225 | .name = DRV_NAME, \ |
224 | .init_chipset = init_chipset_amd74xx, \ | 226 | .init_chipset = init_chipset_amd74xx, \ |
225 | .init_hwif = init_hwif_amd74xx, \ | 227 | .init_hwif = init_hwif_amd74xx, \ |
226 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ | 228 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ |
@@ -233,31 +235,15 @@ static const struct ide_port_ops amd_port_ops = { | |||
233 | } | 235 | } |
234 | 236 | ||
235 | static const struct ide_port_info amd74xx_chipsets[] __devinitdata = { | 237 | static const struct ide_port_info amd74xx_chipsets[] __devinitdata = { |
236 | /* 0 */ DECLARE_AMD_DEV("AMD7401", 0x00, ATA_UDMA2), | 238 | /* 0: AMD7401 */ DECLARE_AMD_DEV(0x00, ATA_UDMA2), |
237 | /* 1 */ DECLARE_AMD_DEV("AMD7409", ATA_SWDMA2, ATA_UDMA4), | 239 | /* 1: AMD7409 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4), |
238 | /* 2 */ DECLARE_AMD_DEV("AMD7411", ATA_SWDMA2, ATA_UDMA5), | 240 | /* 2: AMD7411/7441 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5), |
239 | /* 3 */ DECLARE_AMD_DEV("AMD7441", ATA_SWDMA2, ATA_UDMA5), | 241 | /* 3: AMD8111 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA6), |
240 | /* 4 */ DECLARE_AMD_DEV("AMD8111", ATA_SWDMA2, ATA_UDMA6), | 242 | |
241 | 243 | /* 4: NFORCE */ DECLARE_NV_DEV(ATA_UDMA5), | |
242 | /* 5 */ DECLARE_NV_DEV("NFORCE", ATA_UDMA5), | 244 | /* 5: >= NFORCE2 */ DECLARE_NV_DEV(ATA_UDMA6), |
243 | /* 6 */ DECLARE_NV_DEV("NFORCE2", ATA_UDMA6), | 245 | |
244 | /* 7 */ DECLARE_NV_DEV("NFORCE2-U400R", ATA_UDMA6), | 246 | /* 6: AMD5536 */ DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5), |
245 | /* 8 */ DECLARE_NV_DEV("NFORCE2-U400R-SATA", ATA_UDMA6), | ||
246 | /* 9 */ DECLARE_NV_DEV("NFORCE3-150", ATA_UDMA6), | ||
247 | /* 10 */ DECLARE_NV_DEV("NFORCE3-250", ATA_UDMA6), | ||
248 | /* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA", ATA_UDMA6), | ||
249 | /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2", ATA_UDMA6), | ||
250 | /* 13 */ DECLARE_NV_DEV("NFORCE-CK804", ATA_UDMA6), | ||
251 | /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04", ATA_UDMA6), | ||
252 | /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51", ATA_UDMA6), | ||
253 | /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55", ATA_UDMA6), | ||
254 | /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61", ATA_UDMA6), | ||
255 | /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65", ATA_UDMA6), | ||
256 | /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67", ATA_UDMA6), | ||
257 | /* 20 */ DECLARE_NV_DEV("NFORCE-MCP73", ATA_UDMA6), | ||
258 | /* 21 */ DECLARE_NV_DEV("NFORCE-MCP77", ATA_UDMA6), | ||
259 | |||
260 | /* 22 */ DECLARE_AMD_DEV("AMD5536", ATA_SWDMA2, ATA_UDMA5), | ||
261 | }; | 247 | }; |
262 | 248 | ||
263 | static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) | 249 | static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) |
@@ -274,7 +260,7 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_ | |||
274 | if (dev->revision <= 7) | 260 | if (dev->revision <= 7) |
275 | d.swdma_mask = 0; | 261 | d.swdma_mask = 0; |
276 | d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX; | 262 | d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX; |
277 | } else if (idx == 4) { | 263 | } else if (idx == 3) { |
278 | if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD && | 264 | if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD && |
279 | dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE) | 265 | dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE) |
280 | d.udma_mask = ATA_UDMA5; | 266 | d.udma_mask = ATA_UDMA5; |
@@ -308,30 +294,30 @@ static const struct pci_device_id amd74xx_pci_tbl[] = { | |||
308 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, | 294 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, |
309 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 }, | 295 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 }, |
310 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 }, | 296 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 }, |
311 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 3 }, | 297 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 2 }, |
312 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 4 }, | 298 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 3 }, |
313 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 5 }, | 299 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 4 }, |
314 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 6 }, | 300 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 5 }, |
315 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 7 }, | 301 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 5 }, |
316 | #ifdef CONFIG_BLK_DEV_IDE_SATA | 302 | #ifdef CONFIG_BLK_DEV_IDE_SATA |
317 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 8 }, | 303 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 5 }, |
318 | #endif | 304 | #endif |
319 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 9 }, | 305 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 5 }, |
320 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 10 }, | 306 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 5 }, |
321 | #ifdef CONFIG_BLK_DEV_IDE_SATA | 307 | #ifdef CONFIG_BLK_DEV_IDE_SATA |
322 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 11 }, | 308 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 5 }, |
323 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 12 }, | 309 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 5 }, |
324 | #endif | 310 | #endif |
325 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 13 }, | 311 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 5 }, |
326 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 14 }, | 312 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 5 }, |
327 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 15 }, | 313 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 5 }, |
328 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 16 }, | 314 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 5 }, |
329 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 17 }, | 315 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 5 }, |
330 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 18 }, | 316 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 5 }, |
331 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 19 }, | 317 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 5 }, |
332 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 20 }, | 318 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 5 }, |
333 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 21 }, | 319 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 5 }, |
334 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 22 }, | 320 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 6 }, |
335 | { 0, }, | 321 | { 0, }, |
336 | }; | 322 | }; |
337 | MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); | 323 | MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); |