diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:58:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:58:03 -0500 |
commit | 6f366c1c751454df3d1c0f25f15ee0164821112a (patch) | |
tree | a609adb9ead12ec0df5dcadaa11133f92a442466 /drivers/ata/sata_via.c | |
parent | 221dee285ee38099b82437531bcae9fa9cb64cc4 (diff) | |
parent | cb48cab7f363014e0a5dc21f7b4892c15d626d41 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (51 commits)
[libata] bump versions
[libata] Trim trailing whitespace.
[libata] sata_mv: Fix 50xx irq mask
[libata] sata_mv: don't touch reserved bits in EDMA config register
libata: Use new id_to_dma_mode function to tidy reporting in more drivers (minimally tested)
pata_pcmcia: Fix oops in 2.6.21-rc1
Add id_to_dma_mode function for printing DMA modes
sata_promise: simplify port setup
sata_promise: fix 20619 new EH merge error
[libata] ACPI: remove needless ->qc_issue hook existence test
sata_vsc: refactor vsc_sata_interrupt and hook up error handling
sata_sil: ignore and clear spurious IRQs while executing commands by polling
sata_mv: fix pci_enable_msi() error handling
pata_amd: fix an obvious bug in cable detection
[libata] ata_piix: remove duplicate PCI IDs
sata_nv: complain on spurious completion notifiers
libata: test major version in ata_id_is_sata()
sata_nv: kill old private BMDMA helper functions
libata: fix remaining ap->id
ahci: consider SDB FIS containing spurious NCQ completions HSM violation (regenerated)
...
Diffstat (limited to 'drivers/ata/sata_via.c')
-rw-r--r-- | drivers/ata/sata_via.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index baca6d79bb0b..598e6a26a481 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <linux/libata.h> | 46 | #include <linux/libata.h> |
47 | 47 | ||
48 | #define DRV_NAME "sata_via" | 48 | #define DRV_NAME "sata_via" |
49 | #define DRV_VERSION "2.0" | 49 | #define DRV_VERSION "2.1" |
50 | 50 | ||
51 | enum board_ids_enum { | 51 | enum board_ids_enum { |
52 | vt6420, | 52 | vt6420, |
@@ -60,7 +60,7 @@ enum { | |||
60 | SATA_PATA_SHARING = 0x49, /* PATA/SATA sharing func ctrl */ | 60 | SATA_PATA_SHARING = 0x49, /* PATA/SATA sharing func ctrl */ |
61 | PATA_UDMA_TIMING = 0xB3, /* PATA timing for DMA/ cable detect */ | 61 | PATA_UDMA_TIMING = 0xB3, /* PATA timing for DMA/ cable detect */ |
62 | PATA_PIO_TIMING = 0xAB, /* PATA timing register */ | 62 | PATA_PIO_TIMING = 0xAB, /* PATA timing register */ |
63 | 63 | ||
64 | PORT0 = (1 << 1), | 64 | PORT0 = (1 << 1), |
65 | PORT1 = (1 << 0), | 65 | PORT1 = (1 << 0), |
66 | ALL_PORTS = PORT0 | PORT1, | 66 | ALL_PORTS = PORT0 | PORT1, |
@@ -151,7 +151,7 @@ static const struct ata_port_operations vt6420_sata_ops = { | |||
151 | 151 | ||
152 | static const struct ata_port_operations vt6421_pata_ops = { | 152 | static const struct ata_port_operations vt6421_pata_ops = { |
153 | .port_disable = ata_port_disable, | 153 | .port_disable = ata_port_disable, |
154 | 154 | ||
155 | .set_piomode = vt6421_set_pio_mode, | 155 | .set_piomode = vt6421_set_pio_mode, |
156 | .set_dmamode = vt6421_set_dma_mode, | 156 | .set_dmamode = vt6421_set_dma_mode, |
157 | 157 | ||
@@ -185,7 +185,7 @@ static const struct ata_port_operations vt6421_pata_ops = { | |||
185 | 185 | ||
186 | static const struct ata_port_operations vt6421_sata_ops = { | 186 | static const struct ata_port_operations vt6421_sata_ops = { |
187 | .port_disable = ata_port_disable, | 187 | .port_disable = ata_port_disable, |
188 | 188 | ||
189 | .tf_load = ata_tf_load, | 189 | .tf_load = ata_tf_load, |
190 | .tf_read = ata_tf_read, | 190 | .tf_read = ata_tf_read, |
191 | .check_status = ata_check_status, | 191 | .check_status = ata_check_status, |
@@ -423,16 +423,21 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev) | |||
423 | { | 423 | { |
424 | struct ata_probe_ent *probe_ent; | 424 | struct ata_probe_ent *probe_ent; |
425 | struct ata_port_info *ppi[2]; | 425 | struct ata_port_info *ppi[2]; |
426 | void __iomem * const *iomap; | 426 | void __iomem *bar5; |
427 | 427 | ||
428 | ppi[0] = ppi[1] = &vt6420_port_info; | 428 | ppi[0] = ppi[1] = &vt6420_port_info; |
429 | probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); | 429 | probe_ent = ata_pci_init_native_mode(pdev, ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY); |
430 | if (!probe_ent) | 430 | if (!probe_ent) |
431 | return NULL; | 431 | return NULL; |
432 | 432 | ||
433 | iomap = pcim_iomap_table(pdev); | 433 | bar5 = pcim_iomap(pdev, 5, 0); |
434 | probe_ent->port[0].scr_addr = svia_scr_addr(iomap[5], 0); | 434 | if (!bar5) { |
435 | probe_ent->port[1].scr_addr = svia_scr_addr(iomap[5], 1); | 435 | dev_printk(KERN_ERR, &pdev->dev, "failed to iomap PCI BAR 5\n"); |
436 | return NULL; | ||
437 | } | ||
438 | |||
439 | probe_ent->port[0].scr_addr = svia_scr_addr(bar5, 0); | ||
440 | probe_ent->port[1].scr_addr = svia_scr_addr(bar5, 1); | ||
436 | 441 | ||
437 | return probe_ent; | 442 | return probe_ent; |
438 | } | 443 | } |
@@ -460,6 +465,13 @@ static struct ata_probe_ent *vt6421_init_probe_ent(struct pci_dev *pdev) | |||
460 | probe_ent->mwdma_mask = 0x07; | 465 | probe_ent->mwdma_mask = 0x07; |
461 | probe_ent->udma_mask = 0x7f; | 466 | probe_ent->udma_mask = 0x7f; |
462 | 467 | ||
468 | for (i = 0; i < 6; i++) | ||
469 | if (!pcim_iomap(pdev, i, 0)) { | ||
470 | dev_printk(KERN_ERR, &pdev->dev, | ||
471 | "failed to iomap PCI BAR %d\n", i); | ||
472 | return NULL; | ||
473 | } | ||
474 | |||
463 | for (i = 0; i < N_PORTS; i++) | 475 | for (i = 0; i < N_PORTS; i++) |
464 | vt6421_init_addrs(probe_ent, pcim_iomap_table(pdev), i); | 476 | vt6421_init_addrs(probe_ent, pcim_iomap_table(pdev), i); |
465 | 477 | ||
@@ -522,7 +534,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
522 | if (rc) | 534 | if (rc) |
523 | return rc; | 535 | return rc; |
524 | 536 | ||
525 | rc = pcim_iomap_regions(pdev, 0x1f, DRV_NAME); | 537 | rc = pci_request_regions(pdev, DRV_NAME); |
526 | if (rc) { | 538 | if (rc) { |
527 | pcim_pin_device(pdev); | 539 | pcim_pin_device(pdev); |
528 | return rc; | 540 | return rc; |