Lines Matching full:mesh
3 * SCSI low-level driver for the MESH (Macintosh Enhanced SCSI Hardware)
5 * We assume the MESH is connected to a DBDMA (descriptor-based DMA)
50 #include "mesh.h"
58 MODULE_DESCRIPTION("PowerMac MESH SCSI driver");
145 volatile struct mesh_regs __iomem *mesh; member
223 tlp->bs0 = ms->mesh->bus_status0; in dlog()
224 tlp->bs1 = ms->mesh->bus_status1; in dlog()
252 printk(KERN_DEBUG "mesh log %d: bs=%.2x%.2x ph=%.2x ", in dumplog()
277 printk(KERN_DEBUG "mesh log: bs=%.2x%.2x ph=%.2x t%d ", in dumpslog()
305 volatile struct mesh_regs __iomem *mr = ms->mesh; in mesh_dump_regs()
310 printk(KERN_DEBUG "mesh: state at %p, regs at %p, dma at %p\n", in mesh_dump_regs()
337 * Flush write buffers on the bus path to the mesh
360 volatile struct mesh_regs __iomem *mr = ms->mesh; in mesh_init()
379 printk(KERN_INFO "mesh: performing initial bus reset...\n"); in mesh_init()
407 volatile struct mesh_regs __iomem *mr = ms->mesh; in mesh_start_cmd()
426 panic("mesh: double DMA start !\n"); in mesh_start_cmd()
483 * Apparently the mesh has a bug where it will assert both its in mesh_start_cmd()
497 * is trying to reselect us, reset the mesh and then enable in mesh_start_cmd()
524 /* looks like a reselection - try resetting the mesh */ in mesh_start_cmd()
541 printk(KERN_ERR "mesh: controller not responding" in mesh_start_cmd()
545 * mesh isn't responding, the higher levels of in mesh_start_cmd()
555 * Start the next command for a MESH.
619 out_8(&ms->mesh->sequence, SEQ_ENBRESEL); in mesh_done()
620 mesh_flush_io(ms->mesh); in mesh_done()
642 volatile struct mesh_regs __iomem *mr = ms->mesh; in set_sdtr()
649 printk(KERN_INFO "mesh: target %d now asynchronous\n", in set_sdtr()
676 printk(KERN_INFO "mesh: target %d synchronous at %d.%d MB/s\n", in set_sdtr()
683 volatile struct mesh_regs __iomem *mr = ms->mesh; in start_phase()
710 printk(KERN_ERR "mesh: msg_out but n_msgout=%d\n", in start_phase()
717 printk(KERN_DEBUG "mesh: sending %d msg bytes:", in start_phase()
731 * issue a SEQ_MSGOUT to get the mesh to drop ACK. in start_phase()
760 printk(KERN_ERR "mesh bug: start_phase msgphase=%d\n", in start_phase()
818 printk(KERN_ERR "mesh: start_phase called with phase=%d\n", in start_phase()
827 volatile struct mesh_regs __iomem *mr = ms->mesh; in get_msgin()
859 volatile struct mesh_regs __iomem *mr = ms->mesh; in reselected()
885 printk(KERN_ERR "mesh: reselected in phase %d/%d tgt %d\n", in reselected()
892 printk(KERN_ERR "mesh: reselected with DMA started !\n"); in reselected()
929 printk(KERN_ERR "mesh: reselection but nothing in fifo?\n"); in reselected()
942 printk(KERN_ERR "mesh: bad reselection data %x\n", b); in reselected()
955 printk(KERN_DEBUG "mesh: reselected by target %d\n", t); in reselected()
956 printk(KERN_DEBUG "mesh: saved_ptr=%x goes_out=%d cmd=%p\n", in reselected()
961 printk(KERN_ERR "mesh: reselected by tgt %d but no cmd!\n", t); in reselected()
992 volatile struct mesh_regs __iomem *mr = ms->mesh; in handle_reset()
1035 volatile struct mesh_regs __iomem *mr = ms->mesh; in handle_error()
1044 printk(KERN_INFO "mesh: SCSI bus reset detected: " in handle_error()
1062 printk(KERN_WARNING "mesh: target %d aborted\n", in handle_error()
1074 printk(KERN_ERR "mesh: msg parity error, target %d\n", in handle_error()
1083 printk(KERN_ERR "mesh: parity error, target %d\n", in handle_error()
1111 printk(KERN_ERR "mesh: sequence error (err=%x exc=%x)\n", in handle_error()
1114 printk(KERN_ERR "mesh: unknown error %x (exc=%x)\n", err, exc); in handle_error()
1131 volatile struct mesh_regs __iomem *mr = ms->mesh; in handle_exception()
1140 printk(KERN_DEBUG "mesh: lost arbitration\n"); in handle_exception()
1152 printk(KERN_ERR "mesh: can't cope with exception %x\n", exc); in handle_exception()
1236 printk(KERN_WARNING "mesh: lun mismatch " in handle_msgin()
1248 printk(KERN_WARNING "mesh: rejecting message from target %d:", in handle_msgin()
1293 panic("mesh: scatterlist element >= 64k"); in set_dma_cmds()
1325 volatile struct mesh_regs __iomem *mr = ms->mesh; in halt_dma()
1349 printk(KERN_ERR "mesh: halt_dma: data_ptr=%d (nb=%d, ms=%p)\n", in halt_dma()
1358 printk(KERN_DEBUG "mesh: target %d overrun, " in halt_dma()
1370 volatile struct mesh_regs __iomem *mr = ms->mesh; in phase_mismatch()
1429 "mesh: no msg to repeat\n"); in phase_mismatch()
1438 printk(KERN_DEBUG "mesh: unknown scsi phase %x\n", phase); in phase_mismatch()
1449 volatile struct mesh_regs __iomem *mr = ms->mesh; in cmd_complete()
1488 * to get the MESH to drop ACK, wait until REQ gets in cmd_complete()
1510 printk(KERN_ERR "mesh: error %x in msg_out\n", in cmd_complete()
1516 printk(KERN_ERR "mesh: exc %x in msg_out\n", in cmd_complete()
1519 printk(KERN_DEBUG "mesh: bs0=%x in msg_out\n", in cmd_complete()
1546 printk(KERN_ERR "mesh: interrupt in idle phase?\n"); in cmd_complete()
1593 * occasionally the mesh actually executes the in cmd_complete()
1606 printk(KERN_DEBUG "mesh: status is %x\n", in cmd_complete()
1663 volatile struct mesh_regs __iomem *mr = ms->mesh; in DEF_SCSI_QCMD()
1711 volatile struct mesh_regs __iomem *mr = ms->mesh; in mesh_host_reset()
1825 printk(KERN_INFO "resetting MESH scsi bus(es)\n"); in mesh_shutdown()
1827 mr = ms->mesh; in mesh_shutdown()
1840 .proc_name = "mesh",
1841 .name = "MESH",
1854 struct device_node *mesh = macio_get_of_node(mdev); in mesh_probe() local
1874 printk(KERN_ERR "mesh: expected 2 addrs and 2 intrs" in mesh_probe()
1880 if (macio_request_resources(mdev, "mesh") != 0) { in mesh_probe()
1881 printk(KERN_ERR "mesh: unable to request memory resources"); in mesh_probe()
1886 printk(KERN_ERR "mesh: couldn't register host"); in mesh_probe()
1892 note_scsi_host(mesh, mesh_host); in mesh_probe()
1903 ms->mesh = ioremap(macio_resource_start(mdev, 0), 0x1000); in mesh_probe()
1904 if (ms->mesh == NULL) { in mesh_probe()
1905 printk(KERN_ERR "mesh: can't map registers\n"); in mesh_probe()
1910 printk(KERN_ERR "mesh: can't map registers\n"); in mesh_probe()
1911 iounmap(ms->mesh); in mesh_probe()
1930 printk(KERN_ERR "mesh: can't allocate DMA table\n"); in mesh_probe()
1945 if ((cfp = of_get_property(mesh, "clock-frequency", NULL))) in mesh_probe()
1948 printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n"); in mesh_probe()
1966 if (request_irq(ms->meshintr, do_mesh_interrupt, 0, "MESH", ms)) { in mesh_probe()
1967 printk(KERN_ERR "MESH: can't get irq %d\n", ms->meshintr); in mesh_probe()
1990 iounmap(ms->mesh); in mesh_probe()
2015 iounmap(ms->mesh); in mesh_remove()
2034 .name = "mesh",
2047 .name = "mesh",
2068 printk(KERN_INFO "mesh: configured for synchronous %d MB/s\n", sync_rate); in init_mesh()
2072 printk(KERN_INFO "mesh: configured for asynchronous\n"); in init_mesh()