From patchwork Sun Apr 27 07:37:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 4070401 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 93E639F319 for ; Sun, 27 Apr 2014 07:40:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC60620251 for ; Sun, 27 Apr 2014 07:40:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BACA720218 for ; Sun, 27 Apr 2014 07:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753223AbaD0Hk2 (ORCPT ); Sun, 27 Apr 2014 03:40:28 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:31141 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753239AbaD0HjW (ORCPT ); Sun, 27 Apr 2014 03:39:22 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4O00KITILLQB30@mailout2.samsung.com>; Sun, 27 Apr 2014 16:39:21 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.124]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 20.2C.14563.924BC535; Sun, 27 Apr 2014 16:39:21 +0900 (KST) X-AuditID: cbfee68e-b7fd86d0000038e3-69-535cb4296005 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E6.EB.27725.824BC535; Sun, 27 Apr 2014 16:39:21 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4O00I35IKD7Q00@mmp1.samsung.com>; Sun, 27 Apr 2014 16:39:20 +0900 (KST) From: Shaik Ameer Basha To: linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: kgene.kim@samsung.com, tomasz.figa@gmail.com, pullip.cho@samsung.com, a.motakis@virtualopensystems.com, grundler@chromium.org, joro@8bytes.org, prathyush.k@samsung.com, rahul.sharma@samsung.com, sachin.kamat@linaro.org, supash.ramaswamy@linaro.org, Varun.Sethi@freescale.com, s.nawrocki@samsung.com, t.figa@samsung.com, joshi@samsung.com, Shaik Ameer Basha Subject: [PATCH v12 12/31] iommu/exynos: support for device tree Date: Sun, 27 Apr 2014 13:07:44 +0530 Message-id: <1398584283-22846-13-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1398584283-22846-1-git-send-email-shaik.ameer@samsung.com> References: <1398584283-22846-1-git-send-email-shaik.ameer@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWyRsSkRldzS0ywweJufos7d8+xWsw/AiRe HfnBZLFgv7VF5+wN7Bbfd31ht+hdcJXNYtPja6wWl3fNYbOYcX4fk8WFFRvZLf71HmS0mLLo MKvF4TftrBYn//QyWhx5uJvdouV6L5PF+hmvWSxW7frDaDHz1hoWBxGPJwfnMXnMbrjI4vHv cD+Tx85Zd9k97lzbw+axeUm9x+Qbyxk9+rasYvT4vEnO48rRM0wBXFFcNimpOZllqUX6dglc GVe+X2It2CNRcXjPIfYGxjaRLkZODgkBE4kvR68xQdhiEhfurWcDsYUEljJKrDjDAVNzbn4v axcjF1B8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bm8sioCqx59gvsG5eAQ+JxnlbgGo4gPYpSMyZZAMS5gQKP7mz B6xESMBd4u2pL6wTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAiO/GdSOxhXNlgc YhTgYFTi4V0gGRMsxJpYVlyZe4hRgoNZSYSXczpQiDclsbIqtSg/vqg0J7X4EGMy0FETmaVE k/OBSSmvJN7Q2MTc1NjU0sTCxMySNGElcd4DrdaBQgLpiSWp2ampBalFMFuYODilGhi5vT83 Vf8QTi4M/Pgy2na58JFLnwp3ML68fe9gVefldf/WMP1o2Tv/4+vidIYwqz719Jqm/Huvlgr/ 2iRmPlHsXGJaPN/B1m333dYW1myesD8l7GO2zSr1zgjOUL+JixyOX3m16qbFo/Qc5aIyp+dc m14+2ZzusUvITequ1dzCyZw13iF614uVWIozEg21mIuKEwFfIb9nQAMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Cho KyongHo This commit adds device tree support for System MMU. It also enables iommu support for ARCH_EXYNOS. Signed-off-by: Cho KyongHo Signed-off-by: Shaik Ameer Basha --- arch/arm/Kconfig | 2 ++ drivers/iommu/Kconfig | 8 +++----- drivers/iommu/exynos-iommu.c | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ab438cb..19689e4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -834,6 +834,8 @@ config ARCH_EXYNOS select ARCH_HAS_HOLES_MEMORYMODEL select ARCH_REQUIRE_GPIOLIB select ARCH_SPARSEMEM_ENABLE + select ARM_AMBA + select ARM_DMA_USE_IOMMU select ARM_GIC select COMMON_CLK select CPU_V7 diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index df56e4c..5feadb8 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -178,16 +178,14 @@ 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 help - Support for the IOMMU(System MMU) of Samsung Exynos application - processor family. This enables H/W multimedia accellerators to see + Support for the IOMMU (System MMU) of Samsung Exynos application + processor family. This enables H/W multimedia accelerators 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 0f1d3f0..cbb9b67 100755 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -494,7 +495,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; @@ -548,11 +549,21 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) return 0; } -static struct platform_driver exynos_sysmmu_driver = { - .probe = exynos_sysmmu_probe, - .driver = { +static const 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", }, + { }, +}; + +static struct platform_driver exynos_sysmmu_driver __refdata = { + .probe = exynos_sysmmu_probe, + .driver = { .owner = THIS_MODULE, .name = "exynos-sysmmu", + .of_match_table = sysmmu_of_match, } };