From patchwork Tue Dec 25 11:19:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hideki EIRAKU X-Patchwork-Id: 1909621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 3748F3FC66 for ; Tue, 25 Dec 2012 11:23:43 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TnSYw-0001v0-9N; Tue, 25 Dec 2012 11:20:46 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TnSY7-0001lJ-10 for linux-arm-kernel@lists.infradead.org; Tue, 25 Dec 2012 11:19:59 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so4338346pbc.8 for ; Tue, 25 Dec 2012 03:19:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=5HIJXXWHQIwT5R2s7wLQqvILw3bPf2V+iALjiQsVTRQ=; b=onqsrkWZCI8a2lagFk8AEW7z5o2Jnm+2OMeBO0m/UphEX7riooCskvEjVVUhMVhAcr TXNk2pScBdMAYgVdxskDY1l3aRsyz+J6jnvvoNLmh3jLeebkRxZd5R14oP8Jhgixumcr omliETsHlHZYjVGuqDFD2RpPaxJGTpETEpdjyZX1cpmQgeZKr5U+pDe4nydRhEJk9HCQ pustbk8opKCppm6+v7CiJlG7ViOucXUp/YA6cxeqkn7BcG2BLVS98AT/4eChtMf/lDG/ AqwWaAWtQs1CHjiLtvyamdSWxpd/BAZ1sE2G7cmdxm4ZCf0bfI0jQa5xhpqXP9JfBc6P wFYw== X-Received: by 10.68.223.230 with SMTP id qx6mr76930815pbc.159.1356434393567; Tue, 25 Dec 2012 03:19:53 -0800 (PST) Received: from tyrell.hq.igel.co.jp ([219.106.231.132]) by mx.google.com with ESMTPS id pu5sm13943480pbb.73.2012.12.25.03.19.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 03:19:53 -0800 (PST) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King , Simon Horman , Laurent Pinchart Subject: [PATCH v5 4/4] ARM: mach-shmobile: r8a7740: Add IPMMU device Date: Tue, 25 Dec 2012 20:19:15 +0900 Message-Id: <1356434355-3279-5-git-send-email-hdk@igel.co.jp> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1356434355-3279-1-git-send-email-hdk@igel.co.jp> References: <1356434355-3279-1-git-send-email-hdk@igel.co.jp> X-Gm-Message-State: ALoCoQkycH922kd8Gj1H4u/2AtBbJm2mj4uzJ4D3IHmrXYS66LuzLIxubSi/zYHJF/RTAQ8FlSRn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121225_061955_762768_88C72BC1 X-CRM114-Status: GOOD ( 14.33 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Katsuya MATSUBARA , Hideki EIRAKU , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Damian Hobson-Garcia , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch adds an IPMMU device and notifies the IPMMU driver which devices are connected via the IPMMU module. All devices connected to the main memory bus via the IPMMU module MUST be registered when SHMOBILE_IPMMU and SHMOBILE_IOMMU are enabled because physical address cannot be used while the IPMMU module's MMU function is enabled. Signed-off-by: Hideki EIRAKU --- arch/arm/mach-shmobile/setup-r8a7740.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 0952224..b85bea5 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -262,6 +263,37 @@ static struct platform_device cmt10_device = { .num_resources = ARRAY_SIZE(cmt10_resources), }; +/* IPMMUI (an IPMMU module for ICB/LMB) */ +static struct resource ipmmu_resources[] = { + [0] = { + .name = "IPMMUI", + .start = 0xfe951000, + .end = 0xfe9510ff, + .flags = IORESOURCE_MEM, + }, +}; + +static const char * const ipmmu_dev_names[] = { + "sh_mobile_lcdc_fb.0", + "sh_mobile_lcdc_fb.1", + "sh_mobile_ceu.0", +}; + +static struct shmobile_ipmmu_platform_data ipmmu_platform_data = { + .dev_names = ipmmu_dev_names, + .num_dev_names = ARRAY_SIZE(ipmmu_dev_names), +}; + +static struct platform_device ipmmu_device = { + .name = "ipmmu", + .id = -1, + .dev = { + .platform_data = &ipmmu_platform_data, + }, + .resource = ipmmu_resources, + .num_resources = ARRAY_SIZE(ipmmu_resources), +}; + static struct platform_device *r8a7740_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -273,6 +305,7 @@ static struct platform_device *r8a7740_early_devices[] __initdata = { &scif7_device, &scifb_device, &cmt10_device, + &ipmmu_device, }; /* DMA */