Lines Matching full:ap
30 * Note that all runtime hot priv ports are cached in ap private_data
69 #define ATP867X_IOBASE(ap) ((ap)->host->iomap[0]) argument
70 #define ATP867X_SYS_INFO(ap) (0x3F + ATP867X_IOBASE(ap)) argument
72 #define ATP867X_IO_PORTBASE(ap, port) (0x00 + ATP867X_IOBASE(ap) + \ argument
74 #define ATP867X_IO_DMABASE(ap, port) (0x40 + \ argument
75 ATP867X_IO_PORTBASE((ap), (port)))
77 #define ATP867X_IO_STATUS(ap, port) (0x07 + \ argument
78 ATP867X_IO_PORTBASE((ap), (port)))
79 #define ATP867X_IO_ALTSTATUS(ap, port) (0x0E + \ argument
80 ATP867X_IO_PORTBASE((ap), (port)))
85 #define ATP867X_IO_MSTRPIOSPD(ap, port) (0x08 + \ argument
86 ATP867X_IO_DMABASE((ap), (port)))
87 #define ATP867X_IO_SLAVPIOSPD(ap, port) (0x09 + \ argument
88 ATP867X_IO_DMABASE((ap), (port)))
89 #define ATP867X_IO_8BPIOSPD(ap, port) (0x0A + \ argument
90 ATP867X_IO_DMABASE((ap), (port)))
91 #define ATP867X_IO_DMAMODE(ap, port) (0x0B + \ argument
92 ATP867X_IO_DMABASE((ap), (port)))
94 #define ATP867X_IO_PORTSPD(ap, port) (0x4A + \ argument
95 ATP867X_IO_PORTBASE((ap), (port)))
96 #define ATP867X_IO_PREREAD(ap, port) (0x4C + \ argument
97 ATP867X_IO_PORTBASE((ap), (port)))
107 static void atp867x_set_dmamode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_dmamode() argument
109 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_dmamode()
110 struct atp867x_priv *dp = ap->private_data; in atp867x_set_dmamode()
138 static int atp867x_get_active_clocks_shifted(struct ata_port *ap, in atp867x_get_active_clocks_shifted() argument
141 struct atp867x_priv *dp = ap->private_data; in atp867x_get_active_clocks_shifted()
158 ata_port_warn(ap, "ATP867X: active %dclk is invalid. " in atp867x_get_active_clocks_shifted()
174 static int atp867x_get_recover_clocks_shifted(struct ata_port *ap, in atp867x_get_recover_clocks_shifted() argument
192 ata_port_warn(ap, "ATP867X: recover %dclk is invalid. " in atp867x_get_recover_clocks_shifted()
203 static void atp867x_set_piomode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_piomode() argument
206 struct atp867x_priv *dp = ap->private_data; in atp867x_set_piomode()
228 b = atp867x_get_active_clocks_shifted(ap, t.active) | in atp867x_set_piomode()
229 atp867x_get_recover_clocks_shifted(ap, t.recover); in atp867x_set_piomode()
236 b = atp867x_get_active_clocks_shifted(ap, t.act8b) | in atp867x_set_piomode()
237 atp867x_get_recover_clocks_shifted(ap, t.rec8b); in atp867x_set_piomode()
252 static int atp867x_cable_detect(struct ata_port *ap) in atp867x_cable_detect() argument
254 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_cable_detect()
288 static void atp867x_check_ports(struct ata_port *ap, int port) in atp867x_check_ports() argument
290 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_check_ports()
291 struct atp867x_priv *dp = ap->private_data; in atp867x_check_ports()
293 ata_port_dbg(ap, "ATP867X: port[%d] addresses\n" in atp867x_check_ports()
314 (unsigned long)ATP867X_IO_PORTBASE(ap, port), in atp867x_check_ports()
316 (unsigned long)ATP867X_IO_ALTSTATUS(ap, port), in atp867x_check_ports()
318 (unsigned long)ATP867X_IO_DMABASE(ap, port), in atp867x_check_ports()
336 static int atp867x_set_priv(struct ata_port *ap) in atp867x_set_priv() argument
338 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_priv()
340 int port = ap->port_no; in atp867x_set_priv()
342 dp = ap->private_data = in atp867x_set_priv()
347 dp->dma_mode = ATP867X_IO_DMAMODE(ap, port); in atp867x_set_priv()
348 dp->mstr_piospd = ATP867X_IO_MSTRPIOSPD(ap, port); in atp867x_set_priv()
349 dp->slave_piospd = ATP867X_IO_SLAVPIOSPD(ap, port); in atp867x_set_priv()
350 dp->eightb_piospd = ATP867X_IO_8BPIOSPD(ap, port); in atp867x_set_priv()
353 ioread8(ATP867X_SYS_INFO(ap)) & ATP867X_IO_SYS_INFO_66MHZ; in atp867x_set_priv()
361 struct ata_port *ap = host->ports[0]; in atp867x_fixup() local
380 iowrite16(ATP867X_IO_PORTSPD_VAL, ATP867X_IO_PORTSPD(ap, i)); in atp867x_fixup()
386 iowrite16(ATP867X_PREREAD_VAL, ATP867X_IO_PREREAD(ap, i)); in atp867x_fixup()
388 v = ioread8(ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
391 iowrite8(v, ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
396 v = ioread8(ATP867X_SYS_INFO(ap)); in atp867x_fixup()
400 iowrite8(v, ATP867X_SYS_INFO(ap)); in atp867x_fixup()
430 struct ata_port *ap = host->ports[i]; in atp867x_ata_pci_sff_init_host() local
431 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_ata_pci_sff_init_host()
433 ioaddr->cmd_addr = ATP867X_IO_PORTBASE(ap, i); in atp867x_ata_pci_sff_init_host()
435 = ATP867X_IO_ALTSTATUS(ap, i); in atp867x_ata_pci_sff_init_host()
436 ioaddr->bmdma_addr = ATP867X_IO_DMABASE(ap, i); in atp867x_ata_pci_sff_init_host()
439 rc = atp867x_set_priv(ap); in atp867x_ata_pci_sff_init_host()
443 atp867x_check_ports(ap, i); in atp867x_ata_pci_sff_init_host()
445 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", in atp867x_ata_pci_sff_init_host()
448 ata_port_desc(ap, "bmdma 0x%lx", in atp867x_ata_pci_sff_init_host()