From patchwork Mon Jan 8 17:36:41 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: 856981 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="L0ZHRShF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zFjTG1FK1z9s7v for ; Tue, 9 Jan 2018 04:49:38 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BC8D0C21FCF; Mon, 8 Jan 2018 17:43: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_DNSWL_BLOCKED, 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 C4BA6C21FCE; Mon, 8 Jan 2018 17:39:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A79BEC21FC2; Mon, 8 Jan 2018 17:37:19 +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 362ADC21FB2 for ; Mon, 8 Jan 2018 17:37:15 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id f140so15703238wmd.2 for ; Mon, 08 Jan 2018 09:37:15 -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=hGYAUC2um2TiGg7s7kWhfUsqjvwOv2BiNEaLB1KTxA4=; b=L0ZHRShFa7NKMMB4MkapUlEzgZod+7ir7KRhSAydKPWQcfrbkR03JftN1rb0BF1/5t 04AZSu0B5SkKFqbjfzxlrFJC6XKZDwcPtWL9MabhbDHy616jk7qc7GoutpbU4c0Z1D6q QFAKNrSKNxh+Z1ALgD469yU1tvXN829hFpm7U= 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=hGYAUC2um2TiGg7s7kWhfUsqjvwOv2BiNEaLB1KTxA4=; b=t4qw/QxLS8esaF/q00Lr9KNm4kE0kE5QttSvTDdRlzVuCYgrKWNNG1fPtWR6rkw+o1 mw4X+mmWST0DlW74px3Uy/K6m18DlEmyd1a0nWfKsWTH2IjlVQV+LtKpTGBukkNUgKHw 5SyycfhMGLZ44MCsNCfcSCS18rqfA4YyNm7tvRNbYCQEzWwDBDklXS8X4ciBhIEmjp5k 68endERLzHhExaF9l1NDTqHMncdXu5zHZKekB2Qh4dghoZYTmO5WbTlO1fVkXepnYF+p vz19aiJrzj0DrfkBjosjIX0U17Uh2Ie2CMImL0sX5zuoW5G0mREzizphg+1wLvpaijcp tisA== X-Gm-Message-State: AKGB3mJfU94kEIE9oE0/qQc5q8Ppeq8St+NNYPxvQTmxPmvsVo9QLex0 0ewBOrV0Y78CY1SQmEXwh6tyfaNMbyY= X-Google-Smtp-Source: ACJfBosInO9xwdQOEVMG3IStIVGCZXdO22+WlpgvLnzf/3ZF4Iyn/+tX/8fPLytad0Izq+iySAI/Gg== X-Received: by 10.80.202.135 with SMTP id x7mr17881945edh.30.1515433034581; Mon, 08 Jan 2018 09:37:14 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a38sm7160033edf.3.2018.01.08.09.37.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jan 2018 09:37:13 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Mon, 8 Jan 2018 17:36:41 +0000 Message-Id: <1515433001-13857-25-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> References: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v5 24/24] 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 f39b320..c0e04fa 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) */