Lines Matching refs:rmu
209 struct fsl_rmu *rmu = GET_RMM_HANDLE(port); in fsl_rio_tx_handler() local
211 osr = in_be32(&rmu->msg_regs->osr); in fsl_rio_tx_handler()
215 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_TE); in fsl_rio_tx_handler()
221 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_QOI); in fsl_rio_tx_handler()
226 u32 dqp = in_be32(&rmu->msg_regs->odqdpar); in fsl_rio_tx_handler()
227 int slot = (dqp - rmu->msg_tx_ring.phys) >> 5; in fsl_rio_tx_handler()
229 port->outb_msg[0].mcback(port, rmu->msg_tx_ring.dev_id, in fsl_rio_tx_handler()
234 out_be32(&rmu->msg_regs->osr, RIO_MSG_OSR_EOMI); in fsl_rio_tx_handler()
254 struct fsl_rmu *rmu = GET_RMM_HANDLE(port); in fsl_rio_rx_handler() local
256 isr = in_be32(&rmu->msg_regs->isr); in fsl_rio_rx_handler()
260 out_be32((void *)&rmu->msg_regs->isr, RIO_MSG_ISR_TE); in fsl_rio_rx_handler()
272 port->inb_msg[0].mcback(port, rmu->msg_rx_ring.dev_id, in fsl_rio_rx_handler()
277 out_be32(&rmu->msg_regs->isr, RIO_MSG_ISR_DIQI); in fsl_rio_rx_handler()
663 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_add_outb_message() local
665 struct rio_tx_desc *desc = (struct rio_tx_desc *)rmu->msg_tx_ring.virt in fsl_add_outb_message()
666 + rmu->msg_tx_ring.tx_slot; in fsl_add_outb_message()
677 memcpy(rmu->msg_tx_ring.virt_buffer[rmu->msg_tx_ring.tx_slot], buffer, in fsl_add_outb_message()
680 memset(rmu->msg_tx_ring.virt_buffer[rmu->msg_tx_ring.tx_slot] in fsl_add_outb_message()
694 | rmu->msg_tx_ring.phys_buffer[rmu->msg_tx_ring.tx_slot]; in fsl_add_outb_message()
697 omr = in_be32(&rmu->msg_regs->omr); in fsl_add_outb_message()
698 out_be32(&rmu->msg_regs->omr, omr | RIO_MSG_OMR_MUI); in fsl_add_outb_message()
701 if (++rmu->msg_tx_ring.tx_slot == rmu->msg_tx_ring.size) in fsl_add_outb_message()
702 rmu->msg_tx_ring.tx_slot = 0; in fsl_add_outb_message()
724 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_open_outb_mbox() local
733 rmu->msg_tx_ring.dev_id = dev_id; in fsl_open_outb_mbox()
734 rmu->msg_tx_ring.size = entries; in fsl_open_outb_mbox()
736 for (i = 0; i < rmu->msg_tx_ring.size; i++) { in fsl_open_outb_mbox()
737 rmu->msg_tx_ring.virt_buffer[i] = in fsl_open_outb_mbox()
739 &rmu->msg_tx_ring.phys_buffer[i], GFP_KERNEL); in fsl_open_outb_mbox()
740 if (!rmu->msg_tx_ring.virt_buffer[i]) { in fsl_open_outb_mbox()
742 for (j = 0; j < rmu->msg_tx_ring.size; j++) in fsl_open_outb_mbox()
743 if (rmu->msg_tx_ring.virt_buffer[j]) in fsl_open_outb_mbox()
746 rmu->msg_tx_ring. in fsl_open_outb_mbox()
748 rmu->msg_tx_ring. in fsl_open_outb_mbox()
755 rmu->msg_tx_ring.virt = dma_alloc_coherent(priv->dev, in fsl_open_outb_mbox()
756 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, in fsl_open_outb_mbox()
757 &rmu->msg_tx_ring.phys, in fsl_open_outb_mbox()
759 if (!rmu->msg_tx_ring.virt) { in fsl_open_outb_mbox()
763 rmu->msg_tx_ring.tx_slot = 0; in fsl_open_outb_mbox()
766 out_be32(&rmu->msg_regs->odqdpar, rmu->msg_tx_ring.phys); in fsl_open_outb_mbox()
767 out_be32(&rmu->msg_regs->odqepar, rmu->msg_tx_ring.phys); in fsl_open_outb_mbox()
770 out_be32(&rmu->msg_regs->osar, 0x00000004); in fsl_open_outb_mbox()
773 out_be32(&rmu->msg_regs->osr, 0x000000b3); in fsl_open_outb_mbox()
788 out_be32(&rmu->msg_regs->omr, 0x00100220); in fsl_open_outb_mbox()
791 out_be32(&rmu->msg_regs->omr, in fsl_open_outb_mbox()
792 in_be32(&rmu->msg_regs->omr) | in fsl_open_outb_mbox()
796 out_be32(&rmu->msg_regs->omr, in_be32(&rmu->msg_regs->omr) | 0x1); in fsl_open_outb_mbox()
803 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, in fsl_open_outb_mbox()
804 rmu->msg_tx_ring.virt, rmu->msg_tx_ring.phys); in fsl_open_outb_mbox()
807 for (i = 0; i < rmu->msg_tx_ring.size; i++) in fsl_open_outb_mbox()
809 rmu->msg_tx_ring.virt_buffer[i], in fsl_open_outb_mbox()
810 rmu->msg_tx_ring.phys_buffer[i]); in fsl_open_outb_mbox()
826 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_close_outb_mbox() local
829 out_be32(&rmu->msg_regs->omr, 0); in fsl_close_outb_mbox()
833 rmu->msg_tx_ring.size * RIO_MSG_DESC_SIZE, in fsl_close_outb_mbox()
834 rmu->msg_tx_ring.virt, rmu->msg_tx_ring.phys); in fsl_close_outb_mbox()
856 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_open_inb_mbox() local
865 rmu->msg_rx_ring.dev_id = dev_id; in fsl_open_inb_mbox()
866 rmu->msg_rx_ring.size = entries; in fsl_open_inb_mbox()
867 rmu->msg_rx_ring.rx_slot = 0; in fsl_open_inb_mbox()
868 for (i = 0; i < rmu->msg_rx_ring.size; i++) in fsl_open_inb_mbox()
869 rmu->msg_rx_ring.virt_buffer[i] = NULL; in fsl_open_inb_mbox()
872 rmu->msg_rx_ring.virt = dma_alloc_coherent(priv->dev, in fsl_open_inb_mbox()
873 rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, in fsl_open_inb_mbox()
874 &rmu->msg_rx_ring.phys, GFP_KERNEL); in fsl_open_inb_mbox()
875 if (!rmu->msg_rx_ring.virt) { in fsl_open_inb_mbox()
881 out_be32(&rmu->msg_regs->ifqdpar, (u32) rmu->msg_rx_ring.phys); in fsl_open_inb_mbox()
882 out_be32(&rmu->msg_regs->ifqepar, (u32) rmu->msg_rx_ring.phys); in fsl_open_inb_mbox()
885 out_be32(&rmu->msg_regs->isr, 0x00000091); in fsl_open_inb_mbox()
892 rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, in fsl_open_inb_mbox()
893 rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys); in fsl_open_inb_mbox()
904 out_be32(&rmu->msg_regs->imr, 0x001b0060); in fsl_open_inb_mbox()
907 setbits32(&rmu->msg_regs->imr, (get_bitmask_order(entries) - 2) << 12); in fsl_open_inb_mbox()
910 setbits32(&rmu->msg_regs->imr, 0x1); in fsl_open_inb_mbox()
927 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_close_inb_mbox() local
930 out_be32(&rmu->msg_regs->imr, 0); in fsl_close_inb_mbox()
933 dma_free_coherent(priv->dev, rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, in fsl_close_inb_mbox()
934 rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys); in fsl_close_inb_mbox()
952 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_add_inb_buffer() local
955 rmu->msg_rx_ring.rx_slot); in fsl_add_inb_buffer()
957 if (rmu->msg_rx_ring.virt_buffer[rmu->msg_rx_ring.rx_slot]) { in fsl_add_inb_buffer()
960 rmu->msg_rx_ring.rx_slot); in fsl_add_inb_buffer()
965 rmu->msg_rx_ring.virt_buffer[rmu->msg_rx_ring.rx_slot] = buf; in fsl_add_inb_buffer()
966 if (++rmu->msg_rx_ring.rx_slot == rmu->msg_rx_ring.size) in fsl_add_inb_buffer()
967 rmu->msg_rx_ring.rx_slot = 0; in fsl_add_inb_buffer()
983 struct fsl_rmu *rmu = GET_RMM_HANDLE(mport); in fsl_get_inb_message() local
989 phys_buf = in_be32(&rmu->msg_regs->ifqdpar); in fsl_get_inb_message()
992 if (phys_buf == in_be32(&rmu->msg_regs->ifqepar)) in fsl_get_inb_message()
995 virt_buf = rmu->msg_rx_ring.virt + (phys_buf in fsl_get_inb_message()
996 - rmu->msg_rx_ring.phys); in fsl_get_inb_message()
997 buf_idx = (phys_buf - rmu->msg_rx_ring.phys) / RIO_MAX_MSG_SIZE; in fsl_get_inb_message()
998 buf = rmu->msg_rx_ring.virt_buffer[buf_idx]; in fsl_get_inb_message()
1010 rmu->msg_rx_ring.virt_buffer[buf_idx] = NULL; in fsl_get_inb_message()
1013 setbits32(&rmu->msg_regs->imr, RIO_MSG_IMR_MI); in fsl_get_inb_message()
1068 struct fsl_rmu *rmu; in fsl_rio_setup_rmu() local
1085 rmu = kzalloc(sizeof(struct fsl_rmu), GFP_KERNEL); in fsl_rio_setup_rmu()
1086 if (!rmu) in fsl_rio_setup_rmu()
1094 kfree(rmu); in fsl_rio_setup_rmu()
1099 rmu->msg_regs = (struct rio_msg_regs *) in fsl_rio_setup_rmu()
1102 rmu->txirq = irq_of_parse_and_map(node, 0); in fsl_rio_setup_rmu()
1103 rmu->rxirq = irq_of_parse_and_map(node, 1); in fsl_rio_setup_rmu()
1105 node, rmu->txirq, rmu->rxirq); in fsl_rio_setup_rmu()
1107 priv->rmm_handle = rmu; in fsl_rio_setup_rmu()