From patchwork Wed Jul 25 06:29:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hideki EIRAKU X-Patchwork-Id: 1235751 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7E724DFFC0 for ; Wed, 25 Jul 2012 06:31:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932710Ab2GYGbm (ORCPT ); Wed, 25 Jul 2012 02:31:42 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:41003 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932843Ab2GYGaM (ORCPT ); Wed, 25 Jul 2012 02:30:12 -0400 Received: by gglu4 with SMTP id u4so348768ggl.19 for ; Tue, 24 Jul 2012 23:30:12 -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=vsS7vkzA2poSuEU3tH66cXPRyQcth+vBezj7OxWPhOk=; b=hIC5xCtBT4ggbaEQT1xou/TNChXU46LpcY3xlmqcDYGc3jPnGuN7UO5sqLR34RDRKD xpl71+vnCiq2KvGvtERwOqeW5ad/BA7tffIKxV43JIasUoGzLhEoo5LUdWPByBtAOry7 8gDCVV73OQ9NgTS3Up5iMFlnygx5NaIII1yxJ3mgPf1DMUUauHL2yqJwk3f+DiRzRJiK i/eogrtrOFs6va8uUVHQ8wDlfam533vbg4Eb6I8vwYAipiHDfk+bxlJeMh+UsFFYpBLb M5z1XqC3fegCJEkIErQiisy8xyMehqrvhzZ3KelBnjIpekC4mRcN3C+bLh5bMdTYojg/ a9KA== Received: by 10.66.83.69 with SMTP id o5mr10320329pay.34.1343197811755; Tue, 24 Jul 2012 23:30:11 -0700 (PDT) Received: from localhost.localdomain ([219.106.231.132]) by mx.google.com with ESMTPS id oo6sm13738701pbc.22.2012.07.24.23.30.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 23:30:11 -0700 (PDT) From: Hideki EIRAKU To: Paul Mundt , Magnus Damm , Russell King Cc: linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Katsuya MATSUBARA , Hideki EIRAKU Subject: [PATCH 2/2] ARM: mach-shmobile: sh7372: Add IPMMU device Date: Wed, 25 Jul 2012 15:29:02 +0900 Message-Id: <1343197742-13630-3-git-send-email-hdk@igel.co.jp> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1343197742-13630-1-git-send-email-hdk@igel.co.jp> References: <1343197742-13630-1-git-send-email-hdk@igel.co.jp> X-Gm-Message-State: ALoCoQnyvNloiNq7HemcTuk+ccLkPRqiVx39vxR/vQq1WpkgUD14teQaCTzn/N3acLdXUH2iOJbt Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.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/board-ap4evb.c | 5 +++++ arch/arm/mach-shmobile/board-mackerel.c | 5 +++++ arch/arm/mach-shmobile/setup-sh7372.c | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index ace6024..c35bb75 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -1434,6 +1435,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 150122a..1dc9f44 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -1612,6 +1613,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)); sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device); diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index fafce9c..5045638 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1005,6 +1006,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, @@ -1016,6 +1034,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 = { @@ -1057,6 +1076,9 @@ 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); + platform_add_devices(sh7372_late_devices, ARRAY_SIZE(sh7372_late_devices));