Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 799BEC433EF for ; Wed, 9 Feb 2022 09:38:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 74E4583E45; Wed, 9 Feb 2022 10:37:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mistralsolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=mistralsolutions.com header.i=@mistralsolutions.com header.b="RfF+1e4o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECB1E83DF0; Wed, 9 Feb 2022 10:37:30 +0100 (CET) Received: from egress-ip4b.ess.de.barracuda.com (egress-ip4b.ess.de.barracuda.com [18.185.115.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D5F6583DAA for ; Wed, 9 Feb 2022 10:37:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=mistralsolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sinthu.raja@mistralsolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx-outbound40-219.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 09 Feb 2022 09:37:20 +0000 Received: by mail-pl1-f198.google.com with SMTP id f9-20020a170902684900b0014cd6059ecdso1402052pln.7 for ; Wed, 09 Feb 2022 01:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mistralsolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4JBaei7TKvYlpxB7ga5L0UocOk6MMaS9VugVyNIp/rk=; b=RfF+1e4oDrobs0CAEW3opRdx9TCyPyV2EK9uYcga0ddZMabgs59eQt6+C9qRCKLCyi UaB30p/TFyQI2cztsLBhI8wnVJaWZ99o6G0Ti4+u3DEeoAAkB8I7+f+opTctqjlKzMq7 8Y1jjCwz1rLT00pEdim/pkgaVhZPPsWErPmAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4JBaei7TKvYlpxB7ga5L0UocOk6MMaS9VugVyNIp/rk=; b=sJHq0Tob6H37H9GWMqQEBYAvx/h4PdphdqleffxLgYGTnxU4VeR4YvTqVAaEHQT7i9 A7DMFKKhKdIqqjRERjnHNtB/erfVJwQJym0JQvLMt+EN7ow7kJihu+5po0uEtvBdZWPA 0tN0OIYPONouYYTRKKx/uLf7OboXiivTPgQl+G9E9iVaPNz4bKMXIOdlggrnY6QENgst LMScmA8GQBu7rZ/4DRmOIdzQmA8+BghS/ddRIx+ES2AOm7nvmdmt9ffrZ6fOTEzMhQ69 kWmSnrWlbBUimvNEDCsaT+LQudwFAuX4sF8NeUJF/9M1kOnKVvoDiwdiYnTbrtw+ixRQ d4WA== X-Gm-Message-State: AOAM5320v8f9wjv80Qa/lFpX+Zb925swXkuJshyfiSsAznfiDay0vln+ qyDRgKZoFRAu/pfVTT4SKrptnXlzwGrJAc6F1wBk1x20U2DVleqyiqY3KP35lxqhOf1SriRhNGT elfghc33w2aGQRgTN3uG7cFHWwNzHUcl8BxJK2IYrwio0bIAm+w== X-Received: by 2002:a17:903:2406:: with SMTP id e6mr1552981plo.98.1644399439253; Wed, 09 Feb 2022 01:37:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTbs1T4PBoZi7cezFF7pTjBavNBThL90kjXPyoa2MwQS1zDAA8qSMziPmkJ5uAdg3SJLZIqQ== X-Received: by 2002:a17:903:2406:: with SMTP id e6mr1552965plo.98.1644399438961; Wed, 09 Feb 2022 01:37:18 -0800 (PST) Received: from LAP568U.mistral.in ([106.51.69.35]) by smtp.gmail.com with ESMTPSA id g4sm18964255pfv.63.2022.02.09.01.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:37:18 -0800 (PST) From: Sinthu Raja X-Google-Original-From: Sinthu Raja To: u-boot@lists.denx.de Cc: Praneeth Bajjuri , Sinthu Raja Subject: [PATCH V3 03/16] board: ti: j721e: Guard functions with right #ifdef to avoid build warnings Date: Wed, 9 Feb 2022 15:06:48 +0530 Message-Id: <20220209093701.16693-4-sinthu.raja@ti.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220209093701.16693-1-sinthu.raja@ti.com> References: <20220209093701.16693-1-sinthu.raja@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BESS-ID: 1644399440-310459-5664-8234-1 X-BESS-VER: 2019.1_20220208.1721 X-BESS-Apparent-Source-IP: 209.85.214.198 X-BESS-Outbound-Spam-Score: 0.40 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.237841 [from cloudscan12-204.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.40 BSF_SC0_SA085b META: Custom Rule SA085b 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.40 using account:ESS91090 scores of KILL_LEVEL=7.0 tests=BSF_SC0_SA085b, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Sinthu Raja board_late_init(), setup_board_eeprom_env() and setup_serial() is called only under CONFIG_BOARD_LATE_INIT, so guard these functions with the same. Also, reorder these functions to place it under single #ifdef Signed-off-by: Sinthu Raja --- Changes in V3: * re-order the code so that everything is under a single #ifdef. V2: https://patchwork.ozlabs.org/project/uboot/patch/20211102140558.32460-5-sinthu.raja@ti.com/ board/ti/j721e/evm.c | 80 +++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 077d83420c..e924321557 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -172,45 +172,6 @@ int checkboard(void) return 0; } -static void setup_board_eeprom_env(void) -{ - char *name = "j721e"; - - if (do_board_detect()) - goto invalid_eeprom; - - if (board_is_j721e_som()) - name = "j721e"; - else if (board_is_j7200_som()) - name = "j7200"; - else - printf("Unidentified board claims %s in eeprom header\n", - board_ti_get_name()); - -invalid_eeprom: - set_board_info_env_am6(name); -} - -static void setup_serial(void) -{ - struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA; - unsigned long board_serial; - char *endp; - char serial_string[17] = { 0 }; - - if (env_get("serial#")) - return; - - board_serial = hextoul(ep->serial, &endp); - if (*endp != '\0') { - pr_err("Error: Can't set serial# to %s\n", ep->serial); - return; - } - - snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial); - env_set("serial#", serial_string); -} - /* * Declaration of daughtercards to probe. Note that when adding more * cards they should be grouped by the 'i2c_addr' field to allow for a @@ -413,6 +374,46 @@ void configure_serdes_torrent(void) printf("phy_power_on failed !!\n"); } +#ifdef CONFIG_BOARD_LATE_INIT +static void setup_board_eeprom_env(void) +{ + char *name = "j721e"; + + if (do_board_detect()) + goto invalid_eeprom; + + if (board_is_j721e_som()) + name = "j721e"; + else if (board_is_j7200_som()) + name = "j7200"; + else + printf("Unidentified board claims %s in eeprom header\n", + board_ti_get_name()); + +invalid_eeprom: + set_board_info_env_am6(name); +} + +static void setup_serial(void) +{ + struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA; + unsigned long board_serial; + char *endp; + char serial_string[17] = { 0 }; + + if (env_get("serial#")) + return; + + board_serial = hextoul(ep->serial, &endp); + if (*endp != '\0') { + pr_err("Error: Can't set serial# to %s\n", ep->serial); + return; + } + + snprintf(serial_string, sizeof(serial_string), "%016lx", board_serial); + env_set("serial#", serial_string); +} + int board_late_init(void) { if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) { @@ -428,6 +429,7 @@ int board_late_init(void) return 0; } +#endif void spl_board_init(void) { -- 2.35.0