From patchwork Thu Dec 28 18:49:42 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: 122870 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3811001qgn; Thu, 28 Dec 2017 11:05:25 -0800 (PST) X-Google-Smtp-Source: ACJfBoutpWnZtUCmsGn/WU+daeUfDsMgiY9gkoNGRd9jekiFblOzWP9nI7Qr+Bwro/AzaEAxEcCR X-Received: by 10.80.140.176 with SMTP id q45mr43156744edq.186.1514487925416; Thu, 28 Dec 2017 11:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514487925; cv=none; d=google.com; s=arc-20160816; b=vWS/3CGMgb2Wt+IA66VL79ISZwFnrhpQzJ6O2H5+AwZA1Tx/ZTXeajU0GpHHcIQABY xekirJY+2XngFRPAryyqfKHlG5FPMZXNMYHuAepGu/UwiXOM3+EBI6oomxKLkSI3ub5t JBvU07GmJxkZK6oZh2PM64LWhW/DNiwmlWI6AYRRi+BZqnPoSUoLKQ3OjSlnKft9GOgB PLfpsWYVLDllwVQ6wHiCHarzea30X+1xdsGcGvGljEWUaz/B/JzMRJr+XaApO4c2S7ud 5hX/XKidVgjWvSG2lrWHbgCR6zPgvpPEzZvI7Tl+QyDpZSsWJFTlL737XXVrpibNSkf+ 0vLA== 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=ThKhw7kql/fDmXQrMfgK2kTLIKciIFylSU6OMxqFlJ8=; b=uQ7xdYq2GixCQ8fsHY+75aRykFRa5a5lgBP4xqmd/pV8+Rtybsg8LT7BrddZekq6v4 /Z6nXI6sRrFIynwp7bbmRqzp1Epp6rQp4MnoWmqpZ4l+m6oDfCSx4pFXwuQKQdPOJmS7 +AACJIL2yVPi0ZECr3rccDwhZ5CQxgDv/aR8QET3sPn9L4FmFHuShW0A8+D6mP72QmBc +r3U0VWQHBP+GhdcSjRcJX+VOwUiz9bh2M9UWuBTmGSdQQNoW8w/TMhIFqtBwAFwO0mt VI7fNgTU2wEGwG7jWP/3BDZpdsEQp4RN/kuZoJ0ut892gTdHHQJpV4P00G9cJ426avRa ahFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PBGJTKNf; 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 d36si2996395eda.310.2017.12.28.11.05.25; Thu, 28 Dec 2017 11:05:25 -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=PBGJTKNf; 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 E68C7C21DA3; Thu, 28 Dec 2017 18:54:24 +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 D96BFC21E4A; Thu, 28 Dec 2017 18:50:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D352DC21E44; Thu, 28 Dec 2017 18:50:17 +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 84B68C21DA0 for ; Thu, 28 Dec 2017 18:50:12 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id a79so6162490wma.0 for ; Thu, 28 Dec 2017 10:50:12 -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=togK0n+9DCUCuihh1Ywp9zW21LV05iKB8lww5XXHr2E=; b=PBGJTKNfzLq3tJ44LK+YuBW/emMEkEDXYVsS8Xlnt+ubLCmcZOD2TgMCmUYfPmDaiW EDtyW4RVJPnLmTe6YehuhK3YNrErU/c6mqALnCpeJBMkY3uDW9beLAQlDLDgHouOuKgi pAcyHSaPV179Xh8Ln0QxxYmMPnZDl5hwsvTWU= 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=togK0n+9DCUCuihh1Ywp9zW21LV05iKB8lww5XXHr2E=; b=lJuBaHYAzdI0maUZ2t3C5AvUPXrYEPn1llRgoLIUtoOpJy5Nym0rZILfrCmihA7eFt nKCSQx8MAzXhnCR9Vd8ZCOrhOuAz5AlLV+g+COYd6+0d+y1qy5XZFn16VPkF9JAc8IAk nRgRJcToBaX86zdsCytPOXhIpTJbsxXzstlfK4pa75Ju1LVL16Ja0omIC35BLOkK+GK5 flADq4IDmEXCRdoksso5PaSvIx9ikT6hfwrOcg3LfMwiXOTnWfaO5pIDhxxdQ7F2u0jA YEkOIAhoh+M7giKwGNyXMtP1jyT4bAYGNPEzQ4Y3h/mlwZgcEXM2EQ300iQLs+V9X6+X DROw== X-Gm-Message-State: AKGB3mJQKN6TfF6d4paMI5uze6e/zbkoB+bMVqLrb0bnvhYnABSzW7eJ KAJynoMmu3bIadLyD0JQCy0VCX4m9Hw= X-Received: by 10.80.136.228 with SMTP id d91mr40944462edd.296.1514487011939; Thu, 28 Dec 2017 10:50:11 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id x28sm35246579edd.0.2017.12.28.10.50.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Dec 2017 10:50:11 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Thu, 28 Dec 2017 18:49:42 +0000 Message-Id: <1514486982-19059-24-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v2 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 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 01c0853..fb78fc1 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) */