mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "felipe.contreras@gmail.com" <felipe.contreras@gmail.com>
To: Fernando Guzman Lugo <x0095840@ti.com>
Cc: Hiroshi.DOYU@nokia.com, felipe.contreras@nokia.com,
	david.cohen@nokia.com, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCHv4 4/4] iommu: create new api to set valid da range
Date: Wed, 20 Oct 2010 11:35:50 +0300	[thread overview]
Message-ID: <AANLkTimSQabHv3AOFFR4m3POjmuGvN18u7TNsPyauH8D@mail.gmail.com> (raw)
In-Reply-To: <1287542932-14206-5-git-send-email-x0095840@ti.com>

On Wed, Oct 20, 2010 at 5:48 AM, Fernando Guzman Lugo <x0095840@ti.com> wrote:
> Some IOMMUs cannot use the whole 0x0 - 0xFFFFFFFF range.
> With this new API the valid range can be set.
>
> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>

I don't see the point in having an API. It could be done through
platform data, and the usage of 0xFFFFF000 instead of ULONG_MAX is
independent of this.

diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index f5a1aad..db919254 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -43,6 +43,7 @@ static struct iommu_device omap3_devices[] = {
 			.name = "iva2",
 			.nr_tlb_entries = 32,
 			.clk_name = "iva2_ck",
+			.start_addr = 0x11000000,
 		},
 	},
 #endif
diff --git a/arch/arm/plat-omap/include/plat/iommu.h
b/arch/arm/plat-omap/include/plat/iommu.h
index 33c7d41..94f3a9a 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -50,6 +50,8 @@ struct iommu {
 	int (*isr)(struct iommu *obj);

 	void *ctx; /* iommu context: registres saved area */
+
+	u32		start_addr;
 };

 struct cr_regs {
@@ -103,6 +105,7 @@ struct iommu_platform_data {
 	const char *name;
 	const char *clk_name;
 	const int nr_tlb_entries;
+	u32 start_addr;
 };

 #if defined(CONFIG_ARCH_OMAP1)
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 6336ae2..3023d0b 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -926,6 +926,10 @@ static int __devinit omap_iommu_probe(struct
platform_device *pdev)
 	obj->name = pdata->name;
 	obj->dev = &pdev->dev;
 	obj->ctx = (void *)obj + sizeof(*obj);
+	obj->start_addr = pdata->start_addr;
+
+	if (!obj->start_addr)
+		obj->start_addr = PAGE_SIZE;

 	mutex_init(&obj->iommu_lock);
 	mutex_init(&obj->mmap_lock);
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index f318476..fd0c93f 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -284,7 +284,7 @@ static struct iovm_struct *alloc_iovm_area(struct
iommu *obj, u32 da,
 		/*
 		 * Reserve the first page for NULL
 		 */
-		start = PAGE_SIZE;
+		start = obj->start_addr;
 		if (flags & IOVMF_LINEAR)
 			alignement = iopgsz_max(bytes);
 		start = roundup(start, alignement);

-- 
Felipe Contreras

  reply	other threads:[~2010-10-20  8:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  2:48 [PATCHv4 0/4] iovmm: fixes for iovmm module Fernando Guzman Lugo
2010-10-20  2:48 ` [PATCHv4 1/4] iovmm: no gap checking for fixed address Fernando Guzman Lugo
2010-10-20  2:48   ` [PATCHv4 2/4] iovmm: add superpages support to fixed da address Fernando Guzman Lugo
2010-10-20  2:48     ` [PATCHv4 3/4] iovmm: replace __iounmap with omap_iounmap Fernando Guzman Lugo
2010-10-20  2:48       ` [PATCHv4 4/4] iommu: create new api to set valid da range Fernando Guzman Lugo
2010-10-20  8:35         ` felipe.contreras [this message]
2010-10-20  8:45           ` Hiroshi DOYU
2010-10-20  8:58             ` Felipe Contreras
2010-10-20  9:26               ` Hiroshi DOYU
2010-10-20 15:26                 ` Guzman Lugo, Fernando
2010-10-20 15:22           ` Guzman Lugo, Fernando
2010-10-20 16:26             ` Felipe Contreras
2010-10-22  9:59               ` Felipe Contreras
2010-10-22 16:23                 ` Guzman Lugo, Fernando

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=AANLkTimSQabHv3AOFFR4m3POjmuGvN18u7TNsPyauH8D@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=david.cohen@nokia.com \
    --cc=felipe.contreras@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=x0095840@ti.com \
    /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

all inboxes | Powered by JetHome®