From patchwork Sat Feb 27 18:19:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 589433 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C168614029E for ; Sun, 28 Feb 2016 05:23:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9205B3803; Sat, 27 Feb 2016 19:21:36 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id afdJzhw4QWrZ; Sat, 27 Feb 2016 19:21:36 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8AB38A78D8; Sat, 27 Feb 2016 19:21:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64EB8A788E for ; Sat, 27 Feb 2016 19:21:13 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e_UmxvTTSXtQ for ; Sat, 27 Feb 2016 19:21:13 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gagarine.paulk.fr (gagarine.paulk.fr [109.190.93.129]) by theia.denx.de (Postfix) with ESMTPS id 8353DB37ED for ; Sat, 27 Feb 2016 19:21:06 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 65534) id 4896620339; Sat, 27 Feb 2016 19:21:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from armstrong.paulk.fr (armstrong.paulk.fr [82.233.88.171]) by gagarine.paulk.fr (Postfix) with ESMTPS id 0C1422042C; Sat, 27 Feb 2016 19:19:16 +0100 (CET) Received: from localhost.localdomain (aldrin [192.168.0.128]) by armstrong.paulk.fr (Postfix) with ESMTP id C37D3378F9; Sat, 27 Feb 2016 19:19:12 +0100 (CET) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Sat, 27 Feb 2016 19:19:08 +0100 Message-Id: <1456597155-10711-21-git-send-email-contact@paulk.fr> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1456597155-10711-1-git-send-email-contact@paulk.fr> References: <1456597155-10711-1-git-send-email-contact@paulk.fr> Cc: Marek Vasut , Tom Rini , Hashcode Subject: [U-Boot] [PATCH 20/27] omap4: Check warm reset for reboot mode validity X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Since the SAR registers are filled with garbage on cold reset, this checks for a warm reset to assert the validity of reboot mode. Signed-off-by: Paul Kocialkowski --- arch/arm/cpu/armv7/omap4/boot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv7/omap4/boot.c b/arch/arm/cpu/armv7/omap4/boot.c index bae49f4..7f5791e 100644 --- a/arch/arm/cpu/armv7/omap4/boot.c +++ b/arch/arm/cpu/armv7/omap4/boot.c @@ -9,6 +9,7 @@ #include #include #include +#include #include static u32 boot_devices[] = { @@ -67,6 +68,9 @@ int omap_reboot_mode(char *mode, unsigned int length) if (length < 2) return -1; + if (!warm_reset()) + return -1; + limit = (length < OMAP_REBOOT_REASON_SIZE) ? length : OMAP_REBOOT_REASON_SIZE;