From patchwork Wed Jul 14 14:37:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1505253 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eIw3X7W5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GQ0VM6MlHz9sXb for ; Thu, 15 Jul 2021 00:38:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DF67982000; Wed, 14 Jul 2021 16:38:05 +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="eIw3X7W5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A18B981FC6; Wed, 14 Jul 2021 16:37:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 240FD81F74 for ; Wed, 14 Jul 2021 16:37:53 +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: by mail.kernel.org (Postfix) with ESMTPSA id 6E644613C0; Wed, 14 Jul 2021 14:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626273470; bh=FccFS8zSG+YSZSKJyGToo4K2tjfUGVMrevT3mn3lUj4=; h=From:To:Cc:Subject:Date:From; b=eIw3X7W5PS2IO8o1km9LqECU7BNSGuYWjjMkwXRupCp0nEfwaFPxuyBGhq+5vs3ZM EaclInTivr0F9dD+TbnZT5F7QbClEkfEo1N8SsqK2kRc5pGyqW9Tdtg1R36wEf+xg0 A+Y8t8+TqiqJj4lvcBtipHQQSWZzyATsXXi5SWxSvfRJFJUfgqMv4ZS/GU1fYAXCAx BZXeW8lmAcrb0FS28LUw/KkW7RtHrkw0WRr4wzau4NPasWHQtj/ROi3MdhyAVvwKQp 1vyepTiJO6OXARI4fXKhQmXyV8CJyOtQS6wDM0AJCq8kXfSPQ3XQqxg3Jx+CDg4T74 yuBv9Z017kv6Q== Received: by pali.im (Postfix) id A8FE8723; Wed, 14 Jul 2021 16:37:47 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Stefan Roese , Andre Heider , =?utf-8?q?G=C3=A9rald_Kerma?= , Konstantin Porotchkin , Baruch Siach , Fabio Estevam , Peng Fan Cc: u-boot@lists.denx.de Subject: [PATCH 1/3] arm: mvebu: Espressobin: Fix setting $fdtfile env Date: Wed, 14 Jul 2021 16:37:27 +0200 Message-Id: <20210714143729.2396-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 Ensure that 'env default -a' always set correct value to $fdtfile, even when custom user variable is already stored in non-volatile env storage (means that env_get("fdtfile") call returns non-NULL value). As default value is now correctly set like if specified at compile time in CONFIG_EXTRA_ENV_SETTINGS, there is no need to set $fdtfile explicitly via env_set("fdtfile", ...) call. So remove wrong skip based on env_get("fdtfile") and then also unneeded env_set("fdtfile", ...) call. Fixes: c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable") Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- board/Marvell/mvebu_armada-37xx/board.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 6a0e2fc3cd8f..53408d37af9b 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -133,9 +133,6 @@ int board_late_init(void) device_unbind(dev); } - if (env_get("fdtfile")) - return 0; - /* Ensure that 'env default -a' set correct value to $fdtfile */ if (ddr4 && emmc) strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin-v7-emmc.dtb"); @@ -146,10 +143,6 @@ int board_late_init(void) else strcpy(ptr, "fdtfile=marvell/armada-3720-espressobin.dtb"); - /* If $fdtfile was not set explicitly by user then set default value */ - if (!env_get("fdtfile")) - env_set("fdtfile", ptr + sizeof("fdtfile=")); - return 0; } #endif