Attention is currently required from: Nico Huber, Tim Wawrzynczak. Arthur Heymans has uploaded a new patch set (#3) to the change originally created by Nico Huber. ( https://review.coreboot.org/c/coreboot/+/41956 )
Change subject: device: Introduce v4.5 resource allocator ......................................................................
device: Introduce v4.5 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 ---------------------------------------
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).
TEST=None, so far.
Change-Id: I1c27e89916e6e915d4dfe5435fac53fef768bf37 Signed-off-by: Nico Huber nico.h@gmx.de --- 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/00630F01/Kconfig M src/northbridge/amd/pi/00660F01/Kconfig M src/northbridge/amd/pi/00730F01/Kconfig 9 files changed, 599 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/41956/3