From patchwork Wed Dec 27 12:26:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 853153 X-Patchwork-Delegate: sbabic@denx.de 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=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="T8sMbes9"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3z6CH84JDjz9sBW for ; Wed, 27 Dec 2017 23:44:51 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 41FE3C21E4E; Wed, 27 Dec 2017 12:40:20 +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 07435C21F2A; Wed, 27 Dec 2017 12:33:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6AEEEC21D5D; Wed, 27 Dec 2017 12:26:47 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id E733AC21C8F for ; Wed, 27 Dec 2017 12:26:46 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id r78so39361997wme.5 for ; Wed, 27 Dec 2017 04:26:46 -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=iW0SWzXaSHTpKelEfU3j73cWIg9x778LQqkP/QMdCWo=; b=T8sMbes9vHqqB1lvvQjgqk5CDTTfgxf+HQY2gWmBuqrdenYzx+ZlggJwL9y25X6ksv kjEsBw99DR4QJrpez/QzO+WsWcsz/17tFPQbj5yvRXw+US5A73krffPYJPqGquVa5LYi VrpDWPDc0i5Ik3PmnzxGz8SBoy42yMF5Nb7Jw= 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=iW0SWzXaSHTpKelEfU3j73cWIg9x778LQqkP/QMdCWo=; b=DkxQYrtt7P+CLQ/gVbCRNO0hCKsAzZ8ns8rIrlHOUCFWq9DDwq/v8t+yZ33RywiLZz Kkw98S4OqSNpLWIOMJkeGubY0WI4jymNOSGgXrTWCwd8FovSWjck0tDcHrXhvZ5V+JgD gp2GXa7JQf3ZRgUEpY8n0l4GtLOL1w++7/g9biTeJpF6znGnZq2FsLT9cF6sB5SSTYJS sXzK5yjSY0gzIejBztzm59F95rpZapprp3qVI3Ad7KHUI0zGbmdASDewgu3la5b5XX3m LZf7nE5KDBDIuL8PN6aiK0L+ajbXwa4tuTh1KXJ99RzTAj1y1lv5j7BwQmyw2zaK+AZS 6M9w== X-Gm-Message-State: AKGB3mIQ+Hzkz8L9ymSRgo3JNrwWdsz0V3eL822+f5Z1XtijahSoTKRm hxss8Q9HzsKhrKgG8XwWX9GAPEn5Bx4= X-Google-Smtp-Source: ACJfBos19X1s1wopWuGRu7USSO8u9cXSZUE1YxpZp4/kyltiArX4oyShBr3pBXFeCGr97enM0A0lCg== X-Received: by 10.80.153.13 with SMTP id k13mr35530629edb.208.1514377606369; Wed, 27 Dec 2017 04:26:46 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a5sm28388838edm.47.2017.12.27.04.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Dec 2017 04:26:45 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Wed, 27 Dec 2017 12:26:06 +0000 Message-Id: <1514377566-28512-24-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> X-Mailman-Approved-At: Wed, 27 Dec 2017 12:32:59 +0000 Cc: Fabio Estevam Subject: [U-Boot] [PATCH 23/23] 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 --- 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 93e11dd..e36aa0d 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) */