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: 123785 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3021264qgn; Mon, 8 Jan 2018 09:52:45 -0800 (PST) X-Google-Smtp-Source: ACJfBovs5yWMouO2XTa2sw4bcmTGmZRIPlmg1kAJelsCKbVAa+IUqLz7LI/RfBtlA6DP8V1NRRWK X-Received: by 10.80.157.6 with SMTP id v6mr17406655ede.123.1515433965353; Mon, 08 Jan 2018 09:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515433965; cv=none; d=google.com; s=arc-20160816; b=SB2oTJGdwbnzZHB44CWP7z0juICmaOom5ul46iW8ul5ml1Ol2KQ03jE8spncUC5x+w jZWyikfcYO+nA5yRyk3+XS5z1Txw8dI6LFRl/ZGN5IZ2HMCO+maCTTN8VmCcGTDWtxBY Qqk//HbCYJ9CJ5IRTsmMWma+4DgG8qCoSZ4qaiQG2tGGq6utKHYJJNvg6r4Q7BQL6IRi oPnZC4M7qMoJOmXXrsQEVBefdhVXSayK80PpglU1BA7n/hFVRk+8S3ifqn56KunBAuwn 5mMwWhxvaGGkjk5kYb6h7veIM9NNnmcZRpF+IEvsjIK1d1gnj1/1FzTWlU2mpoIQziH4 JJyA== 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=Kh1JVvbV5u5re8Xyjinh6kTc3ldPklrZjbDvdfaPwbw=; b=JcDwVPy7lfiFz2W7T5sUAQpMBweTw9zYYqcyuFWKixbiWrIk2F/n/JqgJAq1HrIZxa 4iiYXK8nDr1PgYKyeVoPFRKzcKK26y8Q9TwhkBEc5GYdhNWK5SQadOfukA9Irza9qgJe ZgAsHwpI9Do7SyJSmp6TDX3znaOcSMJCa+4yEa2SvQKK2doagU/Uwae0+nBz7zmOPPSp d27JSVMUNRuH761HmGZUOnSwn9ulTXXhzsHvfYbUHtoUgjfGsx/qAheMgGo5752GnIf8 YJubwjKGiqAMRJJ7yhJg+Ens9c0RS2K11SkbZF2IGTIWp9lRdh4BCuLHqdObks0UZYDJ tl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=L0ZHRShF; 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 g61si6646818ede.22.2018.01.08.09.52.45; Mon, 08 Jan 2018 09:52:45 -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=L0ZHRShF; 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 E40ECC2201B; Mon, 8 Jan 2018 17:43:07 +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-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) */