From patchwork Sat Dec 30 01:09:01 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: 122985 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5324199qgn; Fri, 29 Dec 2017 17:24:27 -0800 (PST) X-Google-Smtp-Source: ACJfBovbGYuJIVkEJZtMlptfRBG0JwLGv+2cLB/7SpVyubL1cAUF0fLpL/BXmxTl6CWwO0mLBftr X-Received: by 10.80.182.5 with SMTP id b5mr46874025ede.227.1514597067163; Fri, 29 Dec 2017 17:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514597067; cv=none; d=google.com; s=arc-20160816; b=q751lg0/5KwiTKZbUGHtjD/uUgDIV9sNVMFPhnutLHlxk2FjRAPtU9ynApKaKUJ4KA N8DhuMpQjy7hrB79EAHiID4loYlBMI4riN4ur0n0ACaElvpA1wnNPGDWiEegHmhzn2U/ QkXhWfE56UKM7puc3GWYtystyB6IRsU5yqyzL0Tg5Qd3F0O1DhHWPolEgK0Ov3tdcKhY 7eHjlyIoyzIHJwS4cEkVy1hdSgIBu01p4OMgvg8SPNbi0E8qVQoYIwqNpgv8yp65UX4e GW1WS50e+T0GQGmIbZbGbQiD2XOx07DPbSp8pVMiDnSla+pptmbcqIPCv8yAp0tKjXeo 7DoA== 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=FgIQT0Pg1fSxWb6ytOLsuaAObYcbLzc7gtpLTTGoQZfrp6q33PDQbKvDX68NIaDaF7 6ejtrEBLGgqvsgXNo3jfJflmCUg8Hzf6kjZ+bDTPlKAVKxHUyWzV8i1LQ7jjJ6A9t66Y o9c2prs/JomOkS8USZxA+xhMicpwsQ6aRcg3lreG51b7eyFnpE8YwVKkQ8KZmTINBDQE XsF+OgD/Bn+2l5WJSK0jyjA3LwLaLkwZP0+z1OS603beiEUBOcWI/CVlypdt12iuLl53 gxRrWW5/cbfNOhVDow3ZGQoDXYGjve+5a3g93pe8aGhqH3q7Nwa5/6B6g82Tmn/qz6JI 3Vdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fMMUCEZE; 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 o63si6188793edd.266.2017.12.29.17.24.26; Fri, 29 Dec 2017 17:24:27 -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=fMMUCEZE; 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 B138EC21D56; Sat, 30 Dec 2017 01:19:04 +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 ECFBEC21DDF; Sat, 30 Dec 2017 01:14:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4090C21DCE; Sat, 30 Dec 2017 01:09:45 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 3A1A6C21DBA for ; Sat, 30 Dec 2017 01:09:41 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id b76so50406855wmg.1 for ; Fri, 29 Dec 2017 17:09:41 -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=fMMUCEZEtp//Qu26Odzkv55jCcBl8+Hi8wr2iMXjFvgSTSKFst8L9Qliks8ZyPpU+e +f5Ubkhl3lhFy3jbluV71Pz2mQYTc+IDWo1RvqqFiS78GaHXKUzr3g2sl/XNGch/i/Bq qzdmpz3qXyODwWbVbCmCScCihHO10G65yBZnQ= 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=QIVhZASr6LPalErCq17kOwJ0wW9AgFcfru6nlQK5sFb7MOzImp3l2sOG4Wb1GT5UX+ jKjZHgUVI/nVlLhLDg/Ng/KnZqrkFMx5qo9JYpjCSf7Ns36XdZU1YfpUMTM9LEv4JYns QsZGJUgT+OWCZMxEsPJyDAwuXKurnEwUWVBj5eNIHjOJS3V2TzoPKQheqV3omtcrQev2 9+vrLJbFxehMAt8E5H6G1ALNU+Mr0qCAoLL/U3lgOKj0IVZprxfp0mnkiZHPlvigIRDa BwG/ECINpEm7x0PUGqbgQ3mcMZjYEf0d6+U2d8sw97iIWjCRjvNvATgMPUaGCoTd/PYm myeg== X-Gm-Message-State: AKGB3mLWXWfy5H8B+JSLRYMjuHxHz2dotO8GGSotSr1nXApxSO7ETeYk JRl3oDz03ZkjikzgO2mGt2PraojPFAE= X-Received: by 10.80.158.15 with SMTP id z15mr46001574ede.262.1514596180667; Fri, 29 Dec 2017 17:09:40 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:40 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:09:01 +0000 Message-Id: <1514596142-22050-33-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514596142-22050-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514596142-22050-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v3 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) */