]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: gateworks: venice: add ftd_file env vars on boot
authorTim Harvey <tharvey@gateworks.com>
Thu, 1 Jul 2021 00:07:41 +0000 (17:07 -0700)
committerStefano Babic <sbabic@denx.de>
Sat, 10 Jul 2021 16:12:42 +0000 (18:12 +0200)
The ftd_file* vars can be used by bootscripts to look for
appropriate dtb's

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
board/gateworks/venice/imx8mm_venice.c

index cb00f532bf8adb2d019d75e5e401233123bf7971..2657bd675fd1dd8f0949d147f3e5c0f23b7a1d2b 100644 (file)
@@ -105,13 +105,26 @@ int board_init(void)
 
 int board_late_init(void)
 {
-       const char *ethmac;
+       const char *str;
        char env[32];
        int ret, i;
        u8 enetaddr[6];
+       char fdt[64];
 
        led_default_state();
 
+       /* Set fdt_file vars */
+       i = 0;
+       do {
+               str = gsc_get_dtb_name(i, fdt, sizeof(fdt));
+               if (str) {
+                       sprintf(env, "fdt_file%d", i + 1);
+                       strcat(fdt, ".dtb");
+                       env_set(env, fdt);
+               }
+               i++;
+       } while (str);
+
        /* Set mac addrs */
        i = 0;
        do {
@@ -119,8 +132,8 @@ int board_late_init(void)
                        sprintf(env, "eth%daddr", i);
                else
                        sprintf(env, "ethaddr");
-               ethmac = env_get(env);
-               if (!ethmac) {
+               str = env_get(env);
+               if (!str) {
                        ret = gsc_getmac(i, enetaddr);
                        if (!ret)
                                eth_env_set_enetaddr(env, enetaddr);