diff options
author | Marek Vasut <marex@denx.de> | 2023-09-21 20:44:16 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2023-10-16 16:25:10 +0200 |
commit | b13eaf3bb4e64fff117210821b3cf2f106de8ae2 (patch) | |
tree | 36f4b6b42dcf96c9d2a9fbababb5929a2aadd6bb /common | |
parent | b0296e22cb48c26ffe5ceb09f35a2ac5975a299f (diff) | |
download | u-boot-b13eaf3bb4e64fff117210821b3cf2f106de8ae2.tar.gz u-boot-b13eaf3bb4e64fff117210821b3cf2f106de8ae2.tar.bz2 u-boot-b13eaf3bb4e64fff117210821b3cf2f106de8ae2.zip |
spl: fit: Add board level function to decide application of DTO
Add board-specific function used to indicate whether a DTO from fitImage
configuration node 'fdt' property DT and DTO list should be applied onto
the base DT or not applied.
This is useful in case of DTOs which implement e.g. different board revision
details, where such DTO should be applied on one board revision, and should
not be applied on another board revision.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/spl_fit.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index ce6b8aa370..1409b92637 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -372,6 +372,11 @@ static bool os_takes_devicetree(uint8_t os) } } +__weak int board_spl_fit_append_fdt_skip(const char *name) +{ + return 0; /* Do not skip */ +} + static int spl_fit_append_fdt(struct spl_image_info *spl_image, struct spl_load_info *info, ulong sector, const struct spl_fit_info *ctx) @@ -414,11 +419,23 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, void *tmpbuffer = NULL; for (; ; index++) { - node = spl_fit_get_image_node(ctx, FIT_FDT_PROP, index); - if (node == -E2BIG) { + const char *str; + + ret = spl_fit_get_image_name(ctx, FIT_FDT_PROP, index, &str); + if (ret == -E2BIG) { debug("%s: No additional FDT node\n", __func__); + ret = 0; break; - } else if (node < 0) { + } else if (ret < 0) { + continue; + } + + ret = board_spl_fit_append_fdt_skip(str); + if (ret) + continue; + + node = fdt_subnode_offset(ctx->fit, ctx->images_node, str); + if (node < 0) { debug("%s: unable to find FDT node %d\n", __func__, index); continue; |