Index: device/device.c
===================================================================
--- device/device.c	(revision 961)
+++ device/device.c	(working copy)
@@ -271,7 +271,7 @@
  *
  * @param bus Bus to read the resources on.
  */
-static void read_resources(struct bus *bus)
+void read_resources(struct bus *bus)
 {
 	struct device *curdev;
 
@@ -913,6 +913,38 @@
 	root->ops->phase4_read_resources(root);
 	printk(BIOS_INFO, "Phase 4: Done reading resources.\n");
 
+	/* we have read the resources. We now compute the global allocation of resources. 
+	 * We have to create a root resource for the base of the tree. The root resource should contain the entire
+	 * address space for IO and MEM resources. The allocation of device resources will be done from this
+	 * resource address space. 
+	 */
+
+	/* Allocate a resource from the root device resource pool and initialize the system wide I/O space constraints. */
+	io = new_resource(root, 0);
+	io->base = 0x400;
+	io->size = 0;
+	io->align = 0;
+	io->gran = 0;
+	io->limit = 0xffffUL;
+	io->flags = IORESOURCE_IO;
+
+	/* Allocate a resource from the root device resource pool and initialize the system wide 
+	 * memory resources constraints.
+	 */
+	mem = new_resource(root, 1);
+	mem->base = 0;
+	mem->size = 0;
+	mem->align = 0;
+	mem->gran = 0;
+	mem->limit = 0xffffffffUL;
+	mem->flags = IORESOURCE_MEM;
+
+	compute_allocate_resource(&root->link[0], io,
+				  IORESOURCE_IO, IORESOURCE_IO);
+
+	compute_allocate_resource(&root->link[0], mem,
+				  IORESOURCE_MEM, IORESOURCE_MEM);
+
 	/* Get the resources. */
 	io = &root->resource[0];
 	mem = &root->resource[1];
@@ -999,3 +1031,43 @@
 		       dev->have_resources);
 	}
 }
+
+void show_one_resource(struct device *dev, struct resource *resource,
+			    const char *comment)
+{
+	char buf[10];
+	unsigned long long base, end;
+	base = resource->base;
+	end = resource_end(resource);
+	buf[0] = '\0';
+	if (resource->flags & IORESOURCE_PCI_BRIDGE) {
+#if PCI_BUS_SEGN_BITS
+		sprintf(buf, "bus %04x:%02x ", dev->bus->secondary >> 8,
+			dev->link[0].secondary & 0xff);
+#else
+		sprintf(buf, "bus %02x ", dev->link[0].secondary);
+#endif
+	}
+	printk(BIOS_DEBUG, "%s %02lx <- [0x%010llx - 0x%010llx] "
+		"size 0x%08Lx gran 0x%02x %s%s%s\n",
+		dev_path(dev), resource->index, base, end,
+		resource->size, resource->gran, buf,
+		resource_type(resource), comment);
+
+}
+
+void show_all_devs_resources(void)
+{
+	struct device *dev;
+
+	printk(BIOS_INFO, "Show all devs...\n");
+	for (dev = all_devices; dev; dev = dev->next) {
+		int i;
+		printk(BIOS_SPEW,
+		       "%s(%s): enabled %d have_resources %d\n",
+		       dev->dtsname, dev_path(dev), dev->enabled,
+		       dev->have_resources);
+		for(i = 0; i < dev->resources; i++)
+			show_one_resource(dev, &dev->resource[i], "");
+	}
+}
Index: device/root_device.c
===================================================================
--- device/root_device.c	(revision 961)
+++ device/root_device.c	(working copy)
@@ -35,29 +35,13 @@
  */
 void root_dev_read_resources(struct device *root)
 {
-	struct resource *resource;
+	void read_resources(struct bus *bus);
+	void show_all_devs_resources(void);
 
-	/* Initialize the system wide I/O space constraints. */
-	resource = new_resource(root, 0);
-	resource->base = 0x400;
-	resource->size = 0;
-	resource->align = 0;
-	resource->gran = 0;
-	resource->limit = 0xffffUL;
-	resource->flags = IORESOURCE_IO;
-	compute_allocate_resource(&root->link[0], resource,
-				  IORESOURCE_IO, IORESOURCE_IO);
+	read_resources(&root->link[0]);
 
-	/* Initialize the system wide memory resources constraints. */
-	resource = new_resource(root, 1);
-	resource->base = 0;
-	resource->size = 0;
-	resource->align = 0;
-	resource->gran = 0;
-	resource->limit = 0xffffffffUL;
-	resource->flags = IORESOURCE_MEM;
-	compute_allocate_resource(&root->link[0], resource,
-				  IORESOURCE_MEM, IORESOURCE_MEM);
+	printk(BIOS_DEBUG, "%s: Done allocating\n", __FUNCTION__);
+	show_all_devs_resources();
 }
 
 /**
@@ -71,11 +55,13 @@
 	struct bus *bus;
 
 	bus = &root->link[0];
+
 	compute_allocate_resource(bus,
 				  &root->resource[0], IORESOURCE_IO,
 				  IORESOURCE_IO);
 	compute_allocate_resource(bus, &root->resource[1], IORESOURCE_MEM,
 				  IORESOURCE_MEM);
+
 	phase4_assign_resources(bus);
 }
 
