From: Alex Kiernan <alex.kiernan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RESEND PATCH v2 1/2] Add BOOTCOUNT_BOOTLIMIT to set reboot limit
Date: Sat, 14 Jul 2018 07:59:43 +0000 [thread overview]
Message-ID: <20180714075944.6943-2-alex.kiernan@gmail.com> (raw)
In-Reply-To: <20180714075944.6943-1-alex.kiernan@gmail.com>
Add ability to set environment bootlimit from Kconfig
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
Changes in v2: None
drivers/bootcount/Kconfig | 8 ++++++++
include/env_default.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig
index d335ed14b9..9a0bd516d9 100644
--- a/drivers/bootcount/Kconfig
+++ b/drivers/bootcount/Kconfig
@@ -72,6 +72,14 @@ config BOOTCOUNT_AT91
endchoice
+config BOOTCOUNT_BOOTLIMIT
+ int "Maximum number of reboot cycles allowed"
+ default 0
+ help
+ Set the Maximum number of reboot cycles allowed without the boot
+ counter being cleared.
+ If set to 0 do not set a boot limit in the environment.
+
config BOOTCOUNT_ALEN
int "I2C address length"
default 1
diff --git a/include/env_default.h b/include/env_default.h
index 54d8124793..748076288e 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -104,6 +104,9 @@ const uchar default_environment[] = {
"soc=" CONFIG_SYS_SOC "\0"
#endif
#endif
+#if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
+ "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
+#endif
#ifdef CONFIG_EXTRA_ENV_SETTINGS
CONFIG_EXTRA_ENV_SETTINGS
#endif
--
2.17.1
next prev parent reply other threads:[~2018-07-14 7:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-14 7:59 [U-Boot] [RESEND PATCH v2 0/2] Add bootlimit to Kconfig Alex Kiernan
2018-07-14 7:59 ` Alex Kiernan [this message]
2018-07-15 9:36 ` [U-Boot] [RESEND PATCH v2 1/2] Add BOOTCOUNT_BOOTLIMIT to set reboot limit Prabhakar Kushwaha
2018-07-15 15:47 ` Alex Kiernan
2018-07-14 7:59 ` [U-Boot] [RESEND PATCH v2 2/2] Migrate bootlimit to Kconfig Alex Kiernan
2018-07-18 21:08 ` Lukasz Majewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180714075944.6943-2-alex.kiernan@gmail.com \
--to=alex.kiernan@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox