diff options
author | Furquan Shaikh <furquan@google.com> | 2020-03-12 17:58:13 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-05-12 19:44:29 +0000 |
commit | dcbf6454b6d2d9b3627a14126ef20ed4b9c7d954 (patch) | |
tree | 8f44d0d15d14d90338525fca14fb1028bad9e151 /src/device | |
parent | 871baf2230dc1e0ed2becfd8526e00d5367618b3 (diff) |
pciexp_device: Add option to allocate prefetch memory above 4G boundary
This change adds a Kconfig option to request allocation of prefetch
memory for hotplug devices above the 4G boundary. In order to
select this option by default and still allow users to disable this if
required, another option is added to request allocation of prefetch
memory below 4G boundary which defaults to n but can be overriden
by mainboards.
Without this change, if the number of pciexp bridges supporting
hot-plug is more than 4 or if the reserved prefetch memory size for
hot-plug cases was increased, then the resource allocator would fail
to satisfy the resource requirement below 4G boundary.
BUG=b:149186922
TEST=Enabled resource allocation above 4G for prefetch memory on volteer
and verified that it gets allocated above 4G boundary.
Signed-off-by: Furquan Shaikh <furquan@google.com>
Change-Id: I061d935eef9fcda352230b03b5cf14e467924e50
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39489
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/device')
-rw-r--r-- | src/device/Kconfig | 15 | ||||
-rw-r--r-- | src/device/pciexp_device.c | 10 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/device/Kconfig b/src/device/Kconfig index 6096a38b6f..2976a61a8f 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -585,6 +585,21 @@ config PCIEXP_HOTPLUG_PREFETCH_MEM child devices. This size should be page-aligned. The default is 256 MiB. +config PCIEXP_HOTPLUG_PREFETCH_MEM_ABOVE_4G + bool + default y if !PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G + default n + help + This enables prefetch memory allocation above 4G boundary for the + hotplug resources. + +config PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G + bool "PCI Express Hotplug Prefetch Memory Allocation below 4G boundary" + default n + help + This enables prefetch memory allocation below 4G boundary for the + hotplug resources. + config PCIEXP_HOTPLUG_IO hex "PCI Express Hotplug I/O Space" default 0x2000 diff --git a/src/device/pciexp_device.c b/src/device/pciexp_device.c index 1189207539..f04d865152 100644 --- a/src/device/pciexp_device.c +++ b/src/device/pciexp_device.c @@ -512,7 +512,7 @@ static void pciexp_hotplug_dummy_read_resources(struct device *dev) { struct resource *resource; - // Add extra memory space + /* Add extra memory space */ resource = new_resource(dev, 0x10); resource->size = CONFIG_PCIEXP_HOTPLUG_MEM; resource->align = 12; @@ -520,7 +520,7 @@ static void pciexp_hotplug_dummy_read_resources(struct device *dev) resource->limit = 0xffffffff; resource->flags |= IORESOURCE_MEM; - // Add extra prefetchable memory space + /* Add extra prefetchable memory space */ resource = new_resource(dev, 0x14); resource->size = CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM; resource->align = 12; @@ -528,7 +528,11 @@ static void pciexp_hotplug_dummy_read_resources(struct device *dev) resource->limit = 0xffffffffffffffff; resource->flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH; - // Add extra I/O space + /* Set resource flag requesting allocation above 4G boundary. */ + if (CONFIG(PCIEXP_HOTPLUG_PREFETCH_MEM_ABOVE_4G)) + resource->flags |= IORESOURCE_ABOVE_4G; + + /* Add extra I/O space */ resource = new_resource(dev, 0x18); resource->size = CONFIG_PCIEXP_HOTPLUG_IO; resource->align = 12; |