Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-29 Thread Santosh Shilimkar
On Thursday 29 May 2014 03:24 PM, Arnd Bergmann wrote: > On Thursday 29 May 2014 10:08:10 Santosh Shilimkar wrote: >> On Thursday 29 May 2014 10:01 AM, Linus Walleij wrote: >>> On Wed, May 28, 2014 at 4:04 PM, Santosh Shilimkar >>> wrote: On Wednesday 28 May 2014 09:32 AM, Linus Walleij wrote

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-29 Thread Arnd Bergmann
On Thursday 29 May 2014 10:08:10 Santosh Shilimkar wrote: > On Thursday 29 May 2014 10:01 AM, Linus Walleij wrote: > > On Wed, May 28, 2014 at 4:04 PM, Santosh Shilimkar > > wrote: > >> On Wednesday 28 May 2014 09:32 AM, Linus Walleij wrote: > > > I suspect what you want is > >

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-29 Thread Santosh Shilimkar
On Thursday 29 May 2014 10:01 AM, Linus Walleij wrote: > On Wed, May 28, 2014 at 4:04 PM, Santosh Shilimkar > wrote: >> On Wednesday 28 May 2014 09:32 AM, Linus Walleij wrote: > I suspect what you want is dma-ranges = <0x8000 0 0x8000>; to translate dma_ad

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-29 Thread Linus Walleij
On Wed, May 28, 2014 at 4:04 PM, Santosh Shilimkar wrote: > On Wednesday 28 May 2014 09:32 AM, Linus Walleij wrote: >>> I suspect what you want is >>> >>> dma-ranges = <0x8000 0 0x8000>; >>> >>> to translate dma_addr_t 0x8000-0x to phys_addr_t 0x0-0x7fff >>> rather

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-28 Thread Santosh Shilimkar
On Wednesday 28 May 2014 09:32 AM, Linus Walleij wrote: > On Wed, May 28, 2014 at 3:29 PM, Arnd Bergmann wrote: >> On Wednesday 28 May 2014 10:23:09 Linus Walleij wrote: > >>> model = "ARM Integrator/AP"; >>> compatible = "arm,integrator-ap"; >>> + dma-ranges = <0x8000 0

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-28 Thread Linus Walleij
On Wed, May 28, 2014 at 3:29 PM, Arnd Bergmann wrote: > On Wednesday 28 May 2014 10:23:09 Linus Walleij wrote: >> model = "ARM Integrator/AP"; >> compatible = "arm,integrator-ap"; >> + dma-ranges = <0x8000 0x8 0x 0x8000>; >> >> aliases { >>

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-28 Thread Arnd Bergmann
On Wednesday 28 May 2014 10:23:09 Linus Walleij wrote: > diff --git a/arch/arm/boot/dts/integratorap.dts > b/arch/arm/boot/dts/integratorap.dts > index b10e6351da53..f0c397fd45c5 100644 > --- a/arch/arm/boot/dts/integratorap.dts > +++ b/arch/arm/boot/dts/integratorap.dts > @@ -8,6 +8,7 @@ > / { >

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-28 Thread Linus Walleij
On Tue, May 27, 2014 at 3:30 PM, Arnd Bergmann wrote: > On Tuesday 27 May 2014 13:56:55 Grant Likely wrote: >> Come to think of it, doesn't PCI DMA have to deal with that situation if >> the PCI window is not 1:1 mapped into the CPU address space? > > I think all PCI buses we support so far only

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-27 Thread Arnd Bergmann
On Tuesday 27 May 2014 13:56:55 Grant Likely wrote: > On Fri, 02 May 2014 11:58:30 +0200, Arnd Bergmann wrote: > > On Thursday 01 May 2014 14:12:10 Grant Likely wrote: > > > > > I've got two concerns here. of_dma_get_range() retrieves only the > > > > > first > > > > > tuple from the dma-ranges p

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-27 Thread Grant Likely
On Fri, 02 May 2014 11:58:30 +0200, Arnd Bergmann wrote: > On Thursday 01 May 2014 14:12:10 Grant Likely wrote: > > > > I've got two concerns here. of_dma_get_range() retrieves only the first > > > > tuple from the dma-ranges property, but it is perfectly valid for > > > > dma-ranges to contain mu

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-07 Thread Santosh Shilimkar
bit. Drivers are expected to setup > * the correct supported dma_mask. > */ > + dev->coherent_dma_mask = DMA_BIT_MASK(32); > + if (!dev->dma_mask) > + dev->dma_mask = &dev->coherent_dma_mask; > Updated patch below for records. >From 591c1e

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-06 Thread Santosh Shilimkar
On Tuesday 06 May 2014 05:40 AM, Arnd Bergmann wrote: > On Monday 05 May 2014 17:47:32 Santosh Shilimkar wrote: > >> + dev->coherent_dma_mask = DMA_BIT_MASK(32); >> + if (!dev->dma_mask) >> + dev->dma_mask = &dev->coherent_dma_mask; >> + >> + /* >> +* if dma

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-06 Thread Santosh Shilimkar
On Tuesday 06 May 2014 05:54 AM, Arnd Bergmann wrote: > On Tuesday 06 May 2014 13:44:38 Benjamin Herrenschmidt wrote: >> On Mon, 2014-05-05 at 16:28 -0600, Bjorn Helgaas wrote: >>> I still wonder whether arm, powerpc, and tile (and I just noticed >>> microblaze also has a similar dma_direct_map_pag

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-06 Thread Arnd Bergmann
On Tuesday 06 May 2014 13:44:38 Benjamin Herrenschmidt wrote: > On Mon, 2014-05-05 at 16:28 -0600, Bjorn Helgaas wrote: > > I still wonder whether arm, powerpc, and tile (and I just noticed > > microblaze also has a similar dma_direct_map_page()) could all be > > handled by attaching devices to a g

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-06 Thread Arnd Bergmann
On Monday 05 May 2014 17:47:32 Santosh Shilimkar wrote: > + dev->coherent_dma_mask = DMA_BIT_MASK(32); > + if (!dev->dma_mask) > + dev->dma_mask = &dev->coherent_dma_mask; > + > + /* > +* if dma-ranges property doesn't exist - just return else > +* s

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Benjamin Herrenschmidt
On Mon, 2014-05-05 at 16:28 -0600, Bjorn Helgaas wrote: > I still wonder whether arm, powerpc, and tile (and I just noticed > microblaze also has a similar dma_direct_map_page()) could all be > handled by attaching devices to a generic trivial IOMMU driver > parameterized with the appropriate const

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Bjorn Helgaas
On Mon, May 5, 2014 at 2:55 PM, Arnd Bergmann wrote: > On Monday 05 May 2014 14:45:21 Bjorn Helgaas wrote: >> [+cc Ben, Chris] >> >> On Fri, May 2, 2014 at 12:59 PM, Arnd Bergmann wrote: >> > On Friday 02 May 2014 10:54:59 Bjorn Helgaas wrote: >> >> > +static void of_dma_configure(struct device *

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Rob Herring
Mon Sep 17 00:00:00 2001 > From: Santosh Shilimkar > Date: Thu, 24 Apr 2014 11:30:04 -0400 > Subject: [PATCH v3 4/7] of: configure the platform device dma parameters > > Retrieve DMA configuration from DT and setup platform device's DMA > parameters. The DMA configuration in

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Santosh Shilimkar
gt; *of_platform_device_create_pdata( >> #if defined(CONFIG_MICROBLAZE) >> dev->archdata.dma_mask = 0xffffUL; >> #endif > > This is also dma related setup. Please move *all* dma setup into the function. > Updated patch with above minor updates. >Fro

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Arnd Bergmann
On Monday 05 May 2014 14:45:21 Bjorn Helgaas wrote: > [+cc Ben, Chris] > > On Fri, May 2, 2014 at 12:59 PM, Arnd Bergmann wrote: > > On Friday 02 May 2014 10:54:59 Bjorn Helgaas wrote: > >> > +static void of_dma_configure(struct device *dev) > >> > +{ > >> > + u64 dma_addr, paddr, size; > >>

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-05 Thread Bjorn Helgaas
[+cc Ben, Chris] On Fri, May 2, 2014 at 12:59 PM, Arnd Bergmann wrote: > On Friday 02 May 2014 10:54:59 Bjorn Helgaas wrote: >> > +static void of_dma_configure(struct device *dev) >> > +{ >> > + u64 dma_addr, paddr, size; >> > + int ret; >> > + >> > + dev->coherent_dma_mask = DMA_BIT_

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-02 Thread Arnd Bergmann
On Friday 02 May 2014 10:54:59 Bjorn Helgaas wrote: > > +static void of_dma_configure(struct device *dev) > > +{ > > + u64 dma_addr, paddr, size; > > + int ret; > > + > > + dev->coherent_dma_mask = DMA_BIT_MASK(32); > > + if (!dev->dma_mask) > > + dev->dma_mask = &dev->c

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-02 Thread Bjorn Helgaas
On Thu, Apr 24, 2014 at 11:30:04AM -0400, Santosh Shilimkar wrote: > Retrieve DMA configuration from DT and setup platform device's DMA > parameters. The DMA configuration in DT has to be specified using > "dma-ranges" and "dma-coherent" properties if supported. > > We setup dma_pfn_offset using "

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-02 Thread Arnd Bergmann
On Friday 02 May 2014 09:13:48 Santosh Shilimkar wrote: > On Friday 02 May 2014 05:58 AM, Arnd Bergmann wrote: > > On Thursday 01 May 2014 14:12:10 Grant Likely wrote: > I've got two concerns here. of_dma_get_range() retrieves only the first > tuple from the dma-ranges property, but it is

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-02 Thread Santosh Shilimkar
On Friday 02 May 2014 05:58 AM, Arnd Bergmann wrote: > On Thursday 01 May 2014 14:12:10 Grant Likely wrote: I've got two concerns here. of_dma_get_range() retrieves only the first tuple from the dma-ranges property, but it is perfectly valid for dma-ranges to contain multiple tuples.

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-02 Thread Arnd Bergmann
On Thursday 01 May 2014 14:12:10 Grant Likely wrote: > > > I've got two concerns here. of_dma_get_range() retrieves only the first > > > tuple from the dma-ranges property, but it is perfectly valid for > > > dma-ranges to contain multiple tuples. How should we handle it if a > > > device has multi

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-01 Thread Rob Herring
On Thu, Apr 24, 2014 at 10:30 AM, Santosh Shilimkar wrote: > Retrieve DMA configuration from DT and setup platform device's DMA > parameters. The DMA configuration in DT has to be specified using > "dma-ranges" and "dma-coherent" properties if supported. > > We setup dma_pfn_offset using "dma-rang

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-01 Thread Santosh Shilimkar
On Thursday 01 May 2014 09:12 AM, Grant Likely wrote: > On Wed, 30 Apr 2014 10:19:15 -0400, Santosh Shilimkar > wrote: >> Hi Grant, >> >> On Tuesday 29 April 2014 10:41 AM, Grant Likely wrote: >>> On Thu, 24 Apr 2014 11:30:04 -0400, Santosh Shilimkar >>> wrote: Retrieve DMA configuration f

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-05-01 Thread Grant Likely
On Wed, 30 Apr 2014 10:19:15 -0400, Santosh Shilimkar wrote: > Hi Grant, > > On Tuesday 29 April 2014 10:41 AM, Grant Likely wrote: > > On Thu, 24 Apr 2014 11:30:04 -0400, Santosh Shilimkar > > wrote: > >> Retrieve DMA configuration from DT and setup platform device's DMA > >> parameters. The

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-04-30 Thread Santosh Shilimkar
Hi Grant, On Tuesday 29 April 2014 10:41 AM, Grant Likely wrote: > On Thu, 24 Apr 2014 11:30:04 -0400, Santosh Shilimkar > wrote: >> Retrieve DMA configuration from DT and setup platform device's DMA >> parameters. The DMA configuration in DT has to be specified using >> "dma-ranges" and "dma-co

Re: [PATCH v3 4/7] of: configure the platform device dma parameters

2014-04-29 Thread Grant Likely
On Thu, 24 Apr 2014 11:30:04 -0400, Santosh Shilimkar wrote: > Retrieve DMA configuration from DT and setup platform device's DMA > parameters. The DMA configuration in DT has to be specified using > "dma-ranges" and "dma-coherent" properties if supported. > > We setup dma_pfn_offset using "dma-

[PATCH v3 4/7] of: configure the platform device dma parameters

2014-04-24 Thread Santosh Shilimkar
Retrieve DMA configuration from DT and setup platform device's DMA parameters. The DMA configuration in DT has to be specified using "dma-ranges" and "dma-coherent" properties if supported. We setup dma_pfn_offset using "dma-ranges" and dma_coherent_ops using "dma-coherent" device tree properties.