From patchwork Thu Oct 3 15:26:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Mahringer X-Patchwork-Id: 1171255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=tmweb.at Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tmweb.at header.i=@tmweb.at header.b="qa+8PQFP"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46kcZd53Ysz9sPJ for ; Fri, 4 Oct 2019 01:37:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5CA09C21EAE; Thu, 3 Oct 2019 15:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7889AC21D9A; Thu, 3 Oct 2019 15:37:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 19CC5C21D9A; Thu, 3 Oct 2019 15:26:06 +0000 (UTC) Received: from mail.tmweb.at (mail.tmweb.at [116.203.147.39]) by lists.denx.de (Postfix) with ESMTPS id C4CF4C21C38 for ; Thu, 3 Oct 2019 15:26:05 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mail.tmweb.at (Postfix) with ESMTPA id EE256119B00 for ; Thu, 3 Oct 2019 15:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tmweb.at; s=dkim; t=1570116365; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=Ith2wv9MX2o7v42uOoC6JLRhx3sxsJOuL+VHsSadubM=; b=qa+8PQFPWSzVQaGp1Ik9TZ5H7ipUwzO6oXaMrdRZy0S9kamrL9bBjPpK3bcPPhDQwwAdDQ IbP1H6XEVaEyWzuxAIiok7THNDWWbzAEXT5x7ZpLD7kBGiihHeMFsZDfmmwnifYWNX2dfM kt18zzOGtlKjr1gK4IcBlGaDqI7zCdA= To: u-boot@lists.denx.de From: Thomas Mahringer Message-ID: <6763c4bf-8103-1a66-2e16-ca98d7217fe3@tmweb.at> Date: Thu, 3 Oct 2019 17:26:03 +0200 MIME-Version: 1.0 Content-Language: en-US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=tmweb.at; s=dkim; t=1570116365; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=Ith2wv9MX2o7v42uOoC6JLRhx3sxsJOuL+VHsSadubM=; b=pReXQzLlAHxr4GWs8NGugUlKDBzf+Lmev/CWKntaXizfk3QFe57Vgjjd8jttaZXPo6rcSz OTakCFldowGxU51twiNYM+IkfDNyurfTwzbDLlzPPJYQCpQ8uIiJ6gPYqUyZKJ3U+7HSSC nis/mrXW27Vbz7rTvThJ6vgGIePo1U4= ARC-Seal: i=1; s=dkim; d=tmweb.at; t=1570116365; a=rsa-sha256; cv=none; b=apBc1H2r604GX4Ca8Ky8YoVtBKoEUZgJrEF+7RUyjry2KqMH/1foMkiRChXTWmA8gev1IPcQVMKlLPv1kiv6hF4AdttCluC//HGzrtiEqF3wcw/QXGvuIRxdkCI/V6562A0iM/qHNiWQJUv9QhY4vx0fbTtDhWe9KFAINa8hL38= ARC-Authentication-Results: i=1; mail.tmweb.at; auth=pass smtp.auth=tmahring@tmweb.at smtp.mailfrom=tmahring@tmweb.at Authentication-Results: mail.tmweb.at; auth=pass smtp.auth=tmahring@tmweb.at smtp.mailfrom=tmahring@tmweb.at X-Spamd-Bar: / X-Mailman-Approved-At: Thu, 03 Oct 2019 15:37:14 +0000 Subject: [U-Boot] Bootcount on raspberry pi 0 w X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Hello We are using yocto + swupdate and u-boot do deliver software updates for our hardware which is based on a raspberry pi zero w. So far everything seems to be working, however I would like to use u-boot's bootcount feature to switch back to the previous version in case an upgrade fails to run. I have tried enabling bootcount with this patch to the config: CONFIG_MMC_SDHCI_BCM2835=y However, every time i boot the system bootcount is set to 1 root@raspberrypi0-wifi:~# fw_printenv | grep count bootcount=1 Even if I manually increase bootcount via fw_setenv it gets reset to 1 after i reboot. I don't really know where to go from here, could anyone maybe point me in the right direction? best regards Thomas Mahringer diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig index 39da54c3e7..5e5afe0dd6 100644 --- a/configs/rpi_0_w_defconfig +++ b/configs/rpi_0_w_defconfig @@ -20,6 +20,12 @@ CONFIG_ENV_FAT_INTERFACE="mmc" CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_DM_KEYBOARD=y +CONFIG_BOOTDELAY=-2 +CONFIG_BOOTCOUNT=y +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y +CONFIG_BOOTCOUNT_BOOTLIMIT=3 +CONFIG_EXTRA_ENV_SETTINGS="altbootcmd=if test $rpipart -eq 2; then setenv rpipart 3; else; setenv rpipart 2; fi; saveenv;boot\0" CONFIG_DM_MMC=y CONFIG_MMC_SDHCI=y