diff options
-rw-r--r-- | src/config/Options.lb | 6 | ||||
-rw-r--r-- | src/devices/device.c | 6 | ||||
-rw-r--r-- | src/devices/pci_device.c | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/config/Options.lb b/src/config/Options.lb index 715a2b8ef9..8e9f89d49c 100644 --- a/src/config/Options.lb +++ b/src/config/Options.lb @@ -1115,6 +1115,12 @@ define CONFIG_GX1_VIDEOMODE # 4 for 1280x1024 end +define CONFIG_PCIE_CONFIGSPACE_HOLE + default 0 + export always + comment "Leave a hole for PCIe config space in the device allocator" +end + ############################################### # Board specific options ############################################### diff --git a/src/devices/device.c b/src/devices/device.c index e6fc99463d..804665968f 100644 --- a/src/devices/device.c +++ b/src/devices/device.c @@ -366,6 +366,12 @@ void compute_allocate_resource( (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. diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c index 7fb86933be..fcf9730981 100644 --- a/src/devices/pci_device.c +++ b/src/devices/pci_device.c @@ -377,7 +377,11 @@ static void pci_record_bridge_resource( * clear it and forget it. */ if (resource->size == 0) { +#if CONFIG_PCI_64BIT_PREF_MEM == 1 resource->base = moving; +#else + resource->base = moving & 0xffffffff; +#endif resource->flags |= IORESOURCE_ASSIGNED; resource->flags &= ~IORESOURCE_STORED; pci_set_resource(dev, resource); |