Attention is currently required from: Tim Wawrzynczak. Arthur Heymans has uploaded a new patch set (#2) to the change originally created by Nico Huber. ( https://review.coreboot.org/c/coreboot/+/41956 )
Change subject: device: Introduce v4.6 resource allocator ......................................................................
device: Introduce v4.6 resource allocator
This is not a complete rewrite, more an adaptation of the v4 allocator. For the moment, I suggest this for experiments, until we have a better understanding what we require from the resource allocator.
It differs mostly in pass 2. Instead of searching memranges for every bridge, we only do that for the top level and finish the calculations of pass 1 at the bridge level. And we don't handle above-4G resources separately. This implies that we need a top-down allocation at the top level to place things above 4G, which will be added in a later commit.
Detailed list of functional differences in v4.5 --------------------------------------------
Pass 1: * Completely ignore resources with 0 limit. * Don't propagate above-4G flag. Propagation makes it harder to effectively opt-out from 4G, e.g. for boot graphics / network devices. OTOH, this way resources can only be placed above 4G if all resources downstream of a bridge allow it. * Store the calculated `base` offset in the resources (like v3 did). This allows us to skip the largest_resource() walk at the bridge level in pass 2.
Pass 2: * No separate handling for above-4G resources. They'll need a top-down mode. * No memranges at the bridge-level. Instead we simply add the offset that was pre-calculated in pass 1 to the allocated `base` of the bridge resource. This lowers the computational complexity of pass 2. But there's likely no measurable impact for our usual, shallow device trees.
Beside that, there is some heavy refactoring: All the resource printing is factored out into separate functions. This results in one-liners in the actual program code which hopefully will distract less during reading. Some thin functions are manually inlined where it seems to improve readability, and comments are adapted and re-flown to 72 columns (counting from indentation level).
V4.6 ----
* Allow for multiple domain resources.
TEST=Works fine on OCP deltalake using multiple domains
Change-Id: I1c27e89916e6e915d4dfe5435fac53fef768bf37 Signed-off-by: Nico Huber nico.h@gmx.de Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/device/Kconfig M src/device/Makefile.inc A src/device/resource_allocator_v4.5.c M src/northbridge/amd/agesa/family14/Kconfig M src/northbridge/amd/agesa/family15tn/Kconfig M src/northbridge/amd/agesa/family16kb/Kconfig M src/northbridge/amd/pi/00730F01/Kconfig 7 files changed, 589 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/41956/2