fit: Add overlay support

This patch adds support to boot FIT image configurations consisting of
a base device tree and one or more overlays. Since extracting the right
compatible string from overlay FDTs is problematic, we'll only support
this for FIT images that have the compatible string pulled out into the
config node.

This patch was adapted from depthcharge's http://crosreview.com/1555293

Change-Id: I0943f9a1869c9e416887c7ff16e33f7d91b74989
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/32873
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Julius Werner
2019-05-16 16:12:04 -07:00
committed by Patrick Georgi
parent fec4206299
commit 21b0b1adec
3 changed files with 55 additions and 5 deletions

View File

@ -206,6 +206,15 @@ void fit_payload(struct prog *payload)
return;
}
struct fit_overlay_chain *chain;
list_for_each(chain, config->overlays, list_node) {
struct device_tree *overlay = unpack_fdt(chain->overlay);
if (!overlay || dt_apply_overlay(dt, overlay)) {
printk(BIOS_ERR, "ERROR: Failed to apply overlay %s!\n",
chain->overlay->name);
}
}
dt_apply_fixups(dt);
/* Insert coreboot specific information */