From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 5/7] bootcount: spl: Extend SPL to support bootcount incrementation
Date: Wed, 2 May 2018 16:10:54 +0200 [thread overview]
Message-ID: <20180502141056.23937-6-lukma@denx.de> (raw)
In-Reply-To: <20180502141056.23937-1-lukma@denx.de>
This patch adds support for incrementation of the bootcount in SPL.
Such feature is necessary when we do want to use this feature with
'falcon' boot mode (which loads OS directly in SPL).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
Changes in v5:
- None
Changes in v4:
- Use gd_t global data pointer instead of bootcount specific enum
Changes in v3:
- Remove not needed #ifdefs
- Add enum bootcount_context parameter to bootcount_inc() function
Changes in v2:
- New patch - as suggested by Stefan Roese - bootcount_inc() is called
in common SPL code (./common/spl/spl.c), so other boards can also
reuse it without modification
common/spl/spl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 794dbd0312..6eb50f3534 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -20,6 +20,7 @@
#include <dm/root.h>
#include <linux/compiler.h>
#include <fdt_support.h>
+#include <bootcount.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -417,6 +418,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
spl_board_init();
#endif
+ bootcount_inc();
+
memset(&spl_image, '\0', sizeof(spl_image));
#ifdef CONFIG_SYS_SPL_ARGS_ADDR
spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
--
2.11.0
next prev parent reply other threads:[~2018-05-02 14:10 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 14:10 [U-Boot] [PATCH v5 0/7] Provide SPL support for bootcount (in the case of using falcon boot mode) Lukasz Majewski
2018-05-02 14:10 ` [U-Boot] [PATCH v5 1/7] bootcount: spl: Enable bootcount support in SPL Lukasz Majewski
2018-05-08 4:51 ` Alex Kiernan
2018-05-11 11:07 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-05-02 14:10 ` [U-Boot] [PATCH v5 2/7] bootcount: Add include guards into bootcount.h file Lukasz Majewski
2018-05-08 4:52 ` Alex Kiernan
2018-05-11 11:07 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-05-02 14:10 ` [U-Boot] [PATCH v5 3/7] bootcount: Add function wrappers to handle bootcount increment and error checking Lukasz Majewski
2018-05-08 5:15 ` Alex Kiernan
2018-05-08 6:58 ` Alex Kiernan
2018-05-08 7:11 ` Stefan Roese
2018-05-08 7:38 ` Lukasz Majewski
2018-05-08 8:45 ` Alex Kiernan
2018-05-08 7:41 ` Lukasz Majewski
2018-05-08 8:53 ` Alex Kiernan
2018-05-08 9:21 ` Lukasz Majewski
2018-05-08 9:28 ` Alex Kiernan
2018-05-08 10:27 ` Lukasz Majewski
2018-05-11 11:07 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-05-02 14:10 ` [U-Boot] [PATCH v5 4/7] bootcount: Rewrite autoboot to use wrapper functions from bootcount.h Lukasz Majewski
2018-05-08 5:23 ` Alex Kiernan
2018-05-11 11:08 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-05-02 14:10 ` Lukasz Majewski [this message]
2018-05-11 11:08 ` [U-Boot] [U-Boot, v5, 5/7] bootcount: spl: Extend SPL to support bootcount incrementation Tom Rini
2018-05-02 14:10 ` [U-Boot] [PATCH v5 6/7] bootcount: display5: spl: Extend DISPLAY5 board SPL to support bootcount checking Lukasz Majewski
2018-05-11 11:08 ` [U-Boot] [U-Boot, v5, " Tom Rini
2018-05-02 14:10 ` [U-Boot] [PATCH v5 7/7] bootcount: display5: config: Enable boot count feature in the display5 board Lukasz Majewski
2018-05-11 11:08 ` [U-Boot] [U-Boot, v5, " Tom Rini
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=20180502141056.23937-6-lukma@denx.de \
--to=lukma@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.