aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_uli.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-01 01:06:36 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:38 -0500
commit0d5ff566779f894ca9937231a181eb31e4adff0e (patch)
treed1c7495c932581c1d41aa7f0fdb303348da49106 /drivers/ata/sata_uli.c
parent1a68ff13c8a9b517de3fd4187dc525412a6eba1b (diff)
libata: convert to iomap
Convert libata core layer and LLDs to use iomap. * managed iomap is used. Pointer to pcim_iomap_table() is cached at host->iomap and used through out LLDs. This basically replaces host->mmio_base. * if possible, pcim_iomap_regions() is used Most iomap operation conversions are taken from Jeff Garzik <jgarzik@pobox.com>'s iomap branch. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_uli.c')
-rw-r--r--drivers/ata/sata_uli.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 22eed6d07495..77de7cbbe1ae 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -108,7 +108,7 @@ static const struct ata_port_operations uli_ops = {
108 .bmdma_status = ata_bmdma_status, 108 .bmdma_status = ata_bmdma_status,
109 .qc_prep = ata_qc_prep, 109 .qc_prep = ata_qc_prep,
110 .qc_issue = ata_qc_issue_prot, 110 .qc_issue = ata_qc_issue_prot,
111 .data_xfer = ata_pio_data_xfer, 111 .data_xfer = ata_data_xfer,
112 112
113 .freeze = ata_bmdma_freeze, 113 .freeze = ata_bmdma_freeze,
114 .thaw = ata_bmdma_thaw, 114 .thaw = ata_bmdma_thaw,
@@ -188,6 +188,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
188 int rc; 188 int rc;
189 unsigned int board_idx = (unsigned int) ent->driver_data; 189 unsigned int board_idx = (unsigned int) ent->driver_data;
190 struct uli_priv *hpriv; 190 struct uli_priv *hpriv;
191 void __iomem * const *iomap;
191 192
192 if (!printed_version++) 193 if (!printed_version++)
193 dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); 194 dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
@@ -220,24 +221,26 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
220 221
221 probe_ent->private_data = hpriv; 222 probe_ent->private_data = hpriv;
222 223
224 iomap = pcim_iomap_table(pdev);
225
223 switch (board_idx) { 226 switch (board_idx) {
224 case uli_5287: 227 case uli_5287:
225 hpriv->scr_cfg_addr[0] = ULI5287_BASE; 228 hpriv->scr_cfg_addr[0] = ULI5287_BASE;
226 hpriv->scr_cfg_addr[1] = ULI5287_BASE + ULI5287_OFFS; 229 hpriv->scr_cfg_addr[1] = ULI5287_BASE + ULI5287_OFFS;
227 probe_ent->n_ports = 4; 230 probe_ent->n_ports = 4;
228 231
229 probe_ent->port[2].cmd_addr = pci_resource_start(pdev, 0) + 8; 232 probe_ent->port[2].cmd_addr = iomap[0] + 8;
230 probe_ent->port[2].altstatus_addr = 233 probe_ent->port[2].altstatus_addr =
231 probe_ent->port[2].ctl_addr = 234 probe_ent->port[2].ctl_addr = (void __iomem *)
232 (pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS) + 4; 235 ((unsigned long)iomap[1] | ATA_PCI_CTL_OFS) + 4;
233 probe_ent->port[2].bmdma_addr = pci_resource_start(pdev, 4) + 16; 236 probe_ent->port[2].bmdma_addr = iomap[4] + 16;
234 hpriv->scr_cfg_addr[2] = ULI5287_BASE + ULI5287_OFFS*4; 237 hpriv->scr_cfg_addr[2] = ULI5287_BASE + ULI5287_OFFS*4;
235 238
236 probe_ent->port[3].cmd_addr = pci_resource_start(pdev, 2) + 8; 239 probe_ent->port[3].cmd_addr = iomap[2] + 8;
237 probe_ent->port[3].altstatus_addr = 240 probe_ent->port[3].altstatus_addr =
238 probe_ent->port[3].ctl_addr = 241 probe_ent->port[3].ctl_addr = (void __iomem *)
239 (pci_resource_start(pdev, 3) | ATA_PCI_CTL_OFS) + 4; 242 ((unsigned long)iomap[3] | ATA_PCI_CTL_OFS) + 4;
240 probe_ent->port[3].bmdma_addr = pci_resource_start(pdev, 4) + 24; 243 probe_ent->port[3].bmdma_addr = iomap[4] + 24;
241 hpriv->scr_cfg_addr[3] = ULI5287_BASE + ULI5287_OFFS*5; 244 hpriv->scr_cfg_addr[3] = ULI5287_BASE + ULI5287_OFFS*5;
242 245
243 ata_std_ports(&probe_ent->port[2]); 246 ata_std_ports(&probe_ent->port[2]);