summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 56afefdc87..157f7b7443 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -888,6 +888,26 @@ void fixed_mem_resource(device_t dev, unsigned long index,
resource->flags |= type;
}
+void mmconf_resource_init(struct resource *resource, resource_t base,
+ int buses)
+{
+ resource->base = base;
+ resource->size = buses * MiB;
+ resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE |
+ IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
+
+ printk(BIOS_DEBUG, "Adding PCIe enhanced config space BAR "
+ "0x%08lx-0x%08lx.\n", (unsigned long)(resource->base),
+ (unsigned long)(resource->base + resource->size));
+}
+
+void mmconf_resource(struct device *dev, unsigned long index)
+{
+ struct resource *resource = new_resource(dev, index);
+ mmconf_resource_init(resource, CONFIG_MMCONF_BASE_ADDRESS,
+ CONFIG_MMCONF_BUS_NUMBER);
+}
+
void tolm_test(void *gp, struct device *dev, struct resource *new)
{
struct resource **best_p = gp;