[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/9] xen: arm: parse modules from DT during early boot.



On Mon, 2012-12-10 at 13:04 +0000, Stefano Stabellini wrote:

> > > You have really written a lot of code here!
> > > I would have thought that just matching on the compatible string would
> > > be enough:
> > > 
> > > else if ( device_tree_node_matches(fdt, node, "linux-zimage") )
> > >      process_linuxzimage_node(fdt, node, name, address_cells, size_cells);
> > > else if ( device_tree_node_matches(fdt, node, "linux-initrd") )
> > >      process_linuxinitrd_node(fdt, node, name, address_cells, size_cells);
> > > 
> > > so that your process_linuxzimage_node and process_linuxinitrd_node start
> > > from the right node and have everything they need to parse it
> > 
> > Is the tree structure of Device Tree meaningless? I'd have thought that
> > a compatible node would only have meaning at a particular place in the
> > tree. Granted compatible nodes are often pretty specific and precise,
> > but is that inherent enough in DT that we can rely on it?
> 
> I don't know if it is entirely meaningless, but surely the compatible
> string is regarded as a much more reliable way to identify a node AFAIK.
> More often than not Linux drivers just use of_find_compatible_node to
> find their DT node.

Hrm, that sounds rather odd to me.

Anyway, there isn't much code needed to do it right -- there's only ~ a
dozen lines to do with actually walking the tree. The rest (i.e. the
majority of this patch) is the internals of process_chosen_modules_node,
the docs and the data structure which would be pretty much the same
regardless of walking the tree. 

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.