[coreboot] [PATCH] Simplify device enabling and initialization

Myles Watson mylesgw at gmail.com
Wed Jun 16 22:50:42 CEST 2010

If we initialize and enable devices in the order that they are found
in the tree, instead of the order that they were added to the list, it
simplifies the code.  It also makes it so that removing a device from
the devicetree.cb file won't change when its resources are enabled.

I had the devices initialize depth first, but changed it to breadth
first.  I think it makes more sense to have all the children of a
device initialized together.  I could be talked out of that.

This patch breaks the s2881, which was doing some odd acrobatics in
order to get a device initialized after its parent.  It should be an
easy fix to do it correctly now, but I don't have an s2881 to test on.

1. Remove global enable_resources(child) and calls to it from bridges
2. Make root_dev_* functions local to the root_device
3. Make ".init=init_func," consistent.  Some were using ".init=&init_func,"
4. Remove comments about indirect mutual recursion since it isn't anymore

Signed-off-by: Myles Watson <mylesgw at gmail.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: trees.diff
Type: text/x-patch
Size: 47452 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100616/d9e66c0a/attachment.diff>

More information about the coreboot mailing list