aboutsummaryrefslogtreecommitdiff
path: root/board/gateworks
diff options
context:
space:
mode:
authorTim Harvey2021-06-30 17:07:41 -0700
committerStefano Babic2021-07-10 18:12:42 +0200
commit0f3f6e62eaf6e6d309173c1dbe31b5d811cf08b4 (patch)
tree8329e04507e46de0a99318efc364bdc6eb198604 /board/gateworks
parent9d2e639f8ed606cfca1b1f862023c73122b5ec66 (diff)
board: gateworks: venice: add ftd_file env vars on boot
The ftd_file* vars can be used by bootscripts to look for appropriate dtb's Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'board/gateworks')
-rw-r--r--board/gateworks/venice/imx8mm_venice.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/board/gateworks/venice/imx8mm_venice.c b/board/gateworks/venice/imx8mm_venice.c
index cb00f532bf8..2657bd675fd 100644
--- a/board/gateworks/venice/imx8mm_venice.c
+++ b/board/gateworks/venice/imx8mm_venice.c
@@ -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);