+/*
+ * This file is part of the coreboot project.
+ *
+ * It was originally based on the Linux kernel (arch/i386/kernel/pci-pc.c).
+ *
+ * Modifications are:
+ * Copyright (C) 2003 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (C) 2003-2004 Linux Networx
+ * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx)
+ * Copyright (C) 2003 Ronald G. Minnich <rminnich@gmail.com>
+ * Copyright (C) 2004-2005 Li-Ta Lo <ollie@lanl.gov>
+ * Copyright (C) 2005-2006 Tyan
+ * (Written by Yinghai Lu <yhlu@tyan.com> for Tyan)
+ * Copyright (C) 2005-2006 Stefan Reinauer <stepan@openbios.org>
+ */
+
/*
* (c) 1999--2000 Martin Mares <mj@suse.cz>
- * (c) 2003 Eric Biederman <ebiederm@xmission.com>
- * (c) 2003 Linux Networx
*/
/* lots of mods by ron minnich (rminnich@lanl.gov), with
* the final architecture guidance from Tom Merritt (tjm@codegen.com)
min_align = 0;
base = bridge->base;
- printk_spew("%s compute_allocate_%s: base: %08Lx size: %08Lx align: %d gran: %d\n",
+ printk_spew("%s compute_allocate_resource %s: base: %08Lx size: %08Lx align: %d gran: %d\n",
dev_path(bus->dev),
(bridge->flags & IORESOURCE_IO)? "io":
(bridge->flags & IORESOURCE_PREFETCH)? "prefmem" : "mem",
* return them. Some resources must be set even when they have
* no size. PCI bridge resources are a good example of this.
*/
- /* Propogate 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;
align = resource->align;
align = min_align;
}
+ /* Propagate the resource alignment to the bridge register */
+ if (align > bridge->align) {
+ bridge->align = align;
+ }
+
if (resource->flags & IORESOURCE_FIXED) {
continue;
}
if (bridge->limit > resource->limit) {
bridge->limit = resource->limit;
}
+#warning This heuristic should be replaced by real devices with fixed resources.
/* Artificially deny limits between DEVICE_MEM_HIGH and 0xffffffff */
if ((bridge->limit > DEVICE_MEM_HIGH) && (bridge->limit <= 0xffffffff)) {
bridge->limit = DEVICE_MEM_HIGH;
}
+
if (resource->flags & IORESOURCE_IO) {
/* Don't allow potential aliases over the
* legacy pci expansion card addresses.
resource->flags &= ~IORESOURCE_STORED;
base += size;
- printk_spew(
- "%s %02x * [0x%08Lx - 0x%08Lx] %s\n",
+ printk_spew("%s %02lx * [0x%08Lx - 0x%08Lx] %s\n",
dev_path(dev),
resource->index,
resource->base,
(resource->flags & IORESOURCE_IO)? "io":
(resource->flags & IORESOURCE_PREFETCH)? "prefmem": "mem");
}
+#if CONFIG_PCIE_CONFIGSPACE_HOLE
+#warning Handle PCIe hole differently...
+ if (base >= 0xf0000000 && base < 0xf4000000) {
+ base = 0xf4000000;
+ }
+#endif
}
/* A pci bridge resource does not need to be a power
* of two size, but it does have a minimum granularity.
*/
bridge->size = round(base, bridge->gran) - bridge->base;
- printk_spew("%s compute_allocate_%s: base: %08Lx size: %08Lx align: %d gran: %d done\n",
+ printk_spew("%s compute_allocate_resource %s: base: %08Lx size: %08Lx align: %d gran: %d done\n",
dev_path(bus->dev),
(bridge->flags & IORESOURCE_IO)? "io":
(bridge->flags & IORESOURCE_PREFETCH)? "prefmem" : "mem",
* relocated to their final position and stored to the hardware.
*
* I/O resources start at DEVICE_IO_START and grow upward. MEM resources start
- * at DEVICE_MEM_START and grow downward.
+ * at DEVICE_MEM_HIGH and grow downward.
*
* Since the assignment is hierarchical we set the values into the dev_root
* struct.