From mboxrd@z Thu Jan 1 00:00:00 1970 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 B3122C433F5 for ; Sat, 2 Apr 2022 22:26:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D83A283A65; Sun, 3 Apr 2022 00:25:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="tjOns2Yy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5720839E7; Sun, 3 Apr 2022 00:24:57 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 8466283931 for ; Sun, 3 Apr 2022 00:24:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 22932B80977; Sat, 2 Apr 2022 22:24:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0B0BC3410F; Sat, 2 Apr 2022 22:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648938285; bh=oGT99pWU9bpKI/WTEByf5SzddQLd01c6w6oGwzrRy2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tjOns2YyT5ET2Q7w7SWMfStvbGLDOi91WcnhvZ+2DOTRpFJZ7o+ajksT5RrECQ4mA EiFnNVDvv1IBJ0jNdEB5PHkasHotkYvtqqwykXHcmO4LvxEHMh77AoDWeGB90PBg4G nU/knClB+hVs96nfZHI9Eq952XUIfwiw0n1bHccScAHGL5VO22b70k1N4yYpIvNb65 hIhzIFc9S+22Z7G1gGXKStR19E16hkUk1S7r3nW11HPgws4X1aA9NQFejglmTzzcZz WafXrKeMPkG/WVbtTrzm3OUu8yNGJyq+TjDDPjwloNZujl3+61FJGw30lT/R0CgvpR 9EXzgzoE4wo5g== Received: by pali.im (Postfix) id 694FF819; Sun, 3 Apr 2022 00:24:45 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Priyanka Jain , Wolfgang Denk Cc: u-boot@lists.denx.de Subject: [PATCH 3/3] board: freescale: p1_p2_rdb_pc: Allow to compile it without env support Date: Sun, 3 Apr 2022 00:24:27 +0200 Message-Id: <20220402222427.19212-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220402222427.19212-1-pali@kernel.org> References: <20220402222427.19212-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 When env support is disabled then usage of env_init() or env_relocate() generates linker errors. So do not compile env_init() or env_relocate() in SPL code when env support is disabled in SPL. Signed-off-by: Pali Rohár --- board/freescale/p1_p2_rdb_pc/spl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c index f855f3a81c3d..22156f2824ec 100644 --- a/board/freescale/p1_p2_rdb_pc/spl.c +++ b/board/freescale/p1_p2_rdb_pc/spl.c @@ -83,12 +83,15 @@ void board_init_r(gd_t *gd, ulong dest_addr) CONFIG_SPL_RELOC_MALLOC_SIZE); gd->flags |= GD_FLG_FULL_MALLOC_INIT; +#ifdef CONFIG_SPL_ENV_SUPPORT #ifndef CONFIG_SPL_NAND_BOOT env_init(); #endif +#endif #ifdef CONFIG_SPL_MMC_BOOT mmc_initialize(bd); #endif +#ifdef CONFIG_SPL_ENV_SUPPORT /* relocate environment function pointers etc. */ #ifdef CONFIG_SPL_NAND_BOOT nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, @@ -98,6 +101,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #else env_relocate(); #endif +#endif #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) i2c_init_all(); -- 2.20.1