From patchwork Tue Dec 25 11:19:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hideki EIRAKU X-Patchwork-Id: 1909601 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 A85D9DF23A for ; Tue, 25 Dec 2012 11:23:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TnSYk-0001qi-G0; Tue, 25 Dec 2012 11:20:34 +0000 Received: from mail-pa0-f47.google.com ([209.85.220.47]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TnSY5-0001kt-6D for linux-arm-kernel@lists.infradead.org; Tue, 25 Dec 2012 11:19:58 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa10so4455101pad.34 for ; Tue, 25 Dec 2012 03:19:51 -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=JOyOGmLc5StTd2SA0la69NjA1nMfZqLXyN9eiTukMkk=; b=ZrgvkIcDi4fzgaVIwX1qLkzymveVAG+oKuliUn+xcgSQGvoeAkZoMLMg+NF08FMAd6 vYEpM8gJDXAUp9+Q4ZS0tMNkGHMBJpq2RncsOJIDV6FwzaW9cXgm5WUddkXS+Wffeh6p pYFcuhX6yQ+ycgXzbxR8bFql4bS1CdpsYozAdwzHYo8+fH6Q069Sl3eoKpiZFmlo3Eox k0BhbVhRQQGF86A7ye2BLWVVMIk6Z+bfxXyc7rTq42eVAz483h2pb1f3IK8+swyYbBxR DkfZw0M09U8zECqPm7iFrHchiSPXIQFfHhBt/PaGuA8PlglniC1MG7BmgTMU9coW90Ro 7W8w== X-Received: by 10.68.192.97 with SMTP id hf1mr75579837pbc.106.1356434391439; Tue, 25 Dec 2012 03:19:51 -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.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Dec 2012 03:19:51 -0800 (PST) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King , Simon Horman , Laurent Pinchart Subject: [PATCH v5 3/4] ARM: mach-shmobile: sh73a0: Add IPMMU device Date: Tue, 25 Dec 2012 20:19:14 +0900 Message-Id: <1356434355-3279-4-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: ALoCoQlcBht9Ld9cqulGs0c7aJSJ8SN2kVSWH4bZaFmtCscGOsIIF07PUY4DmFL6CpctfbPd5yOO X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121225_061953_442102_9D171646 X-CRM114-Status: GOOD ( 16.00 ) 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.220.47 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-sh73a0.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index db99a4a..36c2b2e 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -754,6 +755,35 @@ static struct platform_device pmu_device = { .resource = pmu_resources, }; +/* an IPMMU module for ICB */ +static struct resource ipmmu_resources[] = { + [0] = { + .name = "IPMMU", + .start = 0xfe951000, + .end = 0xfe9510ff, + .flags = IORESOURCE_MEM, + }, +}; + +static const char * const ipmmu_dev_names[] = { + "sh_mobile_lcdc_fb.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 *sh73a0_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -767,6 +797,7 @@ static struct platform_device *sh73a0_early_devices[] __initdata = { &cmt10_device, &tmu00_device, &tmu01_device, + &ipmmu_device, }; static struct platform_device *sh73a0_late_devices[] __initdata = {