Lines Matching +full:dp +full:- +full:controller
1 /* SPDX-License-Identifier: GPL-2.0 */
15 #include <linux/dma-mapping.h>
28 * 2) NCR 82077 controller manual
29 * 3) Intel 82077 controller manual
44 /* You'll only ever find one controller on an Ultra anyways. */
45 static struct sun_flpy_controller *sun_fdc = (struct sun_flpy_controller *)-1;
109 return sbus_readb(&sun_fdc->status_82077) & ~STATUS_DMA; in sun_82077_fd_inb()
111 return sbus_readb(&sun_fdc->data_82077); in sun_82077_fd_inb()
114 return sbus_readb(&sun_fdc->dir_82077); in sun_82077_fd_inb()
129 sbus_writeb(value, &sun_fdc->dor_82077); in sun_82077_fd_outb()
132 sbus_writeb(value, &sun_fdc->data_82077); in sun_82077_fd_outb()
135 sbus_writeb(value, &sun_fdc->dcr_82077); in sun_82077_fd_outb()
138 sbus_writeb(value, &sun_fdc->status_82077); in sun_82077_fd_outb()
144 /* For pseudo-dma (Sun floppy drives have no real DMA available to
146 * three state variables. doing_pdma tells our inline low-level
149 * floppy interrupt c-code. I tried very hard but I could not get the
150 * pseudo-dma to work in c-code without getting many overruns and
151 * underruns. If non-zero, doing_pdma encodes the direction of
162 /* Common routines to all controller types on the Sparc. */
230 size--; in sparc_floppy_irq()
236 /* Send Terminal Count pulse to floppy controller. */ in sparc_floppy_irq()
261 return ((error == 0) ? 0 : -1); in sun_fd_request_irq()
290 static int sun_pci_broken_drive = -1;
298 static struct sun_pci_dma_op sun_pci_dma_current = { -1U, 0, 0, NULL};
299 static struct sun_pci_dma_op sun_pci_dma_pending = { -1U, 0, 0, NULL};
370 sun_pci_dma_pending.addr = -1U; in sun_pci_fd_enable_dma()
389 if (sun_pci_dma_current.addr != -1U) in sun_pci_fd_disable_dma()
394 sun_pci_dma_current.addr = -1U; in sun_pci_fd_disable_dma()
434 return -EINVAL; in sun_pci_fd_eject()
458 while (!((status = inb(MSR)) & 0x80) && --timeout) in sun_pci_fd_out_byte()
473 while (!((status = inb(MSR)) & 0x80) && --timeout) in sun_pci_fd_sensei()
501 } while ((mask != 0x0f) && --timeout); in sun_pci_fd_reset()
521 } while (((status & 0xc0) == 0x80) && --timeout); in sun_pci_fd_test_drive()
535 static int __init ebus_fdthree_p(struct device_node *dp) in ebus_fdthree_p() argument
537 if (of_node_name_eq(dp, "fdthree")) in ebus_fdthree_p()
539 if (of_node_name_eq(dp, "floppy")) { in ebus_fdthree_p()
542 compat = of_get_property(dp, "compatible", NULL); in ebus_fdthree_p()
552 struct device_node *dp; in sun_floppy_init() local
563 for_each_node_by_name(dp, "SUNW,fdtwo") { in sun_floppy_init()
564 if (!of_node_name_eq(dp->parent, "sbus")) in sun_floppy_init()
566 op = of_find_device_by_node(dp); in sun_floppy_init()
572 FLOPPY_IRQ = op->archdata.irqs[0]; in sun_floppy_init()
579 dp = NULL; in sun_floppy_init()
581 for (dp = ebus_dp->child; dp; dp = dp->sibling) { in sun_floppy_init()
582 if (ebus_fdthree_p(dp)) in sun_floppy_init()
587 if (!dp) in sun_floppy_init()
590 op = of_find_device_by_node(dp); in sun_floppy_init()
594 state_prop = of_get_property(op->dev.of_node, "status", NULL); in sun_floppy_init()
598 FLOPPY_IRQ = op->archdata.irqs[0]; in sun_floppy_init()
603 auxio_reg = (void __iomem *) op->resource[2].start; in sun_floppy_init()
606 sun_floppy_dev = &op->dev; in sun_floppy_init()
612 op->resource[1].start; in sun_floppy_init()
626 sun_fdc = (struct sun_flpy_controller *) op->resource[0].start; in sun_floppy_init()
644 fdc_status = (unsigned long) &sun_fdc->status_82077; in sun_floppy_init()
664 for (dp = ebus_dp->child; dp; dp = dp->sibling) { in sun_floppy_init()
665 if (of_node_name_eq(dp, "ecpp")) { in sun_floppy_init()
668 ecpp_op = of_find_device_by_node(dp); in sun_floppy_init()
670 config = ecpp_op->resource[1].start; in sun_floppy_init()
692 /* Enable PC-AT mode. */ in sun_floppy_init()
710 if (sun_pci_broken_drive != -1) { in sun_floppy_init()
711 sun_pci_broken_drive = 1 - sun_pci_broken_drive; in sun_floppy_init()
719 prop = of_get_property(op->dev.of_node, "status", NULL); in sun_floppy_init()
730 (op->resource[0].start + in sun_floppy_init()
731 ((op->resource[0].flags & 0x1ffUL) << 32UL)); in sun_floppy_init()
734 if (sbus_readb(&sun_fdc->status1_82077) == 0xff) { in sun_floppy_init()
735 sun_fdc = (struct sun_flpy_controller *)-1; in sun_floppy_init()
755 fdc_status = (unsigned long) &sun_fdc->status_82077; in sun_floppy_init()