From patchwork Mon Jan 21 10:54:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hideki EIRAKU X-Patchwork-Id: 2010831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 95D18DF23A for ; Mon, 21 Jan 2013 10:58:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TxF37-00077q-QO; Mon, 21 Jan 2013 10:56:21 +0000 Received: from mail-pb0-f45.google.com ([209.85.160.45]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TxF2c-00072M-N8 for linux-arm-kernel@lists.infradead.org; Mon, 21 Jan 2013 10:55:54 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc8so3256294pbc.18 for ; Mon, 21 Jan 2013 02:54:45 -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=exoAqQa6T3ny7Gr2nDmfxovx42iZsm2L+9vfTIPPBroF1UewVElXPo3TAVElsxZA5u 7PVBgfRsF6MtODooTFLJib+9JTA8cN+AciDSaMtckor0rAqr+pASomTiXVWk0baOv/LY /eYZJ9BmM4hfupV7iCqIQsiVOrB3ExHJ7Tk3jZ4NSDingCKRERUfwnUBeb4oUqfsuKdT SHVdpcqTk3CBHzwhQMZudrz8T0sRLfp6nGrKl9qs/x4uJKqaRALYw83SyIkQnDd6xsg/ yGyznbt/nb8vTxiJbHFrXtgPC75tnAbl7gE9U5C8A0hF8PKraCjYJE4QOlRL3iRCQJkq ssag== X-Received: by 10.66.81.68 with SMTP id y4mr46025701pax.66.1358765685600; Mon, 21 Jan 2013 02:54:45 -0800 (PST) Received: from tyrell.hq.igel.co.jp ([219.106.231.132]) by mx.google.com with ESMTPS id na7sm8496575pbc.48.2013.01.21.02.54.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 21 Jan 2013 02:54:45 -0800 (PST) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King , Simon Horman , Laurent Pinchart Subject: [PATCH v6 2/4] ARM: mach-shmobile: sh7372: Add IPMMU device Date: Mon, 21 Jan 2013 19:54:27 +0900 Message-Id: <1358765669-14567-3-git-send-email-hdk@igel.co.jp> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1358765669-14567-1-git-send-email-hdk@igel.co.jp> References: <1358765669-14567-1-git-send-email-hdk@igel.co.jp> X-Gm-Message-State: ALoCoQmYj1xKDZVllQ5198dnbyAvj+fCJr+pFdEE3qy/gCVSxFq0Og6AxHHC+Sf1m0k+HygvvSkq X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130121_055550_821394_21F377F9 X-CRM114-Status: GOOD ( 15.32 ) 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.45 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 = {