When a different FDT blob is chosen via fdtdec_resetup /
board_fit_config_name_match, update the fdtcontroladdr environment
variable accordingly. This fixes an issue where fdtcontroladdr would
still point to the previously used FDT blob.

Signed-off-by: Andreas Gnau <[email protected]>
---

 lib/fdtdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index b06559880296..e3534b647556 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1759,6 +1759,8 @@ int fdtdec_resetup(int *rescan)
 
                *rescan = 1;
                gd->fdt_blob = fdt_blob;
+               env_set_hex("fdtcontroladdr",
+                           (unsigned long)map_to_sysmem(gd->fdt_blob));
                return fdtdec_prepare_fdt(fdt_blob);
        }
 
-- 
2.47.0

Reply via email to