From patchwork Fri Mar 14 05:09:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cho KyongHo X-Patchwork-Id: 3830611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6710E9F1CD for ; Fri, 14 Mar 2014 05:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CCF3202F0 for ; Fri, 14 Mar 2014 05:11:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F270202B8 for ; Fri, 14 Mar 2014 05:11:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKO7-0003Nq-CZ; Fri, 14 Mar 2014 05:10:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKNe-0000NI-D9; Fri, 14 Mar 2014 05:10:02 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WOKNb-0000L9-EH for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 05:10:00 +0000 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2E003NSUC07Y30@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 14 Mar 2014 14:09:36 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.51]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 21.B1.14803.01F82235; Fri, 14 Mar 2014 14:09:36 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-39-53228f10dcae Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F1.85.29263.01F82235; Fri, 14 Mar 2014 14:09:36 +0900 (KST) Received: from DO-PULLIP-CHO07.dsn.sec.samsung.com ([12.36.165.149]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2E001IXUBZTZL2@mmp1.samsung.com>; Fri, 14 Mar 2014 14:09:35 +0900 (KST) Date: Fri, 14 Mar 2014 14:09:35 +0900 From: Cho KyongHo To: Linux ARM Kernel , Linux DeviceTree , Linux IOMMU , Linux Kernel , Linux Samsung SOC Subject: [PATCH v11 13/27] iommu/exynos: support for device tree Message-id: <20140314140935.e0652b58ce16591b54d0e10b@samsung.com> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.10.14; i686-pc-mingw32) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsVy+t8zY12BfqVgg1PvxSzu3D3HajH/CJB4 deQHk8WC/dYWnbM3sFv0LrjKZrHp8TVWi8u75rBZzDi/j8niwoqN7BZTFh1mtTj8pp3V4uSf XkaL9TNes1jMvLWGxYHf48nBeUwesxsusnj8O9zP5HHn2h42j81L6j0m31jO6NG3ZRWjx+dN ch5Xjp5hCuCM4rJJSc3JLEst0rdL4MpYdja2YIVwxf7f15kbGF/ydzFyckgImEhMm9rDCmGL SVy4t56ti5GLQ0hgGaPEyl3nWGCKvj5bxwyRWMQosXDzJSYIZzKTxP2nu5lAqlgEVCUeTF8H ZrMJaEmsnnucEaRIRKCNSeJr4yEWEIdZYC6zxMdvc4CWcHAICzhILPo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T0nMN9YoTc4tL89L1kvNzNzGCU8MzqR2MKxssDjEKcDAq8fA6HFYMFmJNLCuu zD3EKMHBrCTCWxWhFCzEm5JYWZValB9fVJqTWnyIMRno7YnMUqLJ+cC0lVcSb2hsYmZkaWRm YWRibk6asJI474FW60AhgfTEktTs1NSC1CKYLUwcnFINjHslpA2+2ikfmBTwmPGhdb/c1+8/ etpT5t74pPJ54fE1U16vMfTV4g5/NKu/1mdHZKvShvdbT5wUmXU3tqZcyTLt9lmne4dMu8TU D9dVfvAtcqu6nblRXuThvd//dz9509/YfGCboP/7sM3MzUpnuVzZLBv+P2w3/mzTlRVUu+3B 4hP7DzXOP63EUpyRaKjFXFScCAC0qTseUQMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140314_010959_694441_AF9A194D X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -6.9 (------) Cc: Kukjin Kim , Prathyush , Grant Grundler , Joerg Roedel , Sachin Kamat , Sylwester Nawrocki , Varun Sethi , Antonios Motakis , Tomasz Figa , Rahul Sharma X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit adds device tree support for System MMU. Signed-off-by: Cho KyongHo --- drivers/iommu/Kconfig | 5 ++--- drivers/iommu/exynos-iommu.c | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index df56e4c..22af807 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -178,16 +178,15 @@ config TEGRA_IOMMU_SMMU config EXYNOS_IOMMU bool "Exynos IOMMU Support" - depends on ARCH_EXYNOS && EXYNOS_DEV_SYSMMU + depends on ARCH_EXYNOS select IOMMU_API + default n help Support for the IOMMU(System MMU) of Samsung Exynos application processor family. This enables H/W multimedia accellerators to see non-linear physical memory chunks as a linear memory in their address spaces - If unsure, say N here. - config EXYNOS_IOMMU_DEBUG bool "Debugging log for Exynos IOMMU" depends on EXYNOS_IOMMU diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 33b424d..34feb04 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -497,7 +498,7 @@ void exynos_sysmmu_tlb_invalidate(struct device *dev) read_unlock_irqrestore(&data->lock, flags); } -static int exynos_sysmmu_probe(struct platform_device *pdev) +static int __init exynos_sysmmu_probe(struct platform_device *pdev) { int irq, ret; struct device *dev = &pdev->dev; @@ -557,11 +558,23 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) return 0; } -static struct platform_driver exynos_sysmmu_driver = { - .probe = exynos_sysmmu_probe, - .driver = { +#ifdef CONFIG_OF +static struct of_device_id sysmmu_of_match[] __initconst = { + { .compatible = "samsung,sysmmu-v1", }, + { .compatible = "samsung,sysmmu-v2", }, + { .compatible = "samsung,sysmmu-v3.1", }, + { .compatible = "samsung,sysmmu-v3.2", }, + { .compatible = "samsung,sysmmu-v3.3", }, + { }, +}; +#endif + +static struct platform_driver exynos_sysmmu_driver __refdata = { + .probe = exynos_sysmmu_probe, + .driver = { .owner = THIS_MODULE, .name = "exynos-sysmmu", + .of_match_table = of_match_ptr(sysmmu_of_match), } };