From patchwork Wed Oct 20 08:35:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 268101 X-Patchwork-Delegate: hiroshi.doyu@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9K8a0Ki031847 for ; Wed, 20 Oct 2010 08:36:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159Ab0JTIfy (ORCPT ); Wed, 20 Oct 2010 04:35:54 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:37844 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592Ab0JTIfv (ORCPT ); Wed, 20 Oct 2010 04:35:51 -0400 Received: by fxm4 with SMTP id 4so2466042fxm.19 for ; Wed, 20 Oct 2010 01:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=M2yAOkMhVHN99NKxjo+Il54OkmdWPRgysHnwhwWcOgQ=; b=SQ/z3F9lJAJsKKbn+kuzJHi/RC77UEkRyndQBY/DbKK+tl9HiBNCYFZOQDceE86tIn YNe8MW/ds1yr0Z79wN/L53UHpw6mohttRtyH/SVNx6KKiP1RuVAnZwUQS63iYhm0/UYo ZfsQVm+kx/qdLBMKczRluZRIJBwylF7ezzStE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=LYc/t12bHAoMBtUDpvbM3pDA3GTgiIUEymMAlfF5NZvtz/1CS2IYugI6Z4AUA2K8v1 N/wDe4rwVCvMwzxnpfbSS4bj7fYjk/QYaV/P0CK3/D1CVeHcaLX56Wj6V3TUtRuAHrl8 31qTDbA1vwsEHsKpsT5xiGTrflYDD18qPXSMc= MIME-Version: 1.0 Received: by 10.239.135.205 with SMTP id e13mr764954hbe.185.1287563750139; Wed, 20 Oct 2010 01:35:50 -0700 (PDT) Received: by 10.239.185.14 with HTTP; Wed, 20 Oct 2010 01:35:50 -0700 (PDT) In-Reply-To: <1287542932-14206-5-git-send-email-x0095840@ti.com> References: <1287542932-14206-1-git-send-email-x0095840@ti.com> <1287542932-14206-2-git-send-email-x0095840@ti.com> <1287542932-14206-3-git-send-email-x0095840@ti.com> <1287542932-14206-4-git-send-email-x0095840@ti.com> <1287542932-14206-5-git-send-email-x0095840@ti.com> Date: Wed, 20 Oct 2010 11:35:50 +0300 Message-ID: Subject: Re: [PATCHv4 4/4] iommu: create new api to set valid da range From: "felipe.contreras@gmail.com" To: Fernando Guzman Lugo Cc: Hiroshi.DOYU@nokia.com, felipe.contreras@nokia.com, david.cohen@nokia.com, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Oct 2010 08:36:00 +0000 (UTC) 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);