From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932462Ab1IMTcQ (ORCPT ); Tue, 13 Sep 2011 15:32:16 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:58308 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932441Ab1IMTcM (ORCPT ); Tue, 13 Sep 2011 15:32:12 -0400 From: Ohad Ben-Cohen To: Cc: , Hiroshi DOYU , Laurent Pinchart , Joerg Roedel , David Woodhouse , , David Brown , Arnd Bergmann , , Ohad Ben-Cohen , Stepan Moskovchenko Subject: [PATCH v2 3/6] iommu/msm: announce supported page sizes Date: Tue, 13 Sep 2011 22:31:25 +0300 Message-Id: <1315942288-17297-3-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315942288-17297-1-git-send-email-ohad@wizery.com> References: <1315942288-17297-1-git-send-email-ohad@wizery.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let the IOMMU core know we support 4KB, 64KB, 1MB and 16MB page sizes. This way the IOMMU core can split any arbitrary-sized physically contiguous regions (that it needs to map) as needed. Signed-off-by: Ohad Ben-Cohen Cc: David Brown Cc: Stepan Moskovchenko --- drivers/iommu/msm_iommu.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index d1733f6..a4ed116 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -676,6 +676,9 @@ fail: return 0; } +/* bitmap of the page sizes currently supported */ +static unsigned long msm_iommu_pgsizes = SZ_4K | SZ_64K | SZ_1M | SZ_16M; + static struct iommu_ops msm_iommu_ops = { .domain_init = msm_iommu_domain_init, .domain_destroy = msm_iommu_domain_destroy, @@ -728,7 +731,10 @@ static void __init setup_iommu_tex_classes(void) static int __init msm_iommu_init(void) { setup_iommu_tex_classes(); - register_iommu(&msm_iommu_ops); + + /* we're only using the first 25 bits of the pgsizes bitmap */ + register_iommu_pgsize(&msm_iommu_ops, &msm_iommu_pgsizes, 25); + return 0; } -- 1.7.4.1