- printk_info("Devices initialized\n");
- show_all_devs(BIOS_DEBUG, "After init.");
+}
+
+static void init_link(struct bus *link)
+{
+ struct device *dev;
+ struct bus *c_link;
+
+ for (dev = link->children; dev; dev = dev->sibling)
+ init_dev(dev);
+
+ for (dev = link->children; dev; dev = dev->sibling) {
+ for (c_link = dev->link_list; c_link; c_link = c_link->next)
+ init_link(c_link);
+ }
+}
+
+/**
+ * Initialize all devices in the global device tree.
+ *
+ * Starting at the root device, call the device's init() method to do
+ * device-specific setup, then call each child's init() method.
+ */
+void dev_initialize(void)
+{
+ struct bus *link;
+
+ printk(BIOS_INFO, "Initializing devices...\n");
+
+#if CONFIG_ARCH_X86
+ /* Ensure EBDA is prepared before Option ROMs. */
+ setup_default_ebda();
+#endif
+
+ /* First call the mainboard init. */
+ init_dev(&dev_root);
+
+ /* Now initialize everything. */
+ for (link = dev_root.link_list; link; link = link->next)
+ init_link(link);
+
+ printk(BIOS_INFO, "Devices initialized\n");
+ show_all_devs(BIOS_SPEW, "After init.");