diff --git a/include/fdtdec.h b/include/fdtdec.h index 166f29c55bbeb36ac7fa0ea6edaee6a66df8df3c..abd6d42671949a104d5ac79432a89f8c012b1fb3 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -1155,6 +1155,11 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name, */ int fdtdec_setup(void); +/** + * Perform board-specific early DT adjustments + */ +int fdtdec_board_setup(const void *fdt_blob); + #if CONFIG_IS_ENABLED(MULTI_DTB_FIT) /** * fdtdec_resetup() - Set up the device tree again diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 9c4d5713e1d31c9a09b8d62f8ceadf771fbcf0ce..1f2b763acc312a27490a11ecc3a2dd42e3dfced3 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1474,8 +1474,14 @@ int fdtdec_set_carveout(void *blob, const char *node, const char *prop_name, return 0; } +__weak int fdtdec_board_setup(const void *fdt_blob) +{ + return 0; +} + int fdtdec_setup(void) { + int ret; #if CONFIG_IS_ENABLED(OF_CONTROL) # if CONFIG_IS_ENABLED(MULTI_DTB_FIT) void *fdt_blob; @@ -1528,7 +1534,10 @@ int fdtdec_setup(void) # endif #endif - return fdtdec_prepare_fdt(); + ret = fdtdec_prepare_fdt(); + if (!ret) + ret = fdtdec_board_setup(gd->fdt_blob); + return ret; } #if CONFIG_IS_ENABLED(MULTI_DTB_FIT)