From patchwork Tue Dec 25 11:19:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hideki EIRAKU X-Patchwork-Id: 1909611 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 52F6A3FC66 for ; Tue, 25 Dec 2012 11:23:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TnSYV-0001ob-65; Tue, 25 Dec 2012 11:20:19 +0000 Received: from mail-pb0-f54.google.com ([209.85.160.54]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TnSY2-0001ka-QF for linux-arm-kernel@lists.infradead.org; Tue, 25 Dec 2012 11:19:55 +0000 Received: by mail-pb0-f54.google.com with SMTP id wz12so4386884pbc.41 for ; Tue, 25 Dec 2012 03:19:49 -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=/gjx/56jRz15V/ORE75CtBaLwf5wYHZzFucSCfAy2f4=; b=dRuCZ5SwQ9RVnWPUHj2eB6za0rBUgkDlSAaAt/i3q/zNjs3bAnxCmT3zMSuPphvv50 6OFM+DF3nvyz72kx+8nuM21+J4xJovMPcMk8HZ3AhJj9FL8FUCNr/fOAtM0BpSehBg04 VmVPb/0Qb6E3Podt/jrPkPyVP94avrOcMOSKJ8uRxgM+ymOOaDndCv5xI8/D+i/5C68s rK1ZU7G287oyhDfDLAj6IJmJTuP+OpShTbE6zCrCW9qdp8Fxc2cgSTQhtHEdUKx1CKdk wC+anz/VwkXoDHGdbKCiygQyuzkYFS3FJPRwryfhdooF5h945QxPTRx8RJrdZz5AHyg4 GJxA== X-Received: by 10.68.130.226 with SMTP id oh2mr33867468pbb.157.1356434389275; Tue, 25 Dec 2012 03:19:49 -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.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 03:19:48 -0800 (PST) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King , Simon Horman , Laurent Pinchart Subject: [PATCH v5 2/4] ARM: mach-shmobile: sh7372: Add IPMMU device Date: Tue, 25 Dec 2012 20:19:13 +0900 Message-Id: <1356434355-3279-3-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: ALoCoQkiwXqQkRXDwPNz3pHIPVq2RLLxa0eqMnrIWeBw7RG7jFrxBWSIVOrzLb3QJV+xEmuk7E+w X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121225_061951_075127_E26F6ACB X-CRM114-Status: GOOD ( 15.14 ) 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.54 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-sh7372.c | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index c917882..04ad98e 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -982,6 +983,43 @@ static struct platform_device spu1_device = { .num_resources = ARRAY_SIZE(spu1_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", + "uio_pdrv_genirq.0", + "uio_pdrv_genirq.1", + "uio_pdrv_genirq.2", + "uio_pdrv_genirq.3", + "uio_pdrv_genirq.4", + "uio_pdrv_genirq.5", +}; + +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 *sh7372_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -993,6 +1031,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = { &cmt2_device, &tmu00_device, &tmu01_device, + &ipmmu_device, }; static struct platform_device *sh7372_late_devices[] __initdata = {