How to specify IOMMU'able devices in DT (was: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely)

2012-09-24 Thread Hiroshi Doyu
On Fri, 21 Sep 2012 20:16:00 +0200 Krishna Reddy vdu...@nvidia.com wrote: The device(H/W controller) need to access few special memory blocks(IOVA==PA) and DRAM as well. OK, so only /some/ of the VA space is VA==PA, and some is remapped; that's a little different that what you

Re: How to specify IOMMU'able devices in DT (was: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely)

2012-09-24 Thread Hiroshi Doyu
Hi James, On Mon, 24 Sep 2012 11:28:01 +0200 James Bottomley james.bottom...@hansenpartnership.com wrote: On Mon, 2012-09-24 at 12:04 +0300, Hiroshi Doyu wrote: diff --git a/drivers/base/platform.c b/drivers/base/platform.c index a1a7225..9eae3be 100644 --- a/drivers/base/platform.c +++

RE: How to specify IOMMU'able devices in DT (was: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely)

2012-09-24 Thread Marek Szyprowski
Hello, On Monday, September 24, 2012 11:45 AM Hiroshi Doyu wrote: On Mon, 24 Sep 2012 11:28:01 +0200 James Bottomley james.bottom...@hansenpartnership.com wrote: On Mon, 2012-09-24 at 12:04 +0300, Hiroshi Doyu wrote: diff --git a/drivers/base/platform.c b/drivers/base/platform.c

Re: How to specify IOMMU'able devices in DT (was: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely)

2012-09-24 Thread James Bottomley
On Mon, 2012-09-24 at 12:04 +0300, Hiroshi Doyu wrote: diff --git a/drivers/base/platform.c b/drivers/base/platform.c index a1a7225..9eae3be 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -21,6 +21,8 @@ #include linux/slab.h #include linux/pm_runtime.h +#include

RE: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-21 Thread Krishna Reddy
The device(H/W controller) need to access few special memory blocks(IOVA==PA) and DRAM as well. OK, so only /some/ of the VA space is VA==PA, and some is remapped; that's a little different that what you originally implied above. BTW, which HW module is this; AVP/COP or something else.

RE: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-20 Thread Krishna Reddy
On Tegra, the following use cases need specific IOVA mapping. 1. Few MMIO blocks need IOVA=PA mapping setup. In that case, why would we enable the IOMMU for that one device; IOMMU disabled means VA==PA, right? Perhaps isolation of the device so it can only access certain PA ranges for

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-20 Thread Stephen Warren
On 09/20/2012 12:40 AM, Krishna Reddy wrote: On Tegra, the following use cases need specific IOVA mapping. 1. Few MMIO blocks need IOVA=PA mapping setup. In that case, why would we enable the IOMMU for that one device; IOMMU disabled means VA==PA, right? Perhaps isolation of the device so it

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Hiroshi Doyu
Hi Joerg, On Tue, 18 Sep 2012 14:49:18 +0200 Joerg Roedel joerg.roe...@amd.com wrote: On Wed, Aug 29, 2012 at 09:55:30AM +0300, Hiroshi Doyu wrote: The following APIs are needed for us to support the legacy Tegra memory manager for devices(NvMap) with *DMA mapping API*. Maybe I am not

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Arnd Bergmann
On Wednesday 19 September 2012, Hiroshi Doyu wrote: I guess that it would work. Originally I thought that using DMA-API and IOMMU-API together in driver might be kind of layering violation since IOMMU-API itself is used in DMA-API. Only DMA-API used in driver might be cleaner. Considering that

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Hiroshi Doyu
Hi Arnd, On Wed, 19 Sep 2012 09:59:45 +0200 Arnd Bergmann a...@arndb.de wrote: On Wednesday 19 September 2012, Hiroshi Doyu wrote: I guess that it would work. Originally I thought that using DMA-API and IOMMU-API together in driver might be kind of layering violation since IOMMU-API

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Joerg Roedel
On Wed, Sep 19, 2012 at 07:59:45AM +, Arnd Bergmann wrote: On Wednesday 19 September 2012, Hiroshi Doyu wrote: I guess that it would work. Originally I thought that using DMA-API and IOMMU-API together in driver might be kind of layering violation since IOMMU-API itself is used in

RE: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Krishna Reddy
...@vger.kernel.org; subas...@gmail.com; linaro-mm-...@lists.linaro.org; linux...@kvack.org; iommu@lists.linux-foundation.org; Krishna Reddy; linux- te...@vger.kernel.org; kyungmin.p...@samsung.com; pullip@samsung.com; linux-arm-ker...@lists.infradead.org Subject: Re: [RFC 0/5] ARM: dma-mapping: New

Re: [RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-09-19 Thread Stephen Warren
On 09/19/2012 07:44 PM, Krishna Reddy wrote: When a device driver would only use the IOMMU-API and needs small DMA- able areas it has to re-implement something like the DMA-API (basically an address allocator) for that. So I don't see a reason why both can't be used in a device driver. On

[RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-08-29 Thread Hiroshi Doyu
Hi, The following APIs are needed for us to support the legacy Tegra memory manager for devices(NvMap) with *DMA mapping API*. New API: -iova_alloc(): To allocate IOVA area. -iova_alloc_at(): To allocate IOVA area at specific address. -iova_free(): To free IOVA area. -map_page_at(): To