From patchwork Sat Feb 10 10:20:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 871657 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=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zdp0R4LKdz9s7v for ; Sat, 10 Feb 2018 21:22:47 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3D286C21E3A; Sat, 10 Feb 2018 10:22:08 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 381C2C21EA7; Sat, 10 Feb 2018 10:21:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 30569C21EB4; Sat, 10 Feb 2018 10:21:01 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id 44C36C21E65 for ; Sat, 10 Feb 2018 10:20:57 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zdnyK0W6qz1qtxt; Sat, 10 Feb 2018 11:20:56 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zdnyJ6Z1qz1qqkQ; Sat, 10 Feb 2018 11:20:56 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 8xN5S8qclpsC; Sat, 10 Feb 2018 11:20:55 +0100 (CET) X-Auth-Info: ekrowKavZPZRzUViHefRh10c7NK21I7FXFhQNFm0ViA= Received: from localhost.localdomain (89-64-1-240.dynamic.chello.pl [89.64.1.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 10 Feb 2018 11:20:55 +0100 (CET) From: Lukasz Majewski To: u-boot@lists.denx.de Date: Sat, 10 Feb 2018 11:20:32 +0100 Message-Id: <20180210102032.315-6-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180210102032.315-1-lukma@denx.de> References: <20180210102032.315-1-lukma@denx.de> Cc: Marek Vasut , Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH v1 5/5] arm: display5: Extend SPL to support bootcount checking 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 patch is necessary for providing basic bootcount checking in the case of using "falcon" boot mode. It forces u-boot proper boot, when we exceed the number of errors. Signed-off-by: Lukasz Majewski --- board/liebherr/display5/spl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index 0a36e656c0..e21b4bee75 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(); } @@ -242,6 +243,7 @@ int spl_start_uboot(void) if (env_get_yesno("boot_os") != 1) return 1; #endif + bootcount_inc(); return 0; } #endif