Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 308B9C11F66 for ; Thu, 1 Jul 2021 00:08:32 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD5E661447 for ; Thu, 1 Jul 2021 00:08:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD5E661447 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D22A4831FC; Thu, 1 Jul 2021 02:08:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2DD8E831D7; Thu, 1 Jul 2021 02:07:55 +0200 (CEST) Received: from finn.localdomain (finn.gateworks.com [108.161.129.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BD35582DBA for ; Thu, 1 Jul 2021 02:07:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gateworks.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tharvey@gateworks.com Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1lykF8-004PyK-J0; Thu, 01 Jul 2021 00:07:46 +0000 From: Tim Harvey To: Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" , u-boot@lists.denx.de Cc: Tim Harvey Subject: [PATCH 4/5] board: gateworks: venice: add ftd_file env vars on boot Date: Wed, 30 Jun 2021 17:07:41 -0700 Message-Id: <20210701000742.6522-4-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210701000742.6522-1-tharvey@gateworks.com> References: <20210701000742.6522-1-tharvey@gateworks.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean The ftd_file* vars can be used by bootscripts to look for appropriate dtb's Signed-off-by: Tim Harvey --- board/gateworks/venice/imx8mm_venice.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/board/gateworks/venice/imx8mm_venice.c b/board/gateworks/venice/imx8mm_venice.c index cb00f532bf..2657bd675f 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); -- 2.17.1