From patchwork Sun Feb 11 12:06:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 871758 X-Patchwork-Delegate: trini@ti.com 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nOtQ/d1J"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zfSLX0Kbmz9ryT for ; Sun, 11 Feb 2018 23:10:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2B3DDC21EE5; Sun, 11 Feb 2018 12:08:54 +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=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID 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 09030C21F2B; Sun, 11 Feb 2018 12:07:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9F651C21F44; Sun, 11 Feb 2018 12:07:26 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id 10089C21F1D for ; Sun, 11 Feb 2018 12:07:22 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id b21so5065937wme.4 for ; Sun, 11 Feb 2018 04:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1j4VdpzIc0iK4e61BGqsQx3m4kSOsVz4nCDJXX9mkSU=; b=nOtQ/d1JTkbxdLaWUiImn1k3JEUNeuZwzKscDEZ7NBlb80SD02JYeR4+0X6/ljHIQJ lQ8cLGSPaN//IKU4vmmiezPicCgFyiKUO0rWfKg0q3G8HWRzz+uxjzVNl0+nuJD1zF61 H4AU80kJQMLgNkL8i4zNLaKh1lfBwgWhJe2lcl7FISZyrGH/SuxwXe0TXGwL4cquud8B vJfqTUW2r/spfF3H9MyivGd6RLMxLFIjqjhDbi2hCqhynrqfR2VtRaLElfm2y+aE1Hcx RCOxj8s1e/dpOI3I0Z0fkmEBBzMWpsz/sK1nHb5teCTkx/CCkum0zmYBFDOLa5I1OsUi IIXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1j4VdpzIc0iK4e61BGqsQx3m4kSOsVz4nCDJXX9mkSU=; b=JncOyzy0kOPjkWMFKlBhsYvkxsafXOg413C6rNBuea0q2W4EmfOkRifO/M7xm+Fivq b/81E6B3XTZOOJDK2BeWrhwNUYvwRrYGNkASthzObr6OZbb6KRjJLfGheUipEBl/6cYD rmbdNTMpUNf+kB3/HvOMFJTNB2YV5dCD1loVs2qLFXnj3GMr4S0cJmnD3i3b2J02Kh/6 xigCRxkSGk/wjl4qpDNeS3QZ/yNuHrAbgJ+LCUp3YM7WbRP7QuWPMeMUkIFOXm3qFYqI 7CmHn1qZuOdvMw4K9qE07BdzfGJKewWaDhlxP3k4QeyPvrkyJDr/Pu/YwPAbiQMG4Vxn hUSw== X-Gm-Message-State: APf1xPBunWs8VMgbmiGMoBk/GFZdPR+x1p82vCQFysC0nZOXpuYvuGIw pp7tBJ64JbT0l1qFtBHBDNJbnQ0InH0= X-Google-Smtp-Source: AH8x227T5DeUiKT2NV/VPIXQgFhyzg8f23D4uYnxoQDR24ckx2bxOqhf+SDgmHz/z4gDqCq1B3tH1w== X-Received: by 10.28.111.28 with SMTP id k28mr1052879wmc.54.1518350841394; Sun, 11 Feb 2018 04:07:21 -0800 (PST) Received: from localhost.localdomain (cust246-dsl91-135-6.idnet.net. [91.135.6.246]) by smtp.gmail.com with ESMTPSA id k7sm8062459wrg.68.2018.02.11.04.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Feb 2018 04:07:20 -0800 (PST) From: Alex Kiernan To: u-boot@lists.denx.de Date: Sun, 11 Feb 2018 12:06:49 +0000 Message-Id: <1518350813-3418-5-git-send-email-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518350813-3418-1-git-send-email-alex.kiernan@gmail.com> References: <1518350813-3418-1-git-send-email-alex.kiernan@gmail.com> Cc: Thomas Petazzoni , Martyn Welch , Joe Hershberger , Chris Packham , Roger Meier , Maxime Ripard , Ian Ray , Marek Vasut Subject: [U-Boot] [PATCH 4/8] Convert CONFIG_BOOTCOUNT_ENV to Kconfig 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This converts the following to Kconfig: CONFIG_BOOTCOUNT_ENV Signed-off-by: Alex Kiernan Reviewed-by: Lukasz Majewski --- README | 11 ----------- configs/draco_defconfig | 1 + configs/etamin_defconfig | 1 + configs/pxm2_defconfig | 1 + configs/rastaban_defconfig | 1 + configs/rut_defconfig | 1 + configs/thuban_defconfig | 1 + drivers/bootcount/Kconfig | 12 ++++++++++++ include/configs/siemens-am33x-common.h | 2 -- scripts/config_whitelist.txt | 1 - 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README b/README index f51f670..0581b58 100644 --- a/README +++ b/README @@ -714,17 +714,6 @@ The following options need to be configured: RAM and NFS. - Bootcount: - CONFIG_BOOTCOUNT_ENV - If no softreset save registers are found on the hardware - "bootcount" is stored in the environment. To prevent a - saveenv on all reboots, the environment variable - "upgrade_available" is used. If "upgrade_available" is - 0, "bootcount" is always 0, if "upgrade_available" is - 1 "bootcount" is incremented in the environment. - So the Userspace Applikation must set the "upgrade_available" - and "bootcount" variable to 0, if a boot was successfully. - -- Pre-Boot Commands: CONFIG_PREBOOT When this option is #defined, the existence of the diff --git a/configs/draco_defconfig b/configs/draco_defconfig index 693d91c..0416daa 100644 --- a/configs/draco_defconfig +++ b/configs/draco_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig index e7a3d22..7d639ea 100644 --- a/configs/etamin_defconfig +++ b/configs/etamin_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig index 6063259..90783b4 100644 --- a/configs/pxm2_defconfig +++ b/configs/pxm2_defconfig @@ -55,6 +55,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig index ce6981e..c0947e9 100644 --- a/configs/rastaban_defconfig +++ b/configs/rastaban_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/rut_defconfig b/configs/rut_defconfig index b31eb97..685b4c8 100644 --- a/configs/rut_defconfig +++ b/configs/rut_defconfig @@ -56,6 +56,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig index 4a3c0cd..f5d1077 100644 --- a/configs/thuban_defconfig +++ b/configs/thuban_defconfig @@ -52,6 +52,7 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_ENV_IS_IN_NAND=y CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y CONFIG_DFU_NAND=y CONFIG_MMC_OMAP_HS=y CONFIG_NAND=y diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index e905295..40a0755 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -28,6 +28,18 @@ config BOOTCOUNT_AM33XX This requires the RTC clocks, etc, to be enabled prior to use and not all boards with this IP block on it will have the RTC in use. +config BOOTCOUNT_ENV + bool "Boot counter in environment" + help + If no softreset save registers are found on the hardware + "bootcount" is stored in the environment. To prevent a + saveenv on all reboots, the environment variable + "upgrade_available" is used. If "upgrade_available" is + 0, "bootcount" is always 0, if "upgrade_available" is + 1 "bootcount" is incremented in the environment. + So the Userspace Application must set the "upgrade_available" + and "bootcount" variable to 0, if a boot was successfully. + endchoice config SYS_BOOTCOUNT_SINGLEWORD diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index eb4b1f6..a7b427f 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -500,6 +500,4 @@ #define CONFIG_RESET_TO_RETRY #define CONFIG_BOOT_RETRY_TIME 60 -#define CONFIG_BOOTCOUNT_ENV - #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 46d9d5c..0fd4ad6 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -148,7 +148,6 @@ CONFIG_BOOGER CONFIG_BOOM CONFIG_BOOTBLOCK CONFIG_BOOTCOUNT_ALEN -CONFIG_BOOTCOUNT_ENV CONFIG_BOOTCOUNT_I2C CONFIG_BOOTCOUNT_LIMIT CONFIG_BOOTCOUNT_RAM