summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2020-04-11 21:18:59 +0200
committerMarek Vasut <marek.vasut+renesas@gmail.com>2020-05-20 13:20:19 +0200
commit0e2afc8368b632ffb195d588ec2315ffbbf0a7e9 (patch)
tree4b6ba3c1918885df7072308b2436a180d2bd1caf /lib
parentc1bde2378a7673c992783b4c00729a52ba18e830 (diff)
fdtdec: Add weak function to patch U-Boot DT right after fdtdec_setup()
Add weak function which is called right after fdtdec_setup() configured the U-Boot DT. This permits board-specific adjustments to the U-Boot DT before U-Boot starts parsing the DT. This could be used e.g. to patch in various custom nodes or merge in DT fragments from prior-stage firmware. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 9c4d5713e1..1f2b763acc 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)