From patchwork Tue Sep 15 11:37:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Pynkin X-Patchwork-Id: 1364245 X-Patchwork-Delegate: sbabic@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; dmarc=fail (p=none dis=none) header.from=collabora.com 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 4BrLpP6vZdz9sTN for ; Tue, 15 Sep 2020 21:38:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E58581281; Tue, 15 Sep 2020 13:38:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=collabora.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 D076D81BD2; Tue, 15 Sep 2020 13:38:28 +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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) (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 7203280404 for ; Tue, 15 Sep 2020 13:38:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=denis.pynkin@collabora.com Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: d4s) with ESMTPSA id 1029F28D5AF From: Denis Pynkin To: u-boot@lists.denx.de Cc: sbabic@denx.de, trini@konsulko.com, denis.pynkin@collabora.com Subject: [PATCH v2] mx6qsabrelite: increase the environment offset Date: Tue, 15 Sep 2020 14:37:14 +0300 Message-Id: <20200915113714.1174226-1-denis.pynkin@collabora.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: 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.102.3 at phobos.denx.de X-Virus-Status: Clean The size of the binary created with the default U-boot config is much greater than the default offset for environment `0x60000`. In case if that binary is used for booting via MMC it is overlapped with the environment stored on MMC. This leads to U-Boot corruption while saving environment with `saveenv` command and non-bootable SabreLite board. The offset for environment `CONFIG_ENV_OFFSET=0x60000` was added in commit a09fea1 but did not count in the change to `0xC0000` if option `CONFIG_ENV_IS_IN_MMC` is used. The offset is also used for variant with environment saving onto SPI NOR flash (with enabled option `CONFIG_ENV_IS_IN_SPI_FLASH`). In that case the U-Boot binary flashed on SPI NOR is also corrupted after environment saving with the original 0x60000 offset. Signed-off-by: Denis Pynkin Reviewed-by: Tom Rini --- configs/mx6qsabrelite_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig index 008fcfe04c..6e7193e411 100644 --- a/configs/mx6qsabrelite_defconfig +++ b/configs/mx6qsabrelite_defconfig @@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x17800000 CONFIG_SYS_MALLOC_F_LEN=0x4000 CONFIG_NR_DRAM_BANKS=1 CONFIG_ENV_SIZE=0x2000 -CONFIG_ENV_OFFSET=0x60000 +CONFIG_ENV_OFFSET=0xC0000 CONFIG_MX6Q=y CONFIG_TARGET_NITROGEN6X=y CONFIG_DM_GPIO=y