blob: ebc16deffe16bf36af7dedc7843db77f1b09a7ed [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +01002 * Version 2.25
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
5 * IDE driver for Linux.
6 *
7 * Copyright (c) 2000-2002 Vojtech Pavlik
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +02008 * Copyright (c) 2007 Bartlomiej Zolnierkiewicz
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 *
10 * Based on the work of:
11 * Andre Hedrick
12 */
13
14/*
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License version 2 as published by
17 * the Free Software Foundation.
18 */
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/ioport.h>
23#include <linux/blkdev.h>
24#include <linux/pci.h>
25#include <linux/init.h>
26#include <linux/ide.h>
27#include <asm/io.h>
28
29#include "ide-timing.h"
30
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010031enum {
32 AMD_IDE_CONFIG = 0x41,
33 AMD_CABLE_DETECT = 0x42,
34 AMD_DRIVE_TIMING = 0x48,
35 AMD_8BIT_TIMING = 0x4e,
36 AMD_ADDRESS_SETUP = 0x4c,
37 AMD_UDMA_TIMING = 0x50,
Linus Torvalds1da177e2005-04-16 15:20:36 -070038};
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040static unsigned int amd_80w;
41static unsigned int amd_clock;
42
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +020043static char *amd_dma[] = { "16", "25", "33", "44", "66", "100", "133" };
Linus Torvalds1da177e2005-04-16 15:20:36 -070044static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 };
45
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010046static inline u8 amd_offset(struct pci_dev *dev)
47{
48 return (dev->vendor == PCI_VENDOR_ID_NVIDIA) ? 0x10 : 0;
49}
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 * amd_set_speed() writes timing values to the chipset registers
53 */
54
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010055static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
56 struct ide_timing *timing)
Linus Torvalds1da177e2005-04-16 15:20:36 -070057{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010058 u8 t = 0, offset = amd_offset(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010060 pci_read_config_byte(dev, AMD_ADDRESS_SETUP + offset, &t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010062 pci_write_config_byte(dev, AMD_ADDRESS_SETUP + offset, t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010064 pci_write_config_byte(dev, AMD_8BIT_TIMING + offset + (1 - (dn >> 1)),
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 ((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1));
66
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010067 pci_write_config_byte(dev, AMD_DRIVE_TIMING + offset + (3 - dn),
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));
69
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010070 switch (udma_mask) {
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +020071 case ATA_UDMA2: t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
72 case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
73 case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
74 case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 15)]) : 0x03; break;
75 default: return;
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 }
77
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010078 pci_write_config_byte(dev, AMD_UDMA_TIMING + offset + (3 - dn), t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070079}
80
81/*
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +020082 * amd_set_drive() computes timing values and configures the chipset
83 * to a desired transfer mode. It also can be called by upper layers.
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 */
85
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +020086static void amd_set_drive(ide_drive_t *drive, const u8 speed)
Linus Torvalds1da177e2005-04-16 15:20:36 -070087{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010088 ide_hwif_t *hwif = drive->hwif;
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +010089 struct pci_dev *dev = to_pci_dev(hwif->dev);
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010090 ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 struct ide_timing t, p;
92 int T, UT;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010093 u8 udma_mask = hwif->ultra_mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 T = 1000000000 / amd_clock;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010096 UT = (udma_mask == ATA_UDMA2) ? T : (T / 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -070097
98 ide_timing_compute(drive, speed, &t, T, UT);
99
100 if (peer->present) {
101 ide_timing_compute(peer, peer->current_speed, &p, T, UT);
102 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
103 }
104
105 if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
106 if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15;
107
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100108 amd_set_speed(dev, drive->dn, udma_mask, &t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109}
110
111/*
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200112 * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113 */
114
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200115static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116{
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200117 amd_set_drive(drive, XFER_PIO_0 + pio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118}
119
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100120static void __devinit amd7409_cable_detect(struct pci_dev *dev,
121 const char *name)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100123 /* no host side cable detection */
124 amd_80w = 0x03;
125}
126
127static void __devinit amd7411_cable_detect(struct pci_dev *dev,
128 const char *name)
129{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 int i;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100131 u32 u = 0;
132 u8 t = 0, offset = amd_offset(dev);
133
134 pci_read_config_byte(dev, AMD_CABLE_DETECT + offset, &t);
135 pci_read_config_dword(dev, AMD_UDMA_TIMING + offset, &u);
136 amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);
137 for (i = 24; i >= 0; i -= 8)
138 if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) {
139 printk(KERN_WARNING "%s: BIOS didn't set cable bits "
140 "correctly. Enabling workaround.\n",
141 name);
142 amd_80w |= (1 << (1 - (i >> 4)));
143 }
144}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
146/*
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100147 * The initialization callback. Initialize drive independent registers.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 */
149
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100150static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
151 const char *name)
152{
153 u8 t = 0, offset = amd_offset(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154
155/*
156 * Check 80-wire cable presence.
157 */
158
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100159 if (dev->vendor == PCI_VENDOR_ID_AMD &&
160 dev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
161 ; /* no UDMA > 2 */
162 else if (dev->vendor == PCI_VENDOR_ID_AMD &&
163 dev->device == PCI_DEVICE_ID_AMD_VIPER_7409)
164 amd7409_cable_detect(dev, name);
165 else
166 amd7411_cable_detect(dev, name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
168/*
169 * Take care of prefetch & postwrite.
170 */
171
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100172 pci_read_config_byte(dev, AMD_IDE_CONFIG + offset, &t);
173 /*
174 * Check for broken FIFO support.
175 */
176 if (dev->vendor == PCI_VENDOR_ID_AMD &&
177 dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
178 t &= 0x0f;
179 else
180 t |= 0xf0;
181 pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183/*
184 * Determine the system bus clock.
185 */
186
187 amd_clock = system_bus_clock() * 1000;
188
189 switch (amd_clock) {
190 case 33000: amd_clock = 33333; break;
191 case 37000: amd_clock = 37500; break;
192 case 41000: amd_clock = 41666; break;
193 }
194
195 if (amd_clock < 20000 || amd_clock > 50000) {
196 printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100197 name, amd_clock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 amd_clock = 33333;
199 }
200
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 return dev->irq;
202}
203
Herbert Xue895f922005-07-03 16:15:41 +0200204static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205{
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100206 struct pci_dev *dev = to_pci_dev(hwif->dev);
207
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 if (hwif->irq == 0) /* 0 is bogus but will do for now */
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100209 hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200211 hwif->set_pio_mode = &amd_set_pio_mode;
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +0200212 hwif->set_dma_mode = &amd_set_drive;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 if (!hwif->dma_base)
215 return;
216
Bartlomiej Zolnierkiewicz49521f92007-07-09 23:17:58 +0200217 if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
218 if ((amd_80w >> hwif->channel) & 1)
219 hwif->cbl = ATA_CBL_PATA80;
220 else
221 hwif->cbl = ATA_CBL_PATA40;
222 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223}
224
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200225#define IDE_HFLAGS_AMD \
226 (IDE_HFLAG_PIO_NO_BLACKLIST | \
227 IDE_HFLAG_PIO_NO_DOWNGRADE | \
Bartlomiej Zolnierkiewicz4db90a12008-01-25 22:17:18 +0100228 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200229 IDE_HFLAG_POST_SET_MODE | \
230 IDE_HFLAG_IO_32BIT | \
231 IDE_HFLAG_UNMASK_IRQS | \
232 IDE_HFLAG_BOOTABLE)
233
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100234#define DECLARE_AMD_DEV(name_str, swdma, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 { \
236 .name = name_str, \
237 .init_chipset = init_chipset_amd74xx, \
238 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200240 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200241 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100242 .swdma_mask = swdma, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200243 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100244 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 }
246
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100247#define DECLARE_NV_DEV(name_str, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248 { \
249 .name = name_str, \
250 .init_chipset = init_chipset_amd74xx, \
251 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200253 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200254 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200255 .swdma_mask = ATA_SWDMA2, \
256 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100257 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 }
259
Bartlomiej Zolnierkiewicz85620432007-10-20 00:32:34 +0200260static const struct ide_port_info amd74xx_chipsets[] __devinitdata = {
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100261 /* 0 */ DECLARE_AMD_DEV("AMD7401", 0x00, ATA_UDMA2),
262 /* 1 */ DECLARE_AMD_DEV("AMD7409", ATA_SWDMA2, ATA_UDMA4),
263 /* 2 */ DECLARE_AMD_DEV("AMD7411", ATA_SWDMA2, ATA_UDMA5),
264 /* 3 */ DECLARE_AMD_DEV("AMD7441", ATA_SWDMA2, ATA_UDMA5),
265 /* 4 */ DECLARE_AMD_DEV("AMD8111", ATA_SWDMA2, ATA_UDMA6),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100267 /* 5 */ DECLARE_NV_DEV("NFORCE", ATA_UDMA5),
268 /* 6 */ DECLARE_NV_DEV("NFORCE2", ATA_UDMA6),
269 /* 7 */ DECLARE_NV_DEV("NFORCE2-U400R", ATA_UDMA6),
270 /* 8 */ DECLARE_NV_DEV("NFORCE2-U400R-SATA", ATA_UDMA6),
271 /* 9 */ DECLARE_NV_DEV("NFORCE3-150", ATA_UDMA6),
272 /* 10 */ DECLARE_NV_DEV("NFORCE3-250", ATA_UDMA6),
273 /* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA", ATA_UDMA6),
274 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2", ATA_UDMA6),
275 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804", ATA_UDMA6),
276 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04", ATA_UDMA6),
277 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51", ATA_UDMA6),
278 /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55", ATA_UDMA6),
279 /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61", ATA_UDMA6),
280 /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65", ATA_UDMA6),
281 /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67", ATA_UDMA6),
282 /* 20 */ DECLARE_NV_DEV("NFORCE-MCP73", ATA_UDMA6),
283 /* 21 */ DECLARE_NV_DEV("NFORCE-MCP77", ATA_UDMA6),
284
285 /* 22 */ DECLARE_AMD_DEV("AMD5536", ATA_SWDMA2, ATA_UDMA5),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286};
287
288static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
289{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100290 struct ide_port_info d;
291 u8 idx = id->driver_data;
292
293 d = amd74xx_chipsets[idx];
294
295 /*
296 * Check for bad SWDMA and incorrectly wired Serenade mainboards.
297 */
298 if (idx == 1) {
299 if (dev->revision <= 7)
300 d.swdma_mask = 0;
Bartlomiej Zolnierkiewicz8ac2b42a2008-02-01 23:09:30 +0100301 d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100302 } else if (idx == 4) {
303 if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
304 dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
305 d.udma_mask = ATA_UDMA5;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306 }
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100307
308 printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n",
309 d.name, pci_name(dev), dev->revision,
310 amd_dma[fls(d.udma_mask) - 1]);
311
312 return ide_setup_pci_device(dev, &d);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313}
314
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200315static const struct pci_device_id amd74xx_pci_tbl[] = {
316 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
317 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
318 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 },
319 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 3 },
320 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 4 },
321 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 5 },
322 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 6 },
323 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 7 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200325 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 8 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200327 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 9 },
328 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 10 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200330 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 11 },
331 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 12 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200333 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 13 },
334 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 14 },
335 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 15 },
336 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 16 },
337 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 17 },
338 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 18 },
339 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 19 },
340 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 20 },
341 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 21 },
342 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 22 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 { 0, },
344};
345MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
346
347static struct pci_driver driver = {
348 .name = "AMD_IDE",
349 .id_table = amd74xx_pci_tbl,
350 .probe = amd74xx_probe,
351};
352
Bartlomiej Zolnierkiewicz82ab1ee2007-01-27 13:46:56 +0100353static int __init amd74xx_ide_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354{
355 return ide_pci_register_driver(&driver);
356}
357
358module_init(amd74xx_ide_init);
359
360MODULE_AUTHOR("Vojtech Pavlik");
361MODULE_DESCRIPTION("AMD PCI IDE driver");
362MODULE_LICENSE("GPL");