Lines Matching refs:ap

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