From patchwork Tue Sep 11 06:10: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: 1435491 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 7CDAB3FC33 for ; Tue, 11 Sep 2012 06:13: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 1TBJgY-0000aW-Rb; Tue, 11 Sep 2012 06:10:58 +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 1TBJgF-0000YD-86 for linux-arm-kernel@lists.infradead.org; Tue, 11 Sep 2012 06:10:40 +0000 Received: by pbbrq8 with SMTP id rq8so331421pbb.36 for ; Mon, 10 Sep 2012 23:10:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=a19Tr/e8KBPSKc9pP4gPbwVqrQWQ97lfZxNI+dZ05ZM=; b=CW5i6DJZBMynt828ydGPEnYn1VbbofB4ZLqbXJK0+/Tp5ux6rewTiBltQDYH9AoYh7 dqCCgO20Jd90qoBawAJFL2Df0IugBBaKEZiWgwGOSQ/G0kxwAoDKP13qJmdPTgE2YOue vMYNgFwbEeJXTXhYQXOu8yRzzxynVKmMtrat3nMyA9ed5n82DtbsB+cpkh+sGQHiojOx wn9TbupzOxWytyTkjoRGcJC549+JC2ooY68nqTkUKPahNPlLitsRp7ejotDZE314Pt3G TQkTelAW4X4BuiZTBzR9fAvPB2Xeu5lwsqURpZMF9Wge9YurfEtgTr3OnjGGnwIE+1SN sghA== Received: by 10.66.73.9 with SMTP id h9mr25261440pav.76.1347343838400; Mon, 10 Sep 2012 23:10:38 -0700 (PDT) Received: from localhost.localdomain ([219.106.231.132]) by mx.google.com with ESMTPS id lb1sm9261147pbc.47.2012.09.10.23.10.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Sep 2012 23:10:37 -0700 (PDT) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King , Simon Horman Subject: [PATCH v3 2/2] ARM: mach-shmobile: sh7372: Add IPMMU device Date: Tue, 11 Sep 2012 15:10:14 +0900 Message-Id: <1347343814-32299-3-git-send-email-hdk@igel.co.jp> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1347343814-32299-1-git-send-email-hdk@igel.co.jp> References: <1347343814-32299-1-git-send-email-hdk@igel.co.jp> X-Gm-Message-State: ALoCoQmqF4fbWHfPjasCMq0JSscDTI89AZFy4m1K2s2IhvtFWf6PYlB5uABQ6zgY7A2ZL+We5+T5 X-Spam-Note: CRM114 invocation failed 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, 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 Tested-by: Damian Hobson-Garcia --- arch/arm/mach-shmobile/board-ap4evb.c | 5 +++++ arch/arm/mach-shmobile/board-mackerel.c | 5 +++++ arch/arm/mach-shmobile/setup-sh7372.c | 26 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index f172ca8..ce6d796 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -1448,6 +1449,10 @@ static void __init ap4evb_init(void) sh7372_add_standard_devices(); + ipmmu_add_device(&lcdc_device.dev); + ipmmu_add_device(&lcdc1_device.dev); + ipmmu_add_device(&ceu_device.dev); + /* HDMI */ gpio_request(GPIO_FN_HDMI_HPD, NULL); gpio_request(GPIO_FN_HDMI_CEC, NULL); diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index c129542..8bc4faf 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -1622,6 +1623,10 @@ static void __init mackerel_init(void) sh7372_add_standard_devices(); + ipmmu_add_device(&lcdc_device.dev); + ipmmu_add_device(&hdmi_lcdc_device.dev); + ipmmu_add_device(&ceu_device.dev); + platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices)); rmobile_add_device_to_domain(&sh7372_pd_a4lc, &lcdc_device); diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 838a87b..399d26d 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -968,6 +969,23 @@ 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 struct platform_device ipmmu_device = { + .name = "ipmmu", + .id = -1, + .resource = ipmmu_resources, + .num_resources = ARRAY_SIZE(ipmmu_resources), +}; + static struct platform_device *sh7372_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -979,6 +997,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 = { @@ -1020,6 +1039,13 @@ void __init sh7372_add_standard_devices(void) platform_add_devices(sh7372_early_devices, ARRAY_SIZE(sh7372_early_devices)); + ipmmu_add_device(&vpu_device.dev); + ipmmu_add_device(&jpu_device.dev); + ipmmu_add_device(&veu0_device.dev); + ipmmu_add_device(&veu1_device.dev); + ipmmu_add_device(&veu2_device.dev); + ipmmu_add_device(&veu3_device.dev); + platform_add_devices(sh7372_late_devices, ARRAY_SIZE(sh7372_late_devices));