From patchwork Tue Jan 2 16:44:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 123180 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9184974qgn; Tue, 2 Jan 2018 09:01:55 -0800 (PST) X-Google-Smtp-Source: ACJfBotd52qi5Ivl7rHxfbuGPHvUoscarg+FpfnFyClmYpu7b1b7b5E7cRZmUy4I34/bmyzxBtGn X-Received: by 10.80.142.88 with SMTP id 24mr64065692edx.153.1514912515429; Tue, 02 Jan 2018 09:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514912515; cv=none; d=google.com; s=arc-20160816; b=YYkcOJmKs/5qXevmeYhOh0su71IkB3d/rDzdYrWdN0VES2OwTbgH8XQakaRPwHjfTo 5qzMJuqp09viLdSeu2NVHT2ew1IIJismJcgG5dcghxHQcKs4xp2mane1fyaROdpHepMH ex06NYQtsjkf3QjQS+cwN1myvqL009aKAougmO3YRFnfpVb8DhDK13sXnvsqEHxMP5L/ OTQyzu2IwywHYKabuRiScS2LOLhsKut7JiLPwxHTuAbrW5pR4xCE19kv/esARAHBPNOg XeFlSwOeEMl8V4vY9pdY7OenzrKPDXS6BDvoheZ5WWfFBOSSRslzTQkCTtH8JAgqM/fJ iylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=GP1lfaSNRWT1Z7xYm1hpfq/e9ft3MV/KXcVJdpqm8p8=; b=bn7j5yQVNvniVU54B0QlJtNqrHnHsG6liadHV74lOPJdx853Qjdawdlo3P7eeukcp3 fq6SPbboR1PSPeUlrMfgJLNRENoRLZ5ObmsgVDytLQEHpkip5muL2kX3r46+OZLqhmEc hiYcoCr19DNmdbbgf4zaG+Wrlm+wa3n6KyxwHlXtuefpkOdZ2ek2Mup02f9uT6l2SgvU PKhBumKgHaqTkHSAiqsm8fPDJgULt/dJs19KC1xS/LYVvuU4q3GMFFceZkX85qgs7Ml6 YPPgOwXZWNPLLeezFbCHqE6jBspQeB8NzDsmoUgTR5Ff7yZWr7dBb3BcF0zE/5PfekTC q1QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y8f3tzYa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n3si432459edd.202.2018.01.02.09.01.54; Tue, 02 Jan 2018 09:01:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Y8f3tzYa; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id C7DDFC21DEF; Tue, 2 Jan 2018 16:51:15 +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, T_DKIM_INVALID 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 2C813C21E6F; Tue, 2 Jan 2018 16:46:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1843EC21DD9; Tue, 2 Jan 2018 16:44:59 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id 52713C21DB9 for ; Tue, 2 Jan 2018 16:44:56 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id r78so62433812wme.5 for ; Tue, 02 Jan 2018 08:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MgvIrmfm1jMCPovnavZF+skWhR7Gxc7ZMQGz5yUrGgM=; b=Y8f3tzYaaXNHTnKtNIVpA2P9z21m4otQHx1RminFxe+4pD9lPp357qiQAiJ/JvfxuK CafbpA1fi6xUgKw5QyNx8WfI9larevpoXg3tW5sIAe8HctB/UzySLU9fqBOSHz79ghdr rHQer0RnMMcjUUT2+PkaOR/8wfEULfrlXXo+E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MgvIrmfm1jMCPovnavZF+skWhR7Gxc7ZMQGz5yUrGgM=; b=jQUVjiaYsFyapX5tkNZ6U1j/1UL930v/ack9rVhNKI3jcUWQz7qeZ76+LX5z4d/v1V 3N+ka4gX8jcO4fH5bUWOn7N7MozvQIodV36djVcIbSPFiS6fAr3jFfgKzyEiCgs2Eeif 0oxuF/HskALDyg7mhD+lI+l7TNg2ePJxZxngt+OiPJxfcSI3/aAfjFahNmYITaDT7vTG eCh68WdKRRG7fze/8TdnghR8sUYdY4D1TmA64+VYmNWgH/pT3/M8inbIryd9TfBuXAgA XlhQeFCV61bkfYihsQwrp9C3vndXNCmbzrgC3sN8qR1fnVI8wkucjPcddBHQmwjOu4NG u3wg== X-Gm-Message-State: AKGB3mJNaH87iihdVPjGYPTOmQpx5+X/O7hsWIQ5V8XiMWU9WhCTMaaZ T2zORIugOZvC5tZtgi9Ttk8Q6dXYx/I= X-Received: by 10.80.170.207 with SMTP id r15mr65669600edc.220.1514911495753; Tue, 02 Jan 2018 08:44:55 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id z5sm29850584edh.76.2018.01.02.08.44.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Jan 2018 08:44:55 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Tue, 2 Jan 2018 16:44:11 +0000 Message-Id: <1514911451-4520-26-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514911451-4520-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514911451-4520-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v4 25/25] arm: imx: hab: Add hab_failsafe console command 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" hab_failsafe when called puts the part into BootROM recovery mode. This will allow u-boot scripts to script the dropping down into recovery mode. => hab_failsafe Shows the i.MX7 appear as "hiddev0,hidraw5: USB HID v1.10 Device [Freescale SemiConductor Inc SP Blank ULT1] " in a Linux dmesg thus allowing download of a new image via the BootROM USB download protocol routine. Signed-off-by: Bryan O'Donoghue Cc: Stefano Babic Cc: Fabio Estevam Cc: Peng Fan Cc: Albert Aribaud Cc: Sven Ebenfeld Cc: George McCollister Cc: Breno Matheus Lima --- arch/arm/mach-imx/hab.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index 17dac16..79ee4d5 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -414,6 +414,22 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc, return rcode; } +static int do_hab_failsafe(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + hab_rvt_failsafe_t *hab_rvt_failsafe; + + if (argc != 1) { + cmd_usage(cmdtp); + return 1; + } + + hab_rvt_failsafe = hab_rvt_failsafe_p; + hab_rvt_failsafe(); + + return 0; +} + U_BOOT_CMD( hab_status, CONFIG_SYS_MAXARGS, 1, do_hab_status, "display HAB status", @@ -429,6 +445,11 @@ U_BOOT_CMD( "ivt_offset - hex offset of IVT in the image" ); +U_BOOT_CMD( + hab_failsafe, CONFIG_SYS_MAXARGS, 1, do_hab_failsafe, + "run BootROM failsafe routine", + "" + ); #endif /* !defined(CONFIG_SPL_BUILD) */