From 7eac4450b32f6961d5abd8dae32c5eefc1a07c11 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Thu, 17 Jun 2010 16:16:56 +0000 Subject: Always enable parent resources before child resources. Always initialize parents before children. Move s2881 code into a driver. Signed-off-by: Myles Watson Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5633 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/devices/root_device.c | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) (limited to 'src/devices/root_device.c') diff --git a/src/devices/root_device.c b/src/devices/root_device.c index a77b5c8b62..cd576a15b6 100644 --- a/src/devices/root_device.c +++ b/src/devices/root_device.c @@ -32,7 +32,7 @@ * that encompass the resources for the entire system. * @param root Pointer to the device structure for the system root device */ -void root_dev_read_resources(device_t root) +static void root_dev_read_resources(device_t root) { printk(BIOS_ERR, "%s should never be called.\n", __func__); } @@ -44,7 +44,7 @@ void root_dev_read_resources(device_t root) * and every device under it which are all of the devices. * @param root Pointer to the device structure for the system root device */ -void root_dev_set_resources(device_t root) +static void root_dev_set_resources(device_t root) { printk(BIOS_ERR, "%s should never be called.\n", __func__); } @@ -115,33 +115,8 @@ unsigned int scan_static_bus(device_t bus, unsigned int max) return max; } -/** - * @brief Enable resources for children devices - * - * @param dev the device whos children's resources are to be enabled - * - * This function is called by the global enable_resource() indirectly via the - * device_operation::enable_resources() method of devices. - * - * Indirect mutual recursion: - * enable_childrens_resources() -> enable_resources() - * enable_resources() -> device_operation::enable_resources() - * device_operation::enable_resources() -> enable_children_resources() - */ -void enable_childrens_resources(device_t dev) -{ - struct bus *link; - for(link = dev->link_list; link; link = link->next) { - device_t child; - for(child = link->children; child; child = child->sibling) { - enable_resources(child); - } - } -} - -void root_dev_enable_resources(device_t dev) +static void root_dev_enable_resources(device_t dev) { - enable_childrens_resources(dev); } /** @@ -152,16 +127,16 @@ void root_dev_enable_resources(device_t dev) * * This function is the default scan_bus() method of the root device. */ -unsigned int root_dev_scan_bus(device_t root, unsigned int max) +static unsigned int root_dev_scan_bus(device_t root, unsigned int max) { return scan_static_bus(root, max); } -void root_dev_init(device_t root) +static void root_dev_init(device_t root) { } -void root_dev_reset(struct bus *bus) +static void root_dev_reset(struct bus *bus) { printk(BIOS_INFO, "Reseting board...\n"); hard_reset(); -- cgit v1.2.3