Lines Matching +full:x +full:- +full:z
1 // SPDX-License-Identifier: GPL-2.0
4 * Buddha, Catweasel and X-Surf PATA controller driver
68 struct ata_device *dev = qc->dev; in pata_buddha_data_xfer()
69 struct ata_port *ap = dev->link->ap; in pata_buddha_data_xfer()
70 void __iomem *data_addr = ap->ioaddr.data_addr; in pata_buddha_data_xfer()
84 buf += buflen - 1; in pata_buddha_data_xfer()
110 dev->pio_mode = dev->xfer_mode = XFER_PIO_0; in pata_buddha_set_mode()
111 dev->xfer_shift = ATA_SHIFT_PIO; in pata_buddha_set_mode()
112 dev->flags |= ATA_DFLAG_PIO; in pata_buddha_set_mode()
122 ch = z_readb((unsigned long)ap->private_data); in pata_buddha_irq_check()
129 z_writeb(0, (unsigned long)ap->private_data); in pata_xsurf_irq_clear()
149 static int pata_buddha_probe(struct zorro_dev *z, in pata_buddha_probe() argument
153 "Buddha", "Catweasel", "X-Surf" in pata_buddha_probe()
158 unsigned int type = ent->driver_data; in pata_buddha_probe()
163 dev_info(&z->dev, "%s IDE controller\n", board_name[type]); in pata_buddha_probe()
165 board = z->resource.start; in pata_buddha_probe()
168 if (!devm_request_mem_region(&z->dev, in pata_buddha_probe()
171 return -ENXIO; in pata_buddha_probe()
173 if (!devm_request_mem_region(&z->dev, in pata_buddha_probe()
176 return -ENXIO; in pata_buddha_probe()
177 if (!devm_request_mem_region(&z->dev, in pata_buddha_probe()
183 /* Workaround for X-Surf: Save drvdata in case zorro8390 has set it */ in pata_buddha_probe()
185 old_drvdata = dev_get_drvdata(&z->dev); in pata_buddha_probe()
188 host = ata_host_alloc(&z->dev, nr_ports); in pata_buddha_probe()
190 dev_set_drvdata(&z->dev, old_drvdata); in pata_buddha_probe()
192 return -ENXIO; in pata_buddha_probe()
201 struct ata_port *ap = host->ports[i]; in pata_buddha_probe()
206 ap->ops = &pata_buddha_ops; in pata_buddha_probe()
211 ap->ops = &pata_xsurf_ops; in pata_buddha_probe()
213 /* X-Surf has no CS1* (Control/AltStat) */ in pata_buddha_probe()
217 ap->pio_mask = ATA_PIO4; in pata_buddha_probe()
218 ap->flags |= ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY; in pata_buddha_probe()
220 ap->ioaddr.data_addr = base; in pata_buddha_probe()
221 ap->ioaddr.error_addr = base + 2 + 1 * 4; in pata_buddha_probe()
222 ap->ioaddr.feature_addr = base + 2 + 1 * 4; in pata_buddha_probe()
223 ap->ioaddr.nsect_addr = base + 2 + 2 * 4; in pata_buddha_probe()
224 ap->ioaddr.lbal_addr = base + 2 + 3 * 4; in pata_buddha_probe()
225 ap->ioaddr.lbam_addr = base + 2 + 4 * 4; in pata_buddha_probe()
226 ap->ioaddr.lbah_addr = base + 2 + 5 * 4; in pata_buddha_probe()
227 ap->ioaddr.device_addr = base + 2 + 6 * 4; in pata_buddha_probe()
228 ap->ioaddr.status_addr = base + 2 + 7 * 4; in pata_buddha_probe()
229 ap->ioaddr.command_addr = base + 2 + 7 * 4; in pata_buddha_probe()
232 ap->ioaddr.altstatus_addr = base + ctl; in pata_buddha_probe()
233 ap->ioaddr.ctl_addr = base + ctl; in pata_buddha_probe()
236 ap->private_data = (void *)irqport; in pata_buddha_probe()
238 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", board, in pata_buddha_probe()
248 static void pata_buddha_remove(struct zorro_dev *z) in pata_buddha_remove() argument
250 struct ata_host *host = dev_get_drvdata(&z->dev); in pata_buddha_remove()
270 * We cannot have a modalias for X-Surf boards, as it competes with the
277 struct zorro_dev *z = NULL; in pata_buddha_late_init() local
279 /* Auto-bind to regular boards */ in pata_buddha_late_init()
282 /* Manually bind to all X-Surf boards */ in pata_buddha_late_init()
283 while ((z = zorro_find_device(ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, z))) { in pata_buddha_late_init()
288 pata_buddha_probe(z, &xsurf_ent); in pata_buddha_late_init()
296 MODULE_DESCRIPTION("low-level driver for Buddha/Catweasel/X-Surf PATA");