From: Lukasz Majewski Date: Wed, 2 May 2018 16:10:55 +0200 Subject: [U-Boot] [PATCH v5 6/7] bootcount: display5: spl: Extend DISPLAY5 board SPL to support bootcount checking In-Reply-To: <20180502141056.23937-1-lukma@denx.de> References: <20180502141056.23937-1-lukma@denx.de> Message-ID: <20180502141056.23937-7-lukma@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch is necessary for providing basic bootcount checking in the case of using "falcon" boot mode in that board. It forces u-boot proper boot, when we exceed the number of errors. Signed-off-by: Lukasz Majewski Reviewed-by: Stefan Roese --- Changes in v5: - None Changes in v4: - Use global data pointer (gd) instead of bootcount specific enum (SPL) Changes in v3: - The bootcount_error now accepts enum bootcount_error input parameter Changes in v2: - Remove bootcount_init() from SPL specific board code board/liebherr/display5/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index 437963e225..7712e5bc3f 100644 --- a/board/liebherr/display5/spl.c +++ b/board/liebherr/display5/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "common.h" DECLARE_GLOBAL_DATA_PTR; @@ -214,7 +215,7 @@ void board_boot_order(u32 *spl_boot_list) env_load(); s = env_get("BOOT_FROM"); - if (s && strcmp(s, "ACTIVE") == 0) { + if (s && !bootcount_error() && strcmp(s, "ACTIVE") == 0) { spl_boot_list[0] = BOOT_DEVICE_MMC1; spl_boot_list[1] = spl_boot_device(); } -- 2.11.0