aboutsummaryrefslogtreecommitdiff
path: root/src/device/Kconfig
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-05-23 19:15:36 +0200
committerMartin L Roth <gaumless@gmail.com>2022-09-04 16:41:58 +0000
commit117e436115484f0ce184114b22b716616592e77e (patch)
tree3edbf3bda0657edcc6c0223779c96ebfcf29d974 /src/device/Kconfig
parent577c6b9225515aeb32918881bfb5503c3fd71068 (diff)
allocator_v4: Treat above 4G resources more natively
We currently have two competing mechanisms to limit the placement of resources: 1. the explicit `.limit` field of a resource, and 2. the IORESOURCE_ABOVE_4G flag. This makes the resource allocator unnecessarily complex. Ideally, we would always reduce the `.limit` field if we want to "pin" a specific resource below 4G. However, as that's not done across the tree yet, we will use the _absence_ of the IORESOURCE_ABOVE_4G flag as a hint to implicitly lower the `limit` of a resource. In this patch, this is done inside the effective_limit() function that hides the flag from the rest of the allocator. To automatically place resources above 4G if their limit allows it, we have to allocate from top down. Hence, we disable the prompt for RESOURCE_ALLOCATION_TOP_DOWN if resources above 4G are requested. One implication of the changes is that we act differently when a cold-plugged device reports a prefetchable resource with 32-bit limit. Before this change, we would fail to allocate the resource. After this change, it forces everything on the same root port below the 4G line. A possible solution to get completely rid of the IORESOURCE_ABOVE_4G flag would be rules to place resources of certain devices below 4G. For instance, the primary VGA device and storage and HID devices could be made available to a payload that can only address 32 bits. For now, effective_limit() provides us enough abstraction as if the `limit` would be the only variable to consider. With this, we get rid of all the special handling of above 4G resources during phase 2 of the allocator. Which saves us about 20% of the code :D Change-Id: I4c7fcd1f5146f6cc287bd3aa5582da55bc5d6955 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65413 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/device/Kconfig')
-rw-r--r--src/device/Kconfig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/Kconfig b/src/device/Kconfig
index af9beb32f5..8d10c17f4e 100644
--- a/src/device/Kconfig
+++ b/src/device/Kconfig
@@ -934,7 +934,7 @@ config RESOURCE_ALLOCATOR_V4
above 4G boundary as well.
config RESOURCE_ALLOCATION_TOP_DOWN
- bool "Allocate resources from top down"
+ bool "Allocate resources from top down" if !PCIEXP_HOTPLUG_PREFETCH_MEM_ABOVE_4G
default y
depends on RESOURCE_ALLOCATOR_V4