[PATCH 4/8] of/base.c: export property access/modification functions

Grant Likely grant.likely at secretlab.ca
Sat Jul 17 07:43:39 EST 2010


On Fri, Jul 16, 2010 at 2:07 PM, Stephen Neuendorffer
<stephen.neuendorffer at xilinx.com> wrote:
>
>
>> -----Original Message-----
>> From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of Grant Likely
>> Sent: Friday, July 16, 2010 11:57 AM
>> To: Stephen Neuendorffer
>> Cc: devicetree-discuss at lists.ozlabs.org
>> Subject: Re: [PATCH 4/8] of/base.c: export property access/modification functions
>>
>> On Fri, Jul 16, 2010 at 12:38 PM, Stephen Neuendorffer
>> <stephen.neuendorffer at xilinx.com> wrote:
>> >
>> >
>> >> -----Original Message-----
>> >> From: glikely at secretlab.ca [mailto:glikely at secretlab.ca] On Behalf Of
>> > Grant Likely
>> >> Sent: Friday, July 16, 2010 11:34 AM
>> >> To: Stephen Neuendorffer
>> >> Cc: devicetree-discuss at lists.ozlabs.org
>> >> Subject: Re: [PATCH 4/8] of/base.c: export property
>> > access/modification functions
>> >>
>> >> On Fri, Jul 16, 2010 at 12:13 PM, Stephen Neuendorffer
>> >> <stephen.neuendorffer at xilinx.com> wrote:
>> >> > These functions can be usefully used by device drivers.
>> >>
>> >> I'd like a little more description of the intended use case.  What are
>> >> the circumstances where a driver needs to modify the data (this
>> >> information should be part of the patch description)?
>> >
>> > The PCIPR driver code needs to stuff the ranges property using these
>> > calls...
>>
>> I'd rather change the translation code to give you an intermediary
>> value (an offset from a bar), and then use non-OF code to translate
>> that into a physical address.
>
> I don't see how that will work, since there is no callback from the device-tree
> code behind platform_get_resource/of_address_to_resource back into the pcipr driver to
> do the last translation bit.  I considered having a new 'bus_type' registered in the
> address translation code that would take care of it, but it seemed to still require
> the information from somewhere and it wasn't clear where to get it.

You get the information from the PCI device instance.  We can change
the bus_type infrastructure to allow instance specific data if need
be.

Alternately, the translation could be done at device registration
time.  With the changes being made to the of code, of_devices are
going away, and being replaced with normal platform_devices which have
a resource structure.  We could do the translation at device
registration time so that drivers only need to look at the resource
structure.  This will require some changes to the current
of_platform_drivers, but in the long run I think it is the right thing
to do.

g.


More information about the devicetree-discuss mailing list