blob: 2e8cbcaf3ef5cdff61608d3c039d008922d5b048 [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;
89 ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 struct ide_timing t, p;
91 int T, UT;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010092 u8 udma_mask = hwif->ultra_mask;
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 T = 1000000000 / amd_clock;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +010095 UT = (udma_mask == ATA_UDMA2) ? T : (T / 2);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096
97 ide_timing_compute(drive, speed, &t, T, UT);
98
99 if (peer->present) {
100 ide_timing_compute(peer, peer->current_speed, &p, T, UT);
101 ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
102 }
103
104 if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1;
105 if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15;
106
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100107 amd_set_speed(hwif->pci_dev, drive->dn, udma_mask, &t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108}
109
110/*
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200111 * amd_set_pio_mode() is a callback from upper layers for PIO-only tuning.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 */
113
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200114static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115{
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200116 amd_set_drive(drive, XFER_PIO_0 + pio);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117}
118
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100119static void __devinit amd7409_cable_detect(struct pci_dev *dev,
120 const char *name)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100122 /* no host side cable detection */
123 amd_80w = 0x03;
124}
125
126static void __devinit amd7411_cable_detect(struct pci_dev *dev,
127 const char *name)
128{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 int i;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100130 u32 u = 0;
131 u8 t = 0, offset = amd_offset(dev);
132
133 pci_read_config_byte(dev, AMD_CABLE_DETECT + offset, &t);
134 pci_read_config_dword(dev, AMD_UDMA_TIMING + offset, &u);
135 amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);
136 for (i = 24; i >= 0; i -= 8)
137 if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) {
138 printk(KERN_WARNING "%s: BIOS didn't set cable bits "
139 "correctly. Enabling workaround.\n",
140 name);
141 amd_80w |= (1 << (1 - (i >> 4)));
142 }
143}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144
145/*
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100146 * The initialization callback. Initialize drive independent registers.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 */
148
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100149static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
150 const char *name)
151{
152 u8 t = 0, offset = amd_offset(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
154/*
155 * Check 80-wire cable presence.
156 */
157
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100158 if (dev->vendor == PCI_VENDOR_ID_AMD &&
159 dev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
160 ; /* no UDMA > 2 */
161 else if (dev->vendor == PCI_VENDOR_ID_AMD &&
162 dev->device == PCI_DEVICE_ID_AMD_VIPER_7409)
163 amd7409_cable_detect(dev, name);
164 else
165 amd7411_cable_detect(dev, name);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166
167/*
168 * Take care of prefetch & postwrite.
169 */
170
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100171 pci_read_config_byte(dev, AMD_IDE_CONFIG + offset, &t);
172 /*
173 * Check for broken FIFO support.
174 */
175 if (dev->vendor == PCI_VENDOR_ID_AMD &&
176 dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
177 t &= 0x0f;
178 else
179 t |= 0xf0;
180 pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182/*
183 * Determine the system bus clock.
184 */
185
186 amd_clock = system_bus_clock() * 1000;
187
188 switch (amd_clock) {
189 case 33000: amd_clock = 33333; break;
190 case 37000: amd_clock = 37500; break;
191 case 41000: amd_clock = 41666; break;
192 }
193
194 if (amd_clock < 20000 || amd_clock > 50000) {
195 printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100196 name, amd_clock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197 amd_clock = 33333;
198 }
199
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 return dev->irq;
201}
202
Herbert Xue895f922005-07-03 16:15:41 +0200203static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205 if (hwif->irq == 0) /* 0 is bogus but will do for now */
206 hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel);
207
Bartlomiej Zolnierkiewicz26bcb872007-10-11 23:54:00 +0200208 hwif->set_pio_mode = &amd_set_pio_mode;
Bartlomiej Zolnierkiewicz88b2b322007-10-13 17:47:51 +0200209 hwif->set_dma_mode = &amd_set_drive;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 if (!hwif->dma_base)
212 return;
213
Bartlomiej Zolnierkiewicz49521f92007-07-09 23:17:58 +0200214 if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
215 if ((amd_80w >> hwif->channel) & 1)
216 hwif->cbl = ATA_CBL_PATA80;
217 else
218 hwif->cbl = ATA_CBL_PATA40;
219 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220}
221
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200222#define IDE_HFLAGS_AMD \
223 (IDE_HFLAG_PIO_NO_BLACKLIST | \
224 IDE_HFLAG_PIO_NO_DOWNGRADE | \
Bartlomiej Zolnierkiewicz4db90a12008-01-25 22:17:18 +0100225 IDE_HFLAG_ABUSE_SET_DMA_MODE | \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200226 IDE_HFLAG_POST_SET_MODE | \
227 IDE_HFLAG_IO_32BIT | \
228 IDE_HFLAG_UNMASK_IRQS | \
229 IDE_HFLAG_BOOTABLE)
230
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100231#define DECLARE_AMD_DEV(name_str, swdma, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232 { \
233 .name = name_str, \
234 .init_chipset = init_chipset_amd74xx, \
235 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200237 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200238 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100239 .swdma_mask = swdma, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200240 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100241 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 }
243
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100244#define DECLARE_NV_DEV(name_str, udma) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 { \
246 .name = name_str, \
247 .init_chipset = init_chipset_amd74xx, \
248 .init_hwif = init_hwif_amd74xx, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249 .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
Bartlomiej Zolnierkiewiczcaea7602007-10-20 00:32:30 +0200250 .host_flags = IDE_HFLAGS_AMD, \
Bartlomiej Zolnierkiewicz4099d142007-07-20 01:11:59 +0200251 .pio_mask = ATA_PIO5, \
Bartlomiej Zolnierkiewicz5f8b6c32007-10-19 00:30:07 +0200252 .swdma_mask = ATA_SWDMA2, \
253 .mwdma_mask = ATA_MWDMA2, \
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100254 .udma_mask = udma, \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255 }
256
Bartlomiej Zolnierkiewicz85620432007-10-20 00:32:34 +0200257static const struct ide_port_info amd74xx_chipsets[] __devinitdata = {
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100258 /* 0 */ DECLARE_AMD_DEV("AMD7401", 0x00, ATA_UDMA2),
259 /* 1 */ DECLARE_AMD_DEV("AMD7409", ATA_SWDMA2, ATA_UDMA4),
260 /* 2 */ DECLARE_AMD_DEV("AMD7411", ATA_SWDMA2, ATA_UDMA5),
261 /* 3 */ DECLARE_AMD_DEV("AMD7441", ATA_SWDMA2, ATA_UDMA5),
262 /* 4 */ DECLARE_AMD_DEV("AMD8111", ATA_SWDMA2, ATA_UDMA6),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100264 /* 5 */ DECLARE_NV_DEV("NFORCE", ATA_UDMA5),
265 /* 6 */ DECLARE_NV_DEV("NFORCE2", ATA_UDMA6),
266 /* 7 */ DECLARE_NV_DEV("NFORCE2-U400R", ATA_UDMA6),
267 /* 8 */ DECLARE_NV_DEV("NFORCE2-U400R-SATA", ATA_UDMA6),
268 /* 9 */ DECLARE_NV_DEV("NFORCE3-150", ATA_UDMA6),
269 /* 10 */ DECLARE_NV_DEV("NFORCE3-250", ATA_UDMA6),
270 /* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA", ATA_UDMA6),
271 /* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2", ATA_UDMA6),
272 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804", ATA_UDMA6),
273 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04", ATA_UDMA6),
274 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51", ATA_UDMA6),
275 /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55", ATA_UDMA6),
276 /* 17 */ DECLARE_NV_DEV("NFORCE-MCP61", ATA_UDMA6),
277 /* 18 */ DECLARE_NV_DEV("NFORCE-MCP65", ATA_UDMA6),
278 /* 19 */ DECLARE_NV_DEV("NFORCE-MCP67", ATA_UDMA6),
279 /* 20 */ DECLARE_NV_DEV("NFORCE-MCP73", ATA_UDMA6),
280 /* 21 */ DECLARE_NV_DEV("NFORCE-MCP77", ATA_UDMA6),
281
282 /* 22 */ DECLARE_AMD_DEV("AMD5536", ATA_SWDMA2, ATA_UDMA5),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283};
284
285static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
286{
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100287 struct ide_port_info d;
288 u8 idx = id->driver_data;
289
290 d = amd74xx_chipsets[idx];
291
292 /*
293 * Check for bad SWDMA and incorrectly wired Serenade mainboards.
294 */
295 if (idx == 1) {
296 if (dev->revision <= 7)
297 d.swdma_mask = 0;
Bartlomiej Zolnierkiewicz8ac2b42a2008-02-01 23:09:30 +0100298 d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX;
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100299 } else if (idx == 4) {
300 if (dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
301 dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
302 d.udma_mask = ATA_UDMA5;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303 }
Bartlomiej Zolnierkiewicz993da8f2008-02-01 23:09:30 +0100304
305 printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n",
306 d.name, pci_name(dev), dev->revision,
307 amd_dma[fls(d.udma_mask) - 1]);
308
309 return ide_setup_pci_device(dev, &d);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310}
311
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200312static const struct pci_device_id amd74xx_pci_tbl[] = {
313 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
314 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
315 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7411), 2 },
316 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_OPUS_7441), 3 },
317 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_8111_IDE), 4 },
318 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE), 5 },
319 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE), 6 },
320 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE), 7 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200322 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA), 8 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200324 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE), 9 },
325 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE), 10 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326#ifdef CONFIG_BLK_DEV_IDE_SATA
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200327 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA), 11 },
328 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2), 12 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329#endif
Bartlomiej Zolnierkiewicz9cbcc5e2007-10-16 22:29:56 +0200330 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE), 13 },
331 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE), 14 },
332 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE), 15 },
333 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE), 16 },
334 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE), 17 },
335 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE), 18 },
336 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE), 19 },
337 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE), 20 },
338 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE), 21 },
339 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), 22 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 { 0, },
341};
342MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
343
344static struct pci_driver driver = {
345 .name = "AMD_IDE",
346 .id_table = amd74xx_pci_tbl,
347 .probe = amd74xx_probe,
348};
349
Bartlomiej Zolnierkiewicz82ab1ee2007-01-27 13:46:56 +0100350static int __init amd74xx_ide_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351{
352 return ide_pci_register_driver(&driver);
353}
354
355module_init(amd74xx_ide_init);
356
357MODULE_AUTHOR("Vojtech Pavlik");
358MODULE_DESCRIPTION("AMD PCI IDE driver");
359MODULE_LICENSE("GPL");