From patchwork Sat Dec 30 01:08:59 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: 122988 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5325707qgn; Fri, 29 Dec 2017 17:26:40 -0800 (PST) X-Google-Smtp-Source: ACJfBouJx/woyT3RwFvs+6ez9SpZTErcX2BwNCjK5+xPNh/bXOX2AZSB5Zm+CYUIHFRcKoA6DvNn X-Received: by 10.80.145.98 with SMTP id f31mr46041793eda.168.1514597200583; Fri, 29 Dec 2017 17:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514597200; cv=none; d=google.com; s=arc-20160816; b=BlKhDLygBTzspLumwqKtlpAh8rBO+LgCheLpPjqdA7657eJ0pLN6XdDauErRl7rjvi 5REbS+KT35112fp0Dr0Gcgq7VISK59PhY9KlM/3XNdOcc/dbT79afLrVCpAnnnzQXZLn tVwn674rZfyHBNEAWo8TbURiuhJuMrykOtVs015BgIIWqKJanI6IBzCrfm9IswXf1Lxp nBV6Ym3px/NjL1NwUBf2hvaksbxpUqo/u7IUt94J3sU7PM0f+YVHcYDfFwedqQV4oo8Y dfQHpsNgA9fXDYeI1PbYeBqJbPIVKipJlGU6d2cMFWK9QUTCTeC7gWXvFX3f/52AMTrj u/vw== 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=ISXDc+jlhNqwct7NDQssVqmbbQ4fvIXwwdz7hQUr4oY=; b=auNycYjA/IMgsZwNQMWZ6vv0MEMuKjMnFCbYNqqbcpuJM5xoFyygIuHLuMHZuI9cR9 qyQ6rd5DEjU5KISczcdTv4rYnekZkxxQqx+HjvsrVE6qm0b+CQs5qJriV5uOSJCQvGIL YULhdh+rd+sELkXJVftcJMKsIWCqyAn4RVeMdAnszdBqg89tsC0j0as4m1EpodDgiPJk +9vml/LYXPDk4aCOygBRHVD6NOIIwKYER8uNic3X1rbPbkOtMzB4Y6swiuUVptmRdJLH Z5KCzU7qWI2N+0k7ZnSGNikApkNw6s/NqT5/EYxIGUAYpHQnmTFn60lZFST/apYU96x3 IHQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LJvRQw+9; 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 y26si764380edl.229.2017.12.29.17.26.40; Fri, 29 Dec 2017 17:26:40 -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=LJvRQw+9; 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 34A80C21D5D; Sat, 30 Dec 2017 01:18:10 +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 932C6C21DB0; Sat, 30 Dec 2017 01:11:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82709C21DF1; Sat, 30 Dec 2017 01:09:42 +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 16896C21DDF for ; Sat, 30 Dec 2017 01:09:39 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id i11so50084298wmf.4 for ; Fri, 29 Dec 2017 17:09:39 -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=xeM7Hgzag8wLqGBL0MsXCs4MKInNR6XSZZSFnGZhX64=; b=LJvRQw+9QCNj9mXm+ZuMOlqkku5iHkdrlgCqEPVkmlfJU2ccuc7kxH20mr1Vd7YTFp +QYxYoai9u6AQXlX/WPmDEauaZvTB8rSz/2gSh63r4x0qiQHXBxoEqHoDhyKPWauEP+X LyZIcCJjwOcmQjJncv/WQkIdzpWHPfezQCUB4= 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=xeM7Hgzag8wLqGBL0MsXCs4MKInNR6XSZZSFnGZhX64=; b=RtCohsu82S4qAvl6jIqUoROidPRYyfRX/2Ph376NEuuaJuYZK0mzBuMMlak9enmBBc 6qEhUTbTqluAYwm+1Tnxa7ovgNVbDsMHdrXKIzUmERnQGmMFFawYQaZmpq6zu0hixiDa g/bSHo1ea04uvko0LYPn/nGJ2KrZVxsFWK0e+U20vT4c70h+0n1yBWtm77pns0pllM5g bhwmCFwFQ8uHut9Qm0+hLZ3O/s4p5+UAI439ZbJp7Cls/39VU2dYWfxebgWOyYKMbXtC LhoiDP9I/YBweRObQX9IgPDuIkNH+E8G1F3veD1ZQhE0hBK2z+D1Qar4yOHCtGVAm6Th eGAg== X-Gm-Message-State: AKGB3mL2PVFSGvO5xLxyLgz5vT/U+FuOLe+WJCScY7rEnXB4+QBgw47j ETaWdLPriNy6drHLk0RynzuOl4WSzEA= X-Received: by 10.80.130.36 with SMTP id 33mr48178040edf.252.1514596178504; Fri, 29 Dec 2017 17:09:38 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:37 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:59 +0000 Message-Id: <1514596142-22050-31-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 24/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 8d04917..5da09d5 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) */