blob: 68517267d31ebf545d366388808030ac282caa3d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
3 * IDE driver for Linux.
4 *
5 * Copyright (c) 2000-2002 Vojtech Pavlik
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +02006 * Copyright (c) 2007 Bartlomiej Zolnierkiewicz
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
8 * Based on the work of:
9 * Andre Hedrick
10 */
11
12/*
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License version 2 as published by
15 * the Free Software Foundation.
16 */
17
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/module.h>
19#include <linux/kernel.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/pci.h>
21#include <linux/init.h>
22#include <linux/ide.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24#include "ide-timing.h"
25
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010026enum {
27 AMD_IDE_CONFIG = 0x41,
28 AMD_CABLE_DETECT = 0x42,
29 AMD_DRIVE_TIMING = 0x48,
30 AMD_8BIT_TIMING = 0x4e,
31 AMD_ADDRESS_SETUP = 0x4c,
32 AMD_UDMA_TIMING = 0x50,
Linus Torvalds1da177e2005-04-16 15:20:36 -070033};
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035static unsigned int amd_80w;
36static unsigned int amd_clock;
37
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +020038static char *amd_dma[] = { "16", "25", "33", "44", "66", "100", "133" };
Linus Torvalds1da177e2005-04-16 15:20:36 -070039static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 };
40
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010041static inline u8 amd_offset(struct pci_dev *dev)
42{
43 return (dev->vendor == PCI_VENDOR_ID_NVIDIA) ? 0x10 : 0;
44}
45
Linus Torvalds1da177e2005-04-16 15:20:36 -070046/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 * amd_set_speed() writes timing values to the chipset registers
48 */
49
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010050static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask,
51 struct ide_timing *timing)
Linus Torvalds1da177e2005-04-16 15:20:36 -070052{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010053 u8 t = 0, offset = amd_offset(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070054
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010055 pci_read_config_byte(dev, AMD_ADDRESS_SETUP + offset, &t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010057 pci_write_config_byte(dev, AMD_ADDRESS_SETUP + offset, t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010059 pci_write_config_byte(dev, AMD_8BIT_TIMING + offset + (1 - (dn >> 1)),
Linus Torvalds1da177e2005-04-16 15:20:36 -070060 ((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1));
61
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010062 pci_write_config_byte(dev, AMD_DRIVE_TIMING + offset + (3 - dn),
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));
64
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010065 switch (udma_mask) {
Bartlomiej Zolnierkiewicz75b1d972007-07-09 23:17:57 +020066 case ATA_UDMA2: t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
67 case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
68 case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
69 case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 15)]) : 0x03; break;
70 default: return;
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 }
72
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010073 pci_write_config_byte(dev, AMD_UDMA_TIMING + offset + (3 - dn), t);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074}
75
76/*
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +020077 * amd_set_drive() computes timing values and configures the chipset
78 * to a desired transfer mode. It also can be called by upper layers.
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 */
80
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +020081static void amd_set_drive(ide_drive_t *drive, const u8 speed)
Linus Torvalds1da177e2005-04-16 15:20:36 -070082{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010083 ide_hwif_t *hwif = drive->hwif;
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +010084 struct pci_dev *dev = to_pci_dev(hwif->dev);
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010085 ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 struct ide_timing t, p;
87 int T, UT;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010088 u8 udma_mask = hwif->ultra_mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 T = 1000000000 / amd_clock;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010091 UT = (udma_mask == ATA_UDMA2) ? T : (T / 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
93 ide_timing_compute(drive, speed, &t, T, UT);
94
95 if (peer->present) {
96 ide_timing_compute(peer, peer->current_speed, &p, T, UT);
97 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
98 }
99
100 if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
101 if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15;
102
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100103 amd_set_speed(dev, drive->dn, udma_mask, &t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104}
105
106/*
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200107 * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 */
109
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200110static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111{
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200112 amd_set_drive(drive, XFER_PIO_0 + pio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113}
114
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100115static void __devinit amd7409_cable_detect(struct pci_dev *dev,
116 const char *name)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100118 /* no host side cable detection */
119 amd_80w = 0x03;
120}
121
122static void __devinit amd7411_cable_detect(struct pci_dev *dev,
123 const char *name)
124{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 int i;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100126 u32 u = 0;
127 u8 t = 0, offset = amd_offset(dev);
128
129 pci_read_config_byte(dev, AMD_CABLE_DETECT + offset, &t);
130 pci_read_config_dword(dev, AMD_UDMA_TIMING + offset, &u);
131 amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);
132 for (i = 24; i >= 0; i -= 8)
133 if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) {
134 printk(KERN_WARNING "%s: BIOS didn't set cable bits "
135 "correctly. Enabling workaround.\n",
136 name);
137 amd_80w |= (1 << (1 - (i >> 4)));
138 }
139}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
141/*
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100142 * The initialization callback. Initialize drive independent registers.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143 */
144
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100145static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
146 const char *name)
147{
148 u8 t = 0, offset = amd_offset(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149
150/*
151 * Check 80-wire cable presence.
152 */
153
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100154 if (dev->vendor == PCI_VENDOR_ID_AMD &&
155 dev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
156 ; /* no UDMA > 2 */
157 else if (dev->vendor == PCI_VENDOR_ID_AMD &&
158 dev->device == PCI_DEVICE_ID_AMD_VIPER_7409)
159 amd7409_cable_detect(dev, name);
160 else
161 amd7411_cable_detect(dev, name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
163/*
164 * Take care of prefetch & postwrite.
165 */
166
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100167 pci_read_config_byte(dev, AMD_IDE_CONFIG + offset, &t);
168 /*
169 * Check for broken FIFO support.
170 */
171 if (dev->vendor == PCI_VENDOR_ID_AMD &&
172 dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
173 t &= 0x0f;
174 else
175 t |= 0xf0;
176 pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
178/*
179 * Determine the system bus clock.
180 */
181
182 amd_clock = system_bus_clock() * 1000;
183
184 switch (amd_clock) {
185 case 33000: amd_clock = 33333; break;
186 case 37000: amd_clock = 37500; break;
187 case 41000: amd_clock = 41666; break;
188 }
189
190 if (amd_clock < 20000 || amd_clock > 50000) {
191 printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100192 name, amd_clock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193 amd_clock = 33333;
194 }
195
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 return dev->irq;
197}
198
Bartlomiej Zolnierkiewiczbfa14b42008-02-02 19:56:31 +0100199static u8 __devinit amd_cable_detect(ide_hwif_t *hwif)
200{
201 if ((amd_80w >> hwif->channel) & 1)
202 return ATA_CBL_PATA80;
203 else
204 return ATA_CBL_PATA40;
205}
206
Herbert Xue895f922005-07-03 16:15:41 +0200207static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208{
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100209 struct pci_dev *dev = to_pci_dev(hwif->dev);
210
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 if (hwif->irq == 0) /* 0 is bogus but will do for now */
Bartlomiej Zolnierkiewicz36501652008-02-01 23:09:31 +0100212 hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200214 hwif->set_pio_mode = &amd_set_pio_mode;
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +0200215 hwif->set_dma_mode = &amd_set_drive;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700216
Bartlomiej Zolnierkiewiczbfa14b42008-02-02 19:56:31 +0100217 hwif->cable_detect = amd_cable_detect;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218}
219
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200220#define IDE_HFLAGS_AMD \
221 (IDE_HFLAG_PIO_NO_BLACKLIST | \
222 IDE_HFLAG_PIO_NO_DOWNGRADE | \
Bartlomiej Zolnierkiewicz4db90a12008-01-25 22:17:18 +0100223 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200224 IDE_HFLAG_POST_SET_MODE | \
225 IDE_HFLAG_IO_32BIT | \
Bartlomiej Zolnierkiewicz5e71d9c2008-04-26 17:36:35 +0200226 IDE_HFLAG_UNMASK_IRQS)
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200227
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100228#define DECLARE_AMD_DEV(name_str, swdma, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229 { \
230 .name = name_str, \
231 .init_chipset = init_chipset_amd74xx, \
232 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200234 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200235 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100236 .swdma_mask = swdma, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200237 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100238 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 }
240
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100241#define DECLARE_NV_DEV(name_str, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 { \
243 .name = name_str, \
244 .init_chipset = init_chipset_amd74xx, \
245 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200247 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200248 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200249 .swdma_mask = ATA_SWDMA2, \
250 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100251 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252 }
253
Bartlomiej Zolnierkiewicz85620432007-10-20 00:32:34 +0200254static const struct ide_port_info amd74xx_chipsets[] __devinitdata = {
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100255 /* 0 */ DECLARE_AMD_DEV("AMD7401", 0x00, ATA_UDMA2),
256 /* 1 */ DECLARE_AMD_DEV("AMD7409", ATA_SWDMA2, ATA_UDMA4),
257 /* 2 */ DECLARE_AMD_DEV("AMD7411", ATA_SWDMA2, ATA_UDMA5),
258 /* 3 */ DECLARE_AMD_DEV("AMD7441", ATA_SWDMA2, ATA_UDMA5),
259 /* 4 */ DECLARE_AMD_DEV("AMD8111", ATA_SWDMA2, ATA_UDMA6),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100261 /* 5 */ DECLARE_NV_DEV("NFORCE", ATA_UDMA5),
262 /* 6 */ DECLARE_NV_DEV("NFORCE2", ATA_UDMA6),
263 /* 7 */ DECLARE_NV_DEV("NFORCE2-U400R", ATA_UDMA6),
264 /* 8 */ DECLARE_NV_DEV("NFORCE2-U400R-SATA", ATA_UDMA6),
265 /* 9 */ DECLARE_NV_DEV("NFORCE3-150", ATA_UDMA6),
266 /* 10 */ DECLARE_NV_DEV("NFORCE3-250", ATA_UDMA6),
267 /* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA", ATA_UDMA6),
268 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2", ATA_UDMA6),
269 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804", ATA_UDMA6),
270 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04", ATA_UDMA6),
271 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51", ATA_UDMA6),
272 /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55", ATA_UDMA6),
273 /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61", ATA_UDMA6),
274 /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65", ATA_UDMA6),
275 /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67", ATA_UDMA6),
276 /* 20 */ DECLARE_NV_DEV("NFORCE-MCP73", ATA_UDMA6),
277 /* 21 */ DECLARE_NV_DEV("NFORCE-MCP77", ATA_UDMA6),
278
279 /* 22 */ DECLARE_AMD_DEV("AMD5536", ATA_SWDMA2, ATA_UDMA5),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280};
281
282static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
283{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100284 struct ide_port_info d;
285 u8 idx = id->driver_data;
286
287 d = amd74xx_chipsets[idx];
288
289 /*
290 * Check for bad SWDMA and incorrectly wired Serenade mainboards.
291 */
292 if (idx == 1) {
293 if (dev->revision <= 7)
294 d.swdma_mask = 0;
Bartlomiej Zolnierkiewicz8ac2b42a2008-02-01 23:09:30 +0100295 d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100296 } else if (idx == 4) {
297 if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
298 dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
299 d.udma_mask = ATA_UDMA5;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 }
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100301
302 printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n",
303 d.name, pci_name(dev), dev->revision,
304 amd_dma[fls(d.udma_mask) - 1]);
305
306 return ide_setup_pci_device(dev, &d);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307}
308
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200309static const struct pci_device_id amd74xx_pci_tbl[] = {
310 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
311 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
312 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 },
313 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 3 },
314 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 4 },
315 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 5 },
316 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 6 },
317 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 7 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200319 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 8 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200321 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 9 },
322 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 10 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200324 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 11 },
325 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 12 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200327 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 13 },
328 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 14 },
329 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 15 },
330 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 16 },
331 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 17 },
332 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 18 },
333 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 19 },
334 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 20 },
335 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 21 },
336 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 22 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 { 0, },
338};
339MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
340
341static struct pci_driver driver = {
342 .name = "AMD_IDE",
343 .id_table = amd74xx_pci_tbl,
344 .probe = amd74xx_probe,
345};
346
Bartlomiej Zolnierkiewicz82ab1ee2007-01-27 13:46:56 +0100347static int __init amd74xx_ide_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348{
349 return ide_pci_register_driver(&driver);
350}
351
352module_init(amd74xx_ide_init);
353
354MODULE_AUTHOR("Vojtech Pavlik");
355MODULE_DESCRIPTION("AMD PCI IDE driver");
356MODULE_LICENSE("GPL");