]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: tegra: board2: add common dtb reselect logic
authorSvyatoslav Ryhel <clamor95@gmail.com>
Sat, 3 Aug 2024 17:01:29 +0000 (20:01 +0300)
committerSvyatoslav Ryhel <clamor95@gmail.com>
Sun, 13 Oct 2024 14:20:26 +0000 (17:20 +0300)
Add common logic for dynamic dtb switch and DM reload if board
features multi-dtb support.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
arch/arm/mach-tegra/board2.c

index 5c5838629b27becf450a903e592ddc347b19423f..1704b021c5a9e87305227d8f573e7f441c99f7c6 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <config.h>
 #include <dm.h>
+#include <dm/root.h>
 #include <env.h>
 #include <errno.h>
 #include <init.h>
@@ -457,3 +458,18 @@ phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
 
        return CFG_SYS_SDRAM_BASE + usable_ram_size_below_4g();
 }
+
+#if IS_ENABLED(CONFIG_DTB_RESELECT)
+int embedded_dtb_select(void)
+{
+       int ret, rescan;
+
+       ret = fdtdec_resetup(&rescan);
+       if (!ret && rescan) {
+               dm_uninit();
+               dm_init_and_scan(true);
+       }
+
+       return 0;
+}
+#endif