]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: rmobile: Enable board detection when FIT is enabled
authorAdam Ford <aford173@gmail.com>
Mon, 20 Sep 2021 16:14:27 +0000 (11:14 -0500)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Fri, 29 Oct 2021 19:51:54 +0000 (21:51 +0200)
There are three boards from Beacon, RZ/G2 M/N/H which all
use the same board file, but different device trees.
Add code to automatically select the proper device tree
based on the CPU type.

Signed-off-by: Adam Ford <aford173@gmail.com>
board/beacon/beacon-rzg2m/beacon-rzg2m.c

index c12ff77fb24472f7216ec8f58ebe5c00124f0116..b3521fcbc143c702b43f1dcf1989dd45377f3439 100644 (file)
@@ -36,3 +36,19 @@ void reset_cpu(void)
 {
        writel(RST_CODE, RST_CA57RESCNT);
 }
+
+#if IS_ENABLED(CONFIG_MULTI_DTB_FIT)
+int board_fit_config_name_match(const char *name)
+{
+       if (!strcmp(rzg_get_cpu_name(), "R8A774A1") && !strcmp(name, "r8a774a1-beacon-rzg2m-kit"))
+               return 0;
+
+       if (!strcmp(rzg_get_cpu_name(), "R8A774B1") && !strcmp(name, "r8a774b1-beacon-rzg2n-kit"))
+               return 0;
+
+       if (!strcmp(rzg_get_cpu_name(), "R8A774E1") && !strcmp(name, "r8a774e1-beacon-rzg2h-kit"))
+               return 0;
+
+       return -1;
+}
+#endif