27 #include <linux/kernel.h>
28 #include <linux/module.h>
30 #include <linux/pci.h>
35 #include <linux/device.h>
39 #define DRV_NAME "sata_uli"
40 #define DRV_VERSION "1.3"
74 .id_table = uli_pci_tbl,
75 .probe = uli_init_one,
76 .remove = ata_pci_remove_one,
84 .inherits = &ata_bmdma_port_ops,
85 .scr_read = uli_scr_read,
86 .scr_write = uli_scr_write,
104 static unsigned int get_scr_cfg_addr(
struct ata_port *ap,
unsigned int sc_reg)
110 static u32 uli_scr_cfg_read(
struct ata_link *
link,
unsigned int sc_reg)
113 unsigned int cfg_addr = get_scr_cfg_addr(link->
ap, sc_reg);
116 pci_read_config_dword(pdev, cfg_addr, &val);
123 unsigned int cfg_addr = get_scr_cfg_addr(link->
ap, scr);
125 pci_write_config_dword(pdev, cfg_addr, val);
133 *val = uli_scr_cfg_read(link, sc_reg);
137 static int uli_scr_write(
struct ata_link *link,
unsigned int sc_reg,
u32 val)
142 uli_scr_cfg_write(link, sc_reg, val);
153 struct ata_ioports *ioaddr;
174 host->private_data = hpriv;
177 rc = ata_pci_sff_init_host(
host);
181 ata_pci_bmdma_init(
host);
193 ioaddr = &
host->ports[2]->ioaddr;
194 ioaddr->cmd_addr = iomap[0] + 8;
195 ioaddr->altstatus_addr =
196 ioaddr->ctl_addr = (
void __iomem *)
198 ioaddr->bmdma_addr = iomap[4] + 16;
203 "cmd 0x%llx ctl 0x%llx bmdma 0x%llx",
208 ioaddr = &
host->ports[3]->ioaddr;
209 ioaddr->cmd_addr = iomap[2] + 8;
210 ioaddr->altstatus_addr =
211 ioaddr->ctl_addr = (
void __iomem *)
213 ioaddr->bmdma_addr = iomap[4] + 24;
218 "cmd 0x%llx ctl 0x%llx bmdma 0x%llx",