From: Hideki EIRAKU <hdk@igel.co.jp>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] ARM: mach-shmobile: sh7372: Add IPMMU device
Date: Mon, 15 Oct 2012 08:34:53 +0000 [thread overview]
Message-ID: <1350290093-998-3-git-send-email-hdk@igel.co.jp> (raw)
In-Reply-To: <1350290093-998-1-git-send-email-hdk@igel.co.jp>
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 <hdk@igel.co.jp>
---
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 790dc68..7006abb 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -61,6 +61,7 @@
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/sh7372.h>
+#include <mach/ipmmu.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -1459,6 +1460,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 0c27c81..1c34520 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -60,6 +60,7 @@
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/sh7372.h>
+#include <mach/ipmmu.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
@@ -1640,6 +1641,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_devices_to_domains(domain_devices,
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index a07954f..aadb769 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -38,6 +38,7 @@
#include <mach/irqs.h>
#include <mach/sh7372.h>
#include <mach/common.h>
+#include <mach/ipmmu.h>
#include <asm/mach/map.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -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 = {
@@ -1033,6 +1052,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));
--
1.7.0.4
next prev parent reply other threads:[~2012-10-15 8:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 8:34 [PATCH v4 0/2] Renesas IPMMU driver for sh7372 Hideki EIRAKU
2012-10-15 8:34 ` [PATCH v4 1/2] iommu/shmobile: Add iommu driver for Renesas IPMMU modules Hideki EIRAKU
2012-12-10 15:55 ` Laurent Pinchart
2012-12-11 10:10 ` Hideki EIRAKU
2012-12-11 12:36 ` Laurent Pinchart
2012-10-15 8:34 ` Hideki EIRAKU [this message]
2012-12-16 17:25 ` [PATCH/WIP/RFC 00/14] Renesas IPMMU driver work in progress Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 01/14] ARM: sh-mobile: Protect ipmmu.h header with ifndef/define Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 02/14] shmobile-iommu: Move IPMMU driver to drivers/iommu Laurent Pinchart
2012-12-17 3:10 ` Damian Hobson-Garcia
2012-12-17 8:45 ` Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 03/14] shmobile-iommu: Remove __devinit Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 04/14] shmobile-iommu: Use devm_* managed functions Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 05/14] ARM: iommu: Include linux/kref.h in asm/dma-iommu.h Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 06/14] shmobile-iommu: Sort header files alphabetically Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 07/14] shmobile-iommu: Move header file from arch/ to drivers/iommu/ Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 08/14] shmobile-iommu: Rename shmobile_iommu_priv to shmobile_iommu_domain Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 09/14] shmobile-ipmmu: Rename ipmmu_priv to shmobile_ipmmu Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 10/14] shmobile-ipmmu: Pass a struct shmobile_ipmmu to IPMMU functions Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 11/14] shmobile-ipmmu: Store a struct shmobile_iommu_arch_data in archdata.iommu Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 12/14] shmobile-ipmmu: Store ipmmu pointer in iommu arch data and iommu domain Laurent Pinchart
2012-12-16 17:25 ` [PATCH/WIP/RFC 13/14] shmobile-ipmmu: Remove unneeded lock_add spinlock Laurent Pinchart
2012-12-16 17:26 ` [PATCH/WIP/RFC 14/14] shmobile-ipmmu: Store iommu_mapping in struct shmobile_ipmmu Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350290093-998-3-git-send-email-hdk@igel.co.jp \
--to=hdk@igel.co.jp \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).