Lines Matching refs:ap
83 #define ATP867X_IOBASE(ap) ((ap)->host->iomap[0]) argument
84 #define ATP867X_SYS_INFO(ap) (0x3F + ATP867X_IOBASE(ap)) argument
86 #define ATP867X_IO_PORTBASE(ap, port) (0x00 + ATP867X_IOBASE(ap) + \ argument
88 #define ATP867X_IO_DMABASE(ap, port) (0x40 + \ argument
89 ATP867X_IO_PORTBASE((ap), (port)))
91 #define ATP867X_IO_STATUS(ap, port) (0x07 + \ argument
92 ATP867X_IO_PORTBASE((ap), (port)))
93 #define ATP867X_IO_ALTSTATUS(ap, port) (0x0E + \ argument
94 ATP867X_IO_PORTBASE((ap), (port)))
99 #define ATP867X_IO_MSTRPIOSPD(ap, port) (0x08 + \ argument
100 ATP867X_IO_DMABASE((ap), (port)))
101 #define ATP867X_IO_SLAVPIOSPD(ap, port) (0x09 + \ argument
102 ATP867X_IO_DMABASE((ap), (port)))
103 #define ATP867X_IO_8BPIOSPD(ap, port) (0x0A + \ argument
104 ATP867X_IO_DMABASE((ap), (port)))
105 #define ATP867X_IO_DMAMODE(ap, port) (0x0B + \ argument
106 ATP867X_IO_DMABASE((ap), (port)))
108 #define ATP867X_IO_PORTSPD(ap, port) (0x4A + \ argument
109 ATP867X_IO_PORTBASE((ap), (port)))
110 #define ATP867X_IO_PREREAD(ap, port) (0x4C + \ argument
111 ATP867X_IO_PORTBASE((ap), (port)))
121 static void atp867x_set_dmamode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_dmamode() argument
123 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_dmamode()
124 struct atp867x_priv *dp = ap->private_data; in atp867x_set_dmamode()
152 static int atp867x_get_active_clocks_shifted(struct ata_port *ap, in atp867x_get_active_clocks_shifted() argument
155 struct atp867x_priv *dp = ap->private_data; in atp867x_get_active_clocks_shifted()
214 static void atp867x_set_piomode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_piomode() argument
217 struct atp867x_priv *dp = ap->private_data; in atp867x_set_piomode()
239 b = atp867x_get_active_clocks_shifted(ap, t.active) | in atp867x_set_piomode()
247 b = atp867x_get_active_clocks_shifted(ap, t.act8b) | in atp867x_set_piomode()
263 static int atp867x_cable_detect(struct ata_port *ap) in atp867x_cable_detect() argument
265 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_cable_detect()
300 static void atp867x_check_ports(struct ata_port *ap, int port) in atp867x_check_ports() argument
302 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_check_ports()
303 struct atp867x_priv *dp = ap->private_data; in atp867x_check_ports()
326 (unsigned long long)ATP867X_IO_PORTBASE(ap, port), in atp867x_check_ports()
328 (unsigned long long)ATP867X_IO_ALTSTATUS(ap, port), in atp867x_check_ports()
330 (unsigned long long)ATP867X_IO_DMABASE(ap, port), in atp867x_check_ports()
349 static int atp867x_set_priv(struct ata_port *ap) in atp867x_set_priv() argument
351 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_priv()
353 int port = ap->port_no; in atp867x_set_priv()
355 dp = ap->private_data = in atp867x_set_priv()
360 dp->dma_mode = ATP867X_IO_DMAMODE(ap, port); in atp867x_set_priv()
361 dp->mstr_piospd = ATP867X_IO_MSTRPIOSPD(ap, port); in atp867x_set_priv()
362 dp->slave_piospd = ATP867X_IO_SLAVPIOSPD(ap, port); in atp867x_set_priv()
363 dp->eightb_piospd = ATP867X_IO_8BPIOSPD(ap, port); in atp867x_set_priv()
366 ioread8(ATP867X_SYS_INFO(ap)) & ATP867X_IO_SYS_INFO_66MHZ; in atp867x_set_priv()
374 struct ata_port *ap = host->ports[0]; in atp867x_fixup() local
394 iowrite16(ATP867X_IO_PORTSPD_VAL, ATP867X_IO_PORTSPD(ap, i)); in atp867x_fixup()
400 iowrite16(ATP867X_PREREAD_VAL, ATP867X_IO_PREREAD(ap, i)); in atp867x_fixup()
402 v = ioread8(ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
405 iowrite8(v, ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
410 v = ioread8(ATP867X_SYS_INFO(ap)); in atp867x_fixup()
414 iowrite8(v, ATP867X_SYS_INFO(ap)); in atp867x_fixup()
446 struct ata_port *ap = host->ports[i]; in atp867x_ata_pci_sff_init_host() local
447 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_ata_pci_sff_init_host()
449 ioaddr->cmd_addr = ATP867X_IO_PORTBASE(ap, i); in atp867x_ata_pci_sff_init_host()
451 = ATP867X_IO_ALTSTATUS(ap, i); in atp867x_ata_pci_sff_init_host()
452 ioaddr->bmdma_addr = ATP867X_IO_DMABASE(ap, i); in atp867x_ata_pci_sff_init_host()
455 rc = atp867x_set_priv(ap); in atp867x_ata_pci_sff_init_host()
460 atp867x_check_ports(ap, i); in atp867x_ata_pci_sff_init_host()
462 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", in atp867x_ata_pci_sff_init_host()
465 ata_port_desc(ap, "bmdma 0x%lx", in atp867x_ata_pci_sff_init_host()