Device tree with early buffer allocations and aliased memory
David VomLehn
dvomlehn at cisco.com
Fri Nov 19 09:08:27 EST 2010
On Tue, Nov 09, 2010 at 10:25:37PM -0600, Grant Likely wrote:
> On Wed, Nov 03, 2010 at 01:50:37PM -0700, David VomLehn wrote:
> > This got eaten as junk mail, so pardon the slow response. Also, Stuart
...
> > On Sat, Oct 30, 2010 at 10:57:34PM -0500, Grant Likely wrote:
> > > On Wed, Oct 27, 2010 at 2:49 PM, David VomLehn <dvomlehn at cisco.com> wrote:
...
> > This still leaves the question of buffers. Buffers with statically and
> > dynamically assigned addresses need some sort of identifier so that
> > they can be referenced by device drivers. There may be more than one
> > buffer per device and a single device may use buffers with statically
> > assigned addresses and buffers with dynamically assigned addresses.
> > Buffers with statically assigned buffers addresses could be handled
> > with something like:
> >
> > device-s {
> > compatible = "cisco,device-s";
> > cisco,static-buffers =
> > "device-s-b1",<0x24000000 0x00100000>,
> > "device-s-b2",<0x60000000 0x00200000>;
>
> Or, simply:
> cisco,static-buffer-b1 = <0x24000000 0x00100000>;
> cisco,static-buffer-b2 = <0x60000000 0x00200000>;
>
> Try to avoid mixing string and cell values in the same property where
> appropriate. Sometimes doing so is the best binding, but those cases
> are rare.
I started implementing the 'cisco,static-buffer-b1' solution and it feels pretty awkward.
When I want to get the property value, I have to know not only the constant property
name but also a buffer name. The buffer name is really one of the pieces of data I
want to get. I can, of course, write code to scan the node and do a partial match on
the property name, but that doesn't feel like the rest of the DT API.
Not only does this have me doing odd things to property names, but I have a number of
devices. If I should want another buffer, I must create another property name.
This solution has me creating a bunch of property names, which all I really
want is two: "cisco,static-buffers" and "cisco,dynamic-buffers".
I think this is an occasion where it makes sense to mix string and cell values in the
same property.
> g.
--
David VL
More information about the devicetree-discuss
mailing list