From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 1/7] ARM: mm: Introduce archdata.dma_pfn_offset Date: Fri, 28 Feb 2014 10:30:48 +0100 Message-ID: <6612551.WqU0SU4pc9@wuerfel> References: <1393535872-20915-1-git-send-email-santosh.shilimkar@ti.com> <1393535872-20915-2-git-send-email-santosh.shilimkar@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <1393535872-20915-2-git-send-email-santosh.shilimkar-l0cyMroinI0@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Santosh Shilimkar , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Grygorii Strashko , Russell King , linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Olof Johansson , robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org On Thursday 27 February 2014 16:17:46 Santosh Shilimkar wrote: > From: Grygorii Strashko > > In most of cases DMA addresses can be performed using offset value of > Bus address space relatively to physical address space as following: > > PFN->DMA: > __pfn_to_phys(pfn + [-]dma_pfn_offset) > > DMA->PFN: > __phys_to_pfn(dma_addr) + [-]dma_pfn_offset > > This patch introduces new field dma_pfn_offset in ARM dev_archdata > structure which has to be filed per-device at arch init time > (simplest way is to use Platform bus notifier to handle > BUS_NOTIFY_ADD_DEVICE event) and updates DMA address translation > routines in order to accommodate bus offset value by default. > > Cc: Russell King > Cc: Arnd Bergmann > Cc: Olof Johansson > Signed-off-by: Grygorii Strashko > Signed-off-by: Santosh Shilimkar This was my suggestion, and the implementation is trivial, so Acked-by: Arnd Bergmann This should be most of what LinusW needs to generalize the mach-integrator PCI DMA mapping. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 28 Feb 2014 10:30:48 +0100 Subject: [PATCH v2 1/7] ARM: mm: Introduce archdata.dma_pfn_offset In-Reply-To: <1393535872-20915-2-git-send-email-santosh.shilimkar@ti.com> References: <1393535872-20915-1-git-send-email-santosh.shilimkar@ti.com> <1393535872-20915-2-git-send-email-santosh.shilimkar@ti.com> Message-ID: <6612551.WqU0SU4pc9@wuerfel> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thursday 27 February 2014 16:17:46 Santosh Shilimkar wrote: > From: Grygorii Strashko > > In most of cases DMA addresses can be performed using offset value of > Bus address space relatively to physical address space as following: > > PFN->DMA: > __pfn_to_phys(pfn + [-]dma_pfn_offset) > > DMA->PFN: > __phys_to_pfn(dma_addr) + [-]dma_pfn_offset > > This patch introduces new field dma_pfn_offset in ARM dev_archdata > structure which has to be filed per-device at arch init time > (simplest way is to use Platform bus notifier to handle > BUS_NOTIFY_ADD_DEVICE event) and updates DMA address translation > routines in order to accommodate bus offset value by default. > > Cc: Russell King > Cc: Arnd Bergmann > Cc: Olof Johansson > Signed-off-by: Grygorii Strashko > Signed-off-by: Santosh Shilimkar This was my suggestion, and the implementation is trivial, so Acked-by: Arnd Bergmann This should be most of what LinusW needs to generalize the mach-integrator PCI DMA mapping.