From patchwork Fri Jan 12 12:40:19 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: 124332 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2025913qgn; Fri, 12 Jan 2018 04:54:54 -0800 (PST) X-Google-Smtp-Source: ACJfBou62Xgwnjw25PQZWFKKODCSRhiZ9YJuNTMqjtzRwoa+8CrMTKFlOMNOMGzpQJmCM9YgPpuA X-Received: by 10.80.178.133 with SMTP id p5mr36998486edd.149.1515761694029; Fri, 12 Jan 2018 04:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515761694; cv=none; d=google.com; s=arc-20160816; b=x7sQ4sKrGgdBU5zidCuwxofZlLkPsKe1ob8u9mqDNBHwWrZ/LKwzyK0wkjnQil3RIh f4RuNAUS3OG2pr18uaBawfgdwrnchTUMPckmBpW3zbnF3a+dnAAjg2nKIxQQtbkg+tdr Fz/oXoqNbCJIFFOTeZbRcb1QCevElyiJh+/JuTd0kzFkjMLpECsR9Sd14FphNKl/Lsd1 MFZbvtp22lgp2H5dMRm8IBgYzu8uN5qewYatKHQJlCb7C+xnXB7WDV3rb3RGnVLQdqZ1 D5LDPke0ToI5IAyxZ1rlk2LRDdxo5vDGLbSEro4wccLkt2B2yf0XayQxmtBmEFd4fkv2 5gSw== 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=bLbydjOuM7ZZqJU3tRSibQnTZgjU0BzyDjYEhMuSq/w=; b=wzBe3oncFgK/JZIwUOBG5LY2MyxRvKLKhFGxILk2fqrbFlqe0wCE6DwakDrn8bWZ5D QoFOQPPURG9l7PMBYnmWEhZCsypbg+Iqxk0H4C+F7mYRa0sd1aUTuTrKDAcDEQ6gAVym kGOwBgPabcUb2E6AJIOnXLvO8s5jh6KSSx3MaqzMIWaP6QJStnHwqNqv6sMCHQNgTP0L AxdW870HS9pev+/ZIG8pCPoxaUQ7N5ArRKJsO3J1NIRfQzIgET65h+tAWD4zQNsY8XJN mMCF/+JE3ujFj/hWdeeeMxDhaPID/cEixUCcWETe5LST9INZBC3pCrGvhzzQoT4O4nEX kiJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UvrUo7pj; 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 47si186675edz.9.2018.01.12.04.54.53; Fri, 12 Jan 2018 04:54:54 -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=UvrUo7pj; 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 9A02FC22207; Fri, 12 Jan 2018 12:45: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 17030C22201; Fri, 12 Jan 2018 12:41:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 28048C22173; Fri, 12 Jan 2018 12:40:56 +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 7694FC221D5 for ; Fri, 12 Jan 2018 12:40:52 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id v123so2393295wmd.5 for ; Fri, 12 Jan 2018 04:40:52 -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=l5VurfZpfkRpBG+7zTVuxyVFyXYTJYgNF7ZfMIDaCys=; b=UvrUo7pj0dNgopg3BcL4j5wa2BHYqs5p/pJ+Mvmk3OimH/ZB9Z7S6c/NG537iDpTyF MMB/a1/HU0JTw+szxV5g+t19SDpD6/A9uLCg/GULwR8wo8zr7SfpYgGj7edLgqsaTLBH 9PQkzcVy7QhQxSzQMQAnSjfH5fduoqlao0/xo= 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=l5VurfZpfkRpBG+7zTVuxyVFyXYTJYgNF7ZfMIDaCys=; b=BAlouqRS9CkamYDtcB9PpoXU0xkjMNkdR03gOvdH5MQSUUwmMwoQ19BMfqTjie7AXo G73us5bW4uAo09N8c6ElqERlMjj83upv1xAwWuiBMDdZBWgzzJ6kUcbS77trOyyEh3cQ xlqHQuN0LZaVEQ8Yjsbl59xwS1cG+IhAvlxNZYnH0G7rMYMMjz2pt2S3nUhk+5Dgl3FZ rbeHrKqMTq9pk+OpirWWFPjqylQ51umxKfAK8gqS5v4zjwqPVc8cOO3MvIfMo69y4gyI 3Faq+8Kmftip3ZvjFLOGVk6AyDYSGiud2KG1ptCtsVik1MJKB79brtg5/uDJHqXsEE9N XPbw== X-Gm-Message-State: AKwxyteCEEHsVg61Hy1K92HG3rO70lsXiDdZehZ9W20o/bI4vuKVPHEq blkOg0TdRv/6Ode5BmXfC6938g5eflc= X-Received: by 10.80.245.172 with SMTP id u41mr16884482edm.163.1515760851984; Fri, 12 Jan 2018 04:40:51 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w2sm13893585edb.4.2018.01.12.04.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 04:40:51 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Fri, 12 Jan 2018 12:40:19 +0000 Message-Id: <1515760819-15116-26-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515760819-15116-1-git-send-email-bryan.odonoghue@linaro.org> References: <1515760819-15116-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v6 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 Tested-by: Breno Lima Reviewed-by: Fabio Estevam --- 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 1236717..5f19777 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) */