Re: [RFC PATCH 0/5] arm64: IOMMU-backed DMA mapping

2015-01-16 Thread Yong Wu
On Thu, 2015-01-15 at 18:35 +, Robin Murphy wrote: On 13/01/15 08:02, Yingjoe Chen wrote: On Mon, 2015-01-12 at 20:48 +, Robin Murphy wrote: Hi all, Whilst it's a long way off perfect, this has reached the point of being functional and stable enough to be useful, so here it is.

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-09 Thread Yong Wu
Dear Mitchel, Thanks very much for your review. On Fri, 2015-03-06 at 09:15 -0800, Mitchel Humpherys wrote: On Fri, Mar 06 2015 at 02:48:17 AM, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch adds support for mediatek m4u (MultiMedia Memory Management Unit

Re: [PATCH 4/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-03-09 Thread Yong Wu
Dear Mark, Thanks very much for your review. I will fix them in the next verion. On Fri, 2015-03-06 at 11:21 +, Mark Rutland wrote: On Fri, Mar 06, 2015 at 10:48:19AM +, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com This patch add mediatek iommu dts

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-03-12 Thread Yong Wu
Dear Tomasz, Thanks very much for review so detail! Please check my reply below. Others I will fix it in the next version. And I have got your comment of [2/5]. Do you have plan for the other patch? On Sun, 2015-03-08 at 13:12 +0900, Tomasz Figa wrote: Hi Yong Wu

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-04-14 Thread Yong Wu
Hi Robin, Thanks very much for your confirm. About the v3 of the DMA-mapping, I have some question below. On Fri, 2015-03-20 at 19:14 +, Robin Murphy wrote: On 18/03/15 11:22, Yong Wu wrote: Hi Tomasz, Thanks very much for your review. please help check below

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-04-14 Thread Yong Wu
Hi Tomasz, Thanks very much for you suggestion and explain so detail. please help check below. On Fri, 2015-03-27 at 18:41 +0900, Tomasz Figa wrote: Hi Yong Wu, Sorry for long delay, I had to figure out some time to look at this again. On Wed, Mar 18, 2015 at 8:22 PM, Yong Wu

Re: [PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-04-14 Thread Yong Wu
Hi Mark, Thanks very much for review. About the clock name should be the PoV of _this_ device. Could you help check below? On Fri, 2015-03-06 at 11:13 +, Mark Rutland wrote: On Fri, Mar 06, 2015 at 10:48:18AM +, yong...@mediatek.com wrote: From: Yong Wu yong...@mediatek.com

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-04-29 Thread Yong Wu
Dear Tomasz, About a hardcode your comment, please help check below. Dear Mark, I would like to add a item in the dtsi of mtk-iommu. Please also help have a look. +static const struct mtk_iommu_port mtk_iommu_mt8173_port[] = { + /* port namem4uid slaveid

[RFC PATCH] iommu: add ARM short descriptor page table allocator.

2015-04-28 Thread Yong Wu
This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K/64K/1M/16M. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 7 + drivers/iommu/Makefile | 1 + drivers/iommu/io-pgtable-arm-short.c | 489

Re: [RFC PATCH] iommu: add ARM short descriptor page table allocator.

2015-05-12 Thread Yong Wu
On Tue, 2015-05-12 at 11:15 +0200, Matthias Brugger wrote: 2015-04-28 9:41 GMT+02:00 Yong Wu yong...@mediatek.com: This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K/64K/1M/16M. Signed-off-by: Yong Wu yong...@mediatek.com [snip] +static

[PATCH v2 3/6] iommu: add ARM short descriptor page table allocator.

2015-05-15 Thread Yong Wu
This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K/64K/1M/16M. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 7 + drivers/iommu/Makefile | 1 + drivers/iommu/io-pgtable-arm-short.c | 490

[PATCH v2 2/6] dt-bindings: mediatek: Add smi dts binding

2015-05-15 Thread Yong Wu
This patch add smi binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../bindings/soc/mediatek/mediatek,smi-larb.txt| 24 ++ .../bindings/soc/mediatek/mediatek,smi.txt | 22 2 files changed, 46 insertions(+) create mode 100644

[PATCH v2 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-05-15 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu yong...@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 79 1 file changed, 79 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek

[PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-15 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the clocks of each local arbiter. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/soc/mediatek/Kconfig | 6 + drivers/soc/mediatek/Makefile | 1

[RFC v2 PATCH 0/6] MT8173 IOMMU SUPPORT

2015-05-15 Thread Yong Wu
and change the clock-names according to smi HW. -delete the hardcode of the port-names in mt8173. replace this with larb-portes-nr in dtsi. -fix some coding style issues. v1: http://lists.infradead.org/pipermail/linux-mediatek/2015-March/58.html Yong Wu (6): dt-bindings: iommu: Add binding

[PATCH v2 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-05-15 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 657 ++ 3 files changed, 669

Re: [PATCH v2 2/6] dt-bindings: mediatek: Add smi dts binding

2015-05-15 Thread Yong Wu
On Fri, 2015-05-15 at 17:43 +0800, Yong Wu wrote: This patch add smi binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../bindings/soc/mediatek/mediatek,smi-larb.txt| 24 ++ .../bindings/soc/mediatek/mediatek,smi.txt | 22

Re: [PATCH 2/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-04-15 Thread Yong Wu
On Wed, 2015-04-15 at 11:20 +0900, Tomasz Figa wrote: On Tue, Apr 14, 2015 at 3:31 PM, Yong Wu yong...@mediatek.com wrote: + + piommu-protect_va = devm_kmalloc(piommu-dev, MTK_PROTECT_PA_ALIGN*2, style: Operators like * should have space on both sides

Re: [PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-04-14 Thread Yong Wu
On Tue, 2015-04-14 at 21:49 +0800, Yong Wu wrote: Hi Mark, On Tue, 2015-04-14 at 11:06 +0100, Mark Rutland wrote: On Tue, Apr 14, 2015 at 10:07:54AM +0100, Yong Wu wrote: Hi Mark, Thanks very much for review. About the clock name should be the PoV of _this_ device. Could

Re: [PATCH 3/5] dt-bindings: mediatek: Add smi dts binding

2015-04-14 Thread Yong Wu
Hi Mark, On Tue, 2015-04-14 at 11:06 +0100, Mark Rutland wrote: On Tue, Apr 14, 2015 at 10:07:54AM +0100, Yong Wu wrote: Hi Mark, Thanks very much for review. About the clock name should be the PoV of _this_ device. Could you help check below? On Fri, 2015-03-06 at 11:13

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-21 Thread Yong Wu
On Thu, 2015-05-21 at 09:30 +0200, Matthias Brugger wrote: 2015-05-21 8:16 GMT+02:00 Yong Wu yong...@mediatek.com: Hi Matthias, Thanks very much for your suggestion. Abort the smi clock name, Could you help check below. The others I will improve in next time. On Tue

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-21 Thread Yong Wu
Hi Matthias, Thanks very much for your suggestion. Abort the smi clock name, Could you help check below. The others I will improve in next time. On Tue, 2015-05-19 at 13:14 +0200, Matthias Brugger wrote: 2015-05-15 11:43 GMT+02:00 Yong Wu yong...@mediatek.com: This patch add

Re: [PATCH v2 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-06-18 Thread Yong Wu
Hi Robin, while our drm test, we meet a problem while dma-mmap. On Thu, 2015-06-11 at 16:54 +0100, Robin Murphy wrote: Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting

Re: [PATCH v2 3/4] arm64: Add IOMMU dma_ops

2015-06-18 Thread Yong Wu
On Thu, 2015-06-11 at 16:54 +0100, Robin Murphy wrote: Taking some inspiration from the arch/arm code, implement the arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. Whilst proliferating per-device private IOMMU data via dev-archdata is less than ideal, it will do the

Re: [PATCH v2 3/6] iommu: add ARM short descriptor page table allocator.

2015-06-26 Thread Yong Wu
for the patch, it's good to see another user of the generic IO page-table code. However, I have quite a lot of comments on the code. On Fri, May 15, 2015 at 10:43:26AM +0100, Yong Wu wrote: This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K

Re: [PATCH v2 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-06-18 Thread Yong Wu
On Thu, 2015-06-18 at 17:54 +0100, Robin Murphy wrote: On 18/06/15 16:00, Yong Wu wrote: Hi Robin, while our drm test, we meet a problem while dma-mmap. On Thu, 2015-06-11 at 16:54 +0100, Robin Murphy wrote: Taking inspiration from the existing arch/arm code, break out some

Re: [PATCH 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-05-28 Thread Yong Wu
Hi Robin, Thanks. While we test venc in v4l2, we get a problem: When we enter the funtion[0], it will be break unexpectedly in the funcion[1] while the offset of sg table is not zero. It is ok if the offset is zero. Then I add more log in dma-iommu.c, please help check below. All

Re: [PATCH v2 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-05-27 Thread Yong Wu
Hi Tomasz, Thanks very much for your suggestion!. please help check my comment. On Mon, 2015-05-25 at 15:31 +0900, Tomasz Figa wrote: Hi, Please see my comments inline. On Fri, May 15, 2015 at 6:43 PM, Yong Wu yong...@mediatek.com wrote: This patch add mediatek iommu dts

Re: [PATCH v2 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-05-27 Thread Yong Wu
Hi Tomasz, Thanks. please help check my comments. The others I will change in next version. On Mon, 2015-05-25 at 17:29 +0900, Tomasz Figa wrote: Hi, Please see my comments inline. On Fri, May 15, 2015 at 6:43 PM, Yong Wu yong...@mediatek.com wrote: [snip] + +struct

Re: [PATCH v2 2/6] dt-bindings: mediatek: Add smi dts binding

2015-05-27 Thread Yong Wu
Hi Tomasz, On Mon, 2015-05-25 at 15:48 +0900, Tomasz Figa wrote: Hi, Please see my comments inline. On Fri, May 15, 2015 at 6:43 PM, Yong Wu yong...@mediatek.com wrote: This patch add smi binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../bindings/soc

Re: [PATCH v2 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-07-03 Thread Yong Wu
On Thu, 2015-06-11 at 16:54 +0100, Robin Murphy wrote: Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Signed-off-by: Robin Murphy

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-21 Thread Yong Wu
On Thu, 2015-05-21 at 22:33 +0800, Daniel Kurtz wrote: On Thu, May 21, 2015 at 3:30 PM, Matthias Brugger matthias@gmail.com wrote: 2015-05-21 8:16 GMT+02:00 Yong Wu yong...@mediatek.com: Hi Matthias, Thanks very much for your suggestion. Abort the smi clock name, Could you

Re: [PATCH v2 3/6] iommu: add ARM short descriptor page table allocator.

2015-05-21 Thread Yong Wu
... On 15/05/15 10:43, Yong Wu wrote: This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K/64K/1M/16M. From the look of the code, this doesn't fully support partial unmaps (i.e. splitting block entries), am I right? That's OK for DMA-API use

Re: [PATCH v2 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-07-07 Thread Yong Wu
On Fri, 2015-07-03 at 17:44 +0100, Robin Murphy wrote: On 03/07/15 10:27, Yong Wu wrote: [...] +/** + * iommu_dma_alloc - Allocate and map a buffer contiguous in IOVA space + * @dev: Device to allocate memory for. Must be a real device + * attached to an iommu_dma_domain

Re: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-07-31 Thread Yong Wu
On Mon, 2015-07-27 at 12:21 +0800, Yong Wu wrote: On Fri, 2015-07-24 at 17:53 +0100, Will Deacon wrote: On Fri, Jul 24, 2015 at 06:24:26AM +0100, Yong Wu wrote: On Tue, 2015-07-21 at 18:11 +0100, Will Deacon wrote: On Thu, Jul 16, 2015 at 10:04:32AM +0100, Yong Wu wrote: +/* level

Re: [PATCH v3 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-07-29 Thread Yong Wu
On Thu, 2015-07-23 at 22:40 +0800, Daniel Kurtz wrote: Hi Yong, On Thu, Jul 16, 2015 at 5:04 PM, Yong Wu yong...@mediatek.com wrote: This patch add the iommu/larbs nodes for mt8173 To what tree does this apply? Please rebase these patches (especially this one) on an Matthias' current

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-07-28 Thread Yong Wu
On Mon, 2015-07-27 at 16:49 +0100, Robin Murphy wrote: On 27/07/15 16:31, Russell King - ARM Linux wrote: On Mon, Jul 27, 2015 at 02:23:26PM +0100, Robin Murphy wrote: On 16/07/15 10:04, Yong Wu wrote: This patch adds support for mediatek m4u (MultiMedia Memory Management Unit

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-07-29 Thread Yong Wu
On Mon, 2015-07-27 at 14:23 +0100, Robin Murphy wrote: On 16/07/15 10:04, Yong Wu wrote: This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu yong...@mediatek.com [...] +static void mtk_iommu_flush_pgtable(void *ptr, size_t size, void

[PATCH v4 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-08-03 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu yong...@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek

[PATCH v4 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-08-03 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig | 13 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 714 ++ 3 files changed, 728

[PATCH v4 4/6] memory: mediatek: Add SMI driver

2015-08-03 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the clocks of each local arbiter Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/memory/Kconfig | 8 ++ drivers/memory/Makefile| 1 + drivers/memory/mtk-smi.c

[PATCH v4 2/6] dt-bindings: mediatek: Add smi dts binding

2015-08-03 Thread Yong Wu
This patch add smi binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../memory-controllers/mediatek,smi-larb.txt | 25 ++ .../bindings/memory-controllers/mediatek,smi.txt | 24 + 2 files changed, 49 insertions(+) create mode

[PATCH v4 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-08-03 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 61 include/dt-bindings/memory/mt8173-larb-port.h | 105 + 2 files changed, 166 insertions(+) create

[PATCH v4 3/6] iommu: add ARM short descriptor page table allocator.

2015-08-03 Thread Yong Wu
This patch is for ARM Short Descriptor Format. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 18 + drivers/iommu/Makefile | 1 + drivers/iommu/io-pgtable-arm-short.c | 813 +++ drivers/iommu/io-pgtable

[PATCH v4 0/6] MT8173 IOMMU SUPPORT

2015-08-03 Thread Yong Wu
://lists.infradead.org/pipermail/linux-mediatek/2015-July/001800.html [4]: http://lists.linuxfoundation.org/pipermail/iommu/2015-July/013597.html Yong Wu (6): dt-bindings: iommu: Add binding for mediatek IOMMU dt-bindings: mediatek: Add smi dts binding iommu: add ARM short descriptor page table

Re: [PATCH v4 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-08-12 Thread Yong Wu
On Tue, 2015-08-11 at 17:39 +0200, Joerg Roedel wrote: On Mon, Aug 03, 2015 at 06:21:18PM +0800, Yong Wu wrote: +/* + * There is only one iommu domain called the m4u domain that + * all Multimedia modules share. + */ +static struct mtk_iommu_domain *m4udom; What is the reason you

Re: [PATCH v4 4/6] memory: mediatek: Add SMI driver

2015-08-12 Thread Yong Wu
On Tue, 2015-08-11 at 16:56 +0200, Joerg Roedel wrote: On Mon, Aug 03, 2015 at 06:21:17PM +0800, Yong Wu wrote: +static int mtk_smi_common_get(struct device *smidev) +{ + struct mtk_smi_common *smipriv = dev_get_drvdata(smidev); + int ret; + + ret = pm_runtime_get_sync(smidev

Re: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-07-27 Thread Yong Wu
On Mon, 2015-07-27 at 15:11 +0100, Will Deacon wrote: On Mon, Jul 27, 2015 at 03:05:38PM +0100, Robin Murphy wrote: On 27/07/15 05:21, Yong Wu wrote: + } else {/* page or largepage */ + if (quirk IO_PGTABLE_QUIRK_SHORT_MTK

Re: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-07-23 Thread Yong Wu
, 2015 at 10:04:32AM +0100, Yong Wu wrote: This patch is for ARM Short Descriptor Format. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 18 + drivers/iommu/Makefile |1 + drivers/iommu/io-pgtable-arm-short.c | 742

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-07-23 Thread Yong Wu
On Tue, 2015-07-21 at 15:59 +0100, Will Deacon wrote: Hi Yong Wu, On Thu, Jul 16, 2015 at 10:04:34AM +0100, Yong Wu wrote: This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). [...] +static void mtk_iommu_tlb_flush_all(void *cookie) +{ + struct

Re: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-07-26 Thread Yong Wu
On Fri, 2015-07-24 at 17:53 +0100, Will Deacon wrote: On Fri, Jul 24, 2015 at 06:24:26AM +0100, Yong Wu wrote: On Tue, 2015-07-21 at 18:11 +0100, Will Deacon wrote: On Thu, Jul 16, 2015 at 10:04:32AM +0100, Yong Wu wrote: +/* level 2 pagetable */ +#define ARM_SHORT_PTE_TYPE_LARGE

Re: [PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-07-26 Thread Yong Wu
On Fri, 2015-07-24 at 17:55 +0100, Will Deacon wrote: On Fri, Jul 24, 2015 at 06:43:13AM +0100, Yong Wu wrote: On Tue, 2015-07-21 at 15:59 +0100, Will Deacon wrote: On Thu, Jul 16, 2015 at 10:04:34AM +0100, Yong Wu wrote: +static void mtk_iommu_tlb_flush_all(void *cookie

Re: [PATCH v3 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-07-13 Thread Yong Wu
On Fri, 2015-07-10 at 20:19 +0100, Robin Murphy wrote: Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Signed-off-by: Robin Murphy

[PATCH v3 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-07-16 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu yong...@mediatek.com --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 ++ 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek

[PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-07-16 Thread Yong Wu
This patch is for ARM Short Descriptor Format. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 18 + drivers/iommu/Makefile |1 + drivers/iommu/io-pgtable-arm-short.c | 742 ++ drivers/iommu/io-pgtable

[PATCH v3 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-07-16 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig | 13 + drivers/iommu/Makefile|1 + drivers/iommu/mtk_iommu.c | 724 + 3 files changed

[PATCH v3 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-07-16 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu yong...@mediatek.com --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 61 include/dt-bindings/memory/mt8173-larb-port.h | 105 2 files changed, 166 insertions(+) create

Re: [PATCH v5 0/6] MT8173 IOMMU SUPPORT

2015-10-21 Thread Yong Wu
On Wed, 2015-10-14 at 14:56 +0200, Joerg Roedel wrote: > On Fri, Oct 09, 2015 at 10:23:02AM +0800, Yong Wu wrote: > > Yong Wu (6): > > dt-bindings: iommu: Add binding for mediatek IOMMU > > dt-bindings: mediatek: Add smi dts binding > > iommu: add ARM short desc

Re: [PATCH v5 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-10-25 Thread Yong Wu
On Wed, 2015-10-14 at 14:53 +0200, Joerg Roedel wrote: > On Fri, Oct 09, 2015 at 10:23:07AM +0800, Yong Wu wrote: > > + /* > > +* There is a domain for each a iommu device in normal case. > > +* But MTK only has one iommu domain called the m4u domain which all >

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-26 Thread Yong Wu
On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: [...] > +/* > + * The DMA API client is passing in a scatterlist which could describe > + * any old buffer layout, but the IOMMU API requires everything to be > + * aligned to IOMMU pages. Hence the need for this complicated bit of > + *

Re: [PATCH] iommu/dma: Map scatterlists more parsimoniously

2015-11-11 Thread Yong Wu
repost next week based on rc1 instead of some random local > development commit. > > Robin. It works well on MT8173. containing VDA/VEA(VideoDecodeAccelerator/VideoEncodeAccelerator) unit test. Tested-by: Yong Wu <yong...@mediatek.com> > > drivers/iommu/dma-iommu.c | 19

Re: [PATCH v5 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-10-31 Thread Yong Wu
On Tue, 2015-10-27 at 13:25 +, Robin Murphy wrote: > On 09/10/15 03:23, Yong Wu wrote: > [...] > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include

Re: [PATCH v5 4/6] memory: mediatek: Add SMI driver

2015-10-31 Thread Yong Wu
On Tue, 2015-10-27 at 13:24 +, Robin Murphy wrote: > On 09/10/15 03:23, Yong Wu wrote: > [...] > > +static int mtk_smi_probe(struct platform_device *pdev) > > +{ > > + struct device *dev = >dev; > > + struct mtk_smi_data *smidata; > > + int

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-11-04 Thread Yong Wu
On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: > Taking some inspiration from the arch/arm code, implement the > arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. [...] > +static void *__iommu_alloc_attrs(struct device *dev, size_t size, > +

Re: [PATCH v5 3/6] iommu: add ARM short descriptor page table allocator

2015-11-06 Thread Yong Wu
On Fri, 2015-10-09 at 10:23 +0800, Yong Wu wrote: > This patch is for ARM Short Descriptor Format. > > Signed-off-by: Yong Wu <yong...@mediatek.com> > --- Hi Will, Robin, Is there any comment about this patch? As our project request, We are going to prepare the next ve

Re: [PATCH v4 3/6] iommu: add ARM short descriptor page table allocator.

2015-10-21 Thread Yong Wu
On Fri, 2015-10-09 at 19:19 +0100, Will Deacon wrote: > On Fri, Oct 09, 2015 at 06:41:51PM +0100, Robin Murphy wrote: > > On 09/10/15 16:57, Will Deacon wrote: > > >On Tue, Sep 22, 2015 at 03:12:47PM +0100, Yong Wu wrote: > > >> I would like to show you a problem

[PATCH v5 0/6] MT8173 IOMMU SUPPORT

2015-10-08 Thread Yong Wu
/pipermail/iommu/2015-October/014504.html [2]: http://lists.infradead.org/pipermail/linux-mediatek/2015-August/001962.html Yong Wu (6): dt-bindings: iommu: Add binding for mediatek IOMMU dt-bindings: mediatek: Add smi dts binding iommu: add ARM short descriptor page table allocator memory: mediatek

[PATCH v5 6/6] dts: mt8173: Add iommu/smi nodes for mt8173

2015-10-08 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu <yong...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/bo

[PATCH v5 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-10-08 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu <yong...@mediatek.com> --- drivers/iommu/Kconfig | 15 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 767 ++ 3 files c

[PATCH v5 1/6] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-10-08 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu <yong...@mediatek.com> --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 61 include/dt-bindings/memory/mt8173-larb-port.h | 105 + 2 files changed, 166 insertions(+)

[PATCH v5 3/6] iommu: add ARM short descriptor page table allocator

2015-10-08 Thread Yong Wu
This patch is for ARM Short Descriptor Format. Signed-off-by: Yong Wu <yong...@mediatek.com> --- drivers/iommu/Kconfig| 18 + drivers/iommu/Makefile | 1 + drivers/iommu/io-pgtable-arm-short.c | 827 +++ drivers/iommu/io-p

[PATCH v5 4/6] memory: mediatek: Add SMI driver

2015-10-08 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the clocks of each local arbiter Signed-off-by: Yong Wu <yong...@mediatek.com> --- drivers/memory/Kconfig | 8 ++ drivers/memory/Makefile| 1 + drivers/memo

[PATCH v5 2/6] dt-bindings: mediatek: Add smi dts binding

2015-10-08 Thread Yong Wu
This patch add smi binding document. Signed-off-by: Yong Wu <yong...@mediatek.com> --- .../memory-controllers/mediatek,smi-larb.txt | 25 ++ .../bindings/memory-controllers/mediatek,smi.txt | 24 + 2 files changed, 49 insertions(+) creat

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-10-08 Thread Yong Wu
On Wed, 2015-10-07 at 17:07 +0100, Robin Murphy wrote: > On 06/10/15 12:00, Yong Wu wrote: > > On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: > >> Taking some inspiration from the arch/arm code, implement the > >> arch-specific side of the DMA mapping ops us

Re: [PATCH v6 2/3] arm64: Add IOMMU dma_ops

2015-10-06 Thread Yong Wu
On Thu, 2015-10-01 at 20:13 +0100, Robin Murphy wrote: > Taking some inspiration from the arch/arm code, implement the > arch-specific side of the DMA mapping ops using the new IOMMU-DMA layer. > > Since there is still work to do elsewhere to make DMA configuration happen > in a more appropriate

Re: [PATCH v5 0/3] arm64: IOMMU-backed DMA mapping

2015-08-26 Thread Yong Wu
On Fri, 2015-07-31 at 18:18 +0100, Robin Murphy wrote: Hi all, Here's an update following Catalin's feedback on v4[1]. Changes this round: - Rebased onto linux-next - IOVA alignment fix applied already - iommu_iova_cache_init() is now iova_cache_get() - Tidied up iommu_dma_alloc()

Re: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.

2015-09-14 Thread Yong Wu
On Tue, 2015-07-21 at 18:11 +0100, Will Deacon wrote: [...] > > +static int arm_short_map(struct io_pgtable_ops *ops, unsigned long iova, > > +phys_addr_t paddr, size_t size, int prot) > > +{ > > + struct arm_short_io_pgtable *data = io_pgtable_ops_to_data(ops); > > +

Re: [PATCH v4 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-09-14 Thread Yong Wu
On Fri, 2015-09-11 at 16:33 +0100, Robin Murphy wrote: > On 03/08/15 11:21, Yong Wu wrote: > > This patch adds support for mediatek m4u (MultiMedia Memory Management > > Unit). > > > > Signed-off-by: Yong Wu <yong...@mediatek.com> > > --- > [...] >

Re: [PATCH v4 3/6] iommu: add ARM short descriptor page table allocator.

2015-09-17 Thread Yong Wu
On Wed, 2015-09-16 at 16:58 +0100, Will Deacon wrote: > On Mon, Aug 03, 2015 at 11:21:16AM +0100, Yong Wu wrote: > > This patch is for ARM Short Descriptor Format. > > > > Signed-off-by: Yong Wu <yong...@mediatek.com> > > --- > > drivers/iommu/Kconfig

Re: [PATCH v2] iommu/io-pgtable-arm: Don't use dma_to_phys()

2015-09-18 Thread Yong Wu
On Thu, 2015-09-17 at 17:42 +0100, Robin Murphy wrote: > In checking whether DMA addresses differ from physical addresses, using > dma_to_phys() is actually the wrong thing to do, since it may hide any > DMA offset, which is precisely one of the things we are checking for. > Simply casting between

Re: [PATCH v2] iommu/io-pgtable-arm: Don't use dma_to_phys()

2015-09-22 Thread Yong Wu
On Fri, 2015-09-18 at 12:04 +0100, Robin Murphy wrote: > On 18/09/15 09:55, Yong Wu wrote: > > On Thu, 2015-09-17 at 17:42 +0100, Robin Murphy wrote: > [...] > >> the appropriate course of action. Further care (and ugliness) is also > >> necessary in the

Re: [PATCH v4 3/6] iommu: add ARM short descriptor page table allocator.

2015-09-22 Thread Yong Wu
> > > +static int arm_short_unmap(struct io_pgtable_ops *ops, > > > + unsigned long iova, > > > + size_t size) > > > +{ > > > + struct arm_short_io_pgtable *data = io_pgtable_ops_to_data(ops); > > > + struct io_pgtable_cfg *cfg =

[PATCH v6 3/5] memory: mediatek: Add SMI driver

2015-12-08 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the power domain and clocks of each local arbiter. Signed-off-by: Yong Wu <yong...@mediatek.com> --- Currently SMI offer mtk_smi_larb_get/put to enable the power-domain ,

[PATCH v6 1/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-12-08 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu <yong...@mediatek.com> --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 68 + include/dt-bindings/memory/mt8173-larb-port.h | 111 + 2 files changed, 179 insertions(+)

[PATCH v6 5/5] dts: mt8173: Add iommu/smi nodes for mt8173

2015-12-08 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu <yong...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/bo

[PATCH v6 2/5] dt-bindings: mediatek: Add smi dts binding

2015-12-08 Thread Yong Wu
This patch add smi binding document. Signed-off-by: Yong Wu <yong...@mediatek.com> --- .../memory-controllers/mediatek,smi-common.txt | 24 + .../memory-controllers/mediatek,smi-larb.txt | 25 ++ 2 files changed, 49 insertions(+) creat

Re: [PATCH 5/5] iommu/io-pgtable: Add ARMv7 short descriptor support

2015-12-08 Thread Yong Wu
rly-complete ARMv7 short descriptor implementation, omitting > only a few legacy and CPU-centric aspects which shouldn't be necessary > for IOMMU API use anyway. > > Signed-off-by: Yong Wu <yong...@mediatek.com> > Signed-off-by: Robin Murphy <robin.mur...@arm.com> &

[PATCH v6 0/5] MT8173 IOMMU SUPPORT

2015-12-08 Thread Yong Wu
. -fix some coding style issues. v1: http://lists.infradead.org/pipermail/linux-mediatek/2015-March/58.html -initial version. Yong Wu (5): dt-bindings: iommu: Add binding for mediatek IOMMU dt-bindings: mediatek: Add smi dts binding memory: mediatek: Add SMI driver iommu/mediatek: Add

Re: [PATCH v6 1/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-12-08 Thread Yong Wu
also add Mark. On Tue, 2015-12-08 at 21:33 -0600, Rob Herring wrote: > On Tue, Dec 08, 2015 at 05:49:09PM +0800, Yong Wu wrote: > > This patch add mediatek iommu dts binding document. > > > > Signed-off-by: Yong Wu <yong...@mediatek.com> > > --- > >

Re: [PATCH v6 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-16 Thread Yong Wu
On Wed, 2015-12-16 at 12:48 +, Robin Murphy wrote: > On 16/12/15 05:59, Yong Wu wrote: > > On Tue, 2015-12-15 at 12:37 +, Robin Murphy wrote: > >> On 15/12/15 03:28, Yong Wu wrote: > >>> On Mon, 2015-12-14 at 15:16 +0100, Joerg Roedel wrote: > >>>

Re: [PATCH v6 3/5] memory: mediatek: Add SMI driver

2015-12-14 Thread Yong Wu
On Mon, 2015-12-14 at 19:18 +0100, Matthias Brugger wrote: > On Tuesday 08 Dec 2015 17:49:11 Yong Wu wrote: > > This patch add SMI(Smart Multimedia Interface) driver. This driver > > is responsible to enable/disable iommu and control the power domain > > and clocks

Re: [PATCH v6 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-14 Thread Yong Wu
On Mon, 2015-12-14 at 19:19 +0100, Matthias Brugger wrote: > > On 08/12/15 10:49, Yong Wu wrote: > > This patch adds support for mediatek m4u (MultiMedia Memory Management > > Unit). > > > > Signed-off-by: Yong Wu <yong...@mediatek.com> > > --- [...

Re: [PATCH v6 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-14 Thread Yong Wu
On Mon, 2015-12-14 at 15:16 +0100, Joerg Roedel wrote: > On Tue, Dec 08, 2015 at 05:49:12PM +0800, Yong Wu wrote: > > +static int mtk_iommu_attach_device(struct iommu_domain *domain, > > + struct device *dev) > > +{ > > + struct mtk_iommu_

[PATCH v7 2/5] dt-bindings: mediatek: Add smi dts binding

2015-12-18 Thread Yong Wu
This patch add smi binding document and smi local arbiter header file. Signed-off-by: Yong Wu <yong...@mediatek.com> --- Hi Rob, Because I move the header file(dt-bindings/memory/mt8173-larb-port.h) from our patch[1/5] into here. I am not sure you agree with this, so don't add your Ack

[PATCH v7 3/5] memory: mediatek: Add SMI driver

2015-12-18 Thread Yong Wu
This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the power domain and clocks of each local arbiter. Signed-off-by: Yong Wu <yong...@mediatek.com> --- drivers/memory/Kconfig | 8 ++ drivers/memory/Makefile

[PATCH v7 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-18 Thread Yong Wu
This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu <yong...@mediatek.com> --- drivers/iommu/Kconfig | 14 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 734 ++ 3 files c

[PATCH v7 5/5] dts: mt8173: Add iommu/smi nodes for mt8173

2015-12-18 Thread Yong Wu
This patch add the iommu/larbs nodes for mt8173 Signed-off-by: Yong Wu <yong...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 81 1 file changed, 81 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/bo

[PATCH v7 1/5] dt-bindings: iommu: Add binding for mediatek IOMMU

2015-12-18 Thread Yong Wu
This patch add mediatek iommu dts binding document. Signed-off-by: Yong Wu <yong...@mediatek.com> --- .../devicetree/bindings/iommu/mediatek,iommu.txt | 68 ++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/mediatek,iom

[PATCH v7 0/5] MT8173 IOMMU SUPPORT

2015-12-18 Thread Yong Wu
according to smi HW. -delete the hardcode of the port-names in mt8173. replace this with larb-portes-nr in dtsi. -fix some coding style issues. v1: http://lists.infradead.org/pipermail/linux-mediatek/2015-March/58.html -initial version. Yong Wu (5): dt-bindings: iommu: Add binding

Re: [PATCH v6 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-15 Thread Yong Wu
On Tue, 2015-12-15 at 12:37 +, Robin Murphy wrote: > On 15/12/15 03:28, Yong Wu wrote: > > On Mon, 2015-12-14 at 15:16 +0100, Joerg Roedel wrote: > >> On Tue, Dec 08, 2015 at 05:49:12PM +0800, Yong Wu wrote: > >>> +static int mtk_iommu_attach_devi

  1   2   3   4   5   6   7   8   9   10   >