aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2016-03-22 17:26:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-22 18:36:02 -0400
commit93bdaca5018c02ba838f8fe2178fab261e2c1e68 (patch)
treecfeb3fc61a6ed51e3702bcaaf7dd35b5105fa6ae /drivers/rapidio
parent2ece1caf668f183d0606ea9fc85a1083d42b5b3a (diff)
rapidio: add outbound window support
Add RapidIO controller (mport) outbound window configuration operations. This patch is a part of the original patch submitted by Li Yang: https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-April/071210.html For some reason the original part was not applied to mainline code tree. The inbound window mapping part has been applied later during tsi721 mport driver submission. Now goes the second part with corresponding HW support. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio')
-rw-r--r--drivers/rapidio/rio.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 17973d3caa88..0dcaa660cba1 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -700,6 +700,56 @@ void rio_unmap_inb_region(struct rio_mport *mport, dma_addr_t lstart)
700EXPORT_SYMBOL_GPL(rio_unmap_inb_region); 700EXPORT_SYMBOL_GPL(rio_unmap_inb_region);
701 701
702/** 702/**
703 * rio_map_outb_region -- Map outbound memory region.
704 * @mport: Master port.
705 * @destid: destination id window points to
706 * @rbase: RIO base address window translates to
707 * @size: Size of the memory region
708 * @rflags: Flags for mapping.
709 * @local: physical address of memory region mapped
710 *
711 * Return: 0 -- Success.
712 *
713 * This function will create the mapping from RIO space to local memory.
714 */
715int rio_map_outb_region(struct rio_mport *mport, u16 destid, u64 rbase,
716 u32 size, u32 rflags, dma_addr_t *local)
717{
718 int rc = 0;
719 unsigned long flags;
720
721 if (!mport->ops->map_outb)
722 return -ENODEV;
723
724 spin_lock_irqsave(&rio_mmap_lock, flags);
725 rc = mport->ops->map_outb(mport, destid, rbase, size,
726 rflags, local);
727 spin_unlock_irqrestore(&rio_mmap_lock, flags);
728
729 return rc;
730}
731EXPORT_SYMBOL_GPL(rio_map_outb_region);
732
733/**
734 * rio_unmap_inb_region -- Unmap the inbound memory region
735 * @mport: Master port
736 * @destid: destination id mapping points to
737 * @rstart: RIO base address window translates to
738 */
739void rio_unmap_outb_region(struct rio_mport *mport, u16 destid, u64 rstart)
740{
741 unsigned long flags;
742
743 if (!mport->ops->unmap_outb)
744 return;
745
746 spin_lock_irqsave(&rio_mmap_lock, flags);
747 mport->ops->unmap_outb(mport, destid, rstart);
748 spin_unlock_irqrestore(&rio_mmap_lock, flags);
749}
750EXPORT_SYMBOL_GPL(rio_unmap_outb_region);
751
752/**
703 * rio_mport_get_physefb - Helper function that returns register offset 753 * rio_mport_get_physefb - Helper function that returns register offset
704 * for Physical Layer Extended Features Block. 754 * for Physical Layer Extended Features Block.
705 * @port: Master port to issue transaction 755 * @port: Master port to issue transaction