Re: [PATCH 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-12 Thread Honghui Zhang
Hi, Robin, Thanks very much for your comment, and sorry for the last reply format. On Tue, 2016-05-10 at 11:28 +0100, Robin Murphy wrote: > On 09/05/16 09:00, honghui.zh...@mediatek.com wrote: > [...] > > +static void *mtk_iommu_alloc_pgt(struct device *dev, size_t size, gfp_t > > gfp) > > +{ > >

Re: [PATCH 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-12 Thread 张洪辉
hi, Robin, thanks very much for your comments. On 5/10/2016 6:28 PM, Robin Murphy wrote: > On 09/05/16 09:00, honghui.zh...@mediatek.com wrote: > [...] >> +static void *mtk_iommu_alloc_pgt(struct device *dev, size_t size, gfp_t gfp) >> +{ >> +dma_addr_t dma; >> +void *pages = alloc_pages_e

Re: [PATCH 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-10 Thread Robin Murphy
On 09/05/16 09:00, honghui.zh...@mediatek.com wrote: [...] +static void *mtk_iommu_alloc_pgt(struct device *dev, size_t size, gfp_t gfp) +{ + dma_addr_t dma; + void *pages = alloc_pages_exact(size, gfp | __GFP_ZERO); + + if (!pages) + return NULL; + + dma = d

[PATCH 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U have two generations of HW architcture. Generation one use flat, one layer pagetable, and was shipped with ARM architecture, it only support 4K size page mapping. MT2701 SoC use this generation one m4u HW. Generation two uses the ARM short-descriptor transla