properly align bridge resources.

Signed-off-by: Aaron Lwe <aaron.lwe@gmail.com>
Acked-by: Joseph Smith <joe@settoplinux.org>
Tested on v3 and 
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>

This patch also (accidently) includes 
a simple fix for the null pointer reference problem. I had forgotten that 
the fix was in there, but I will include it here and hope no one is too upset about 
its inclusion. 



git-svn-id: svn://coreboot.org/repository/coreboot-v3@669 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Ronald G. Minnich 2008-04-29 03:52:57 +00:00
commit b585710bc2

View file

@ -292,9 +292,10 @@ static void read_resources(struct bus *bus)
int i;
printk(BIOS_SPEW,
"%s: %s(%s) dtsname %s have_resources %d enabled %d\n",
__func__, bus->dev->dtsname, dev_path(bus->dev),
curdev->dtsname,
curdev->have_resources, curdev->enabled);
__func__, bus->dev? bus->dev->dtsname : "NOBUSDEV",
bus->dev ? dev_path(bus->dev) : "NOBUSDEV",
curdev->dtsname,
curdev->have_resources, curdev->enabled);
if (curdev->have_resources) {
continue;
}
@ -469,10 +470,6 @@ void compute_allocate_resource(struct bus *bus, struct resource *bridge,
* they have no size. PCI bridge resources are a good example
* of this.
*/
/* Propagate the resource alignment to the bridge register. */
if (resource->align > bridge->align) {
bridge->align = resource->align;
}
/* Make certain we are dealing with a good minimum size. */
size = resource->size;
@ -481,6 +478,11 @@ void compute_allocate_resource(struct bus *bus, struct resource *bridge,
align = min_align;
}
/* Propogate the resource alignment to the bridge register */
if (align > bridge->align) {
bridge->align = align;
}
if (resource->flags & IORESOURCE_FIXED) {
continue;
}