From patchwork Fri Jan 12 12:40:17 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: 859875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eDDuTEjW"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zJ2gl13Pxz9sNr for ; Fri, 12 Jan 2018 23:51:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A4D57C221C6; Fri, 12 Jan 2018 12:44:48 +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 00976C221DF; Fri, 12 Jan 2018 12:41:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3349FC2215C; Fri, 12 Jan 2018 12:40:54 +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 51784C22194 for ; Fri, 12 Jan 2018 12:40:50 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id g1so11799929wmg.2 for ; Fri, 12 Jan 2018 04:40:50 -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=8GsFNs0jtgkX613BljerM4ScjYw1l7gJAwQ/uaGeca0=; b=eDDuTEjWjN6KuBysgAxSqXK+Dns8Vq+VJosogg6T/pskGxoo1GWBvR8i3ygZHMAB6Y 1mXTM/HwWPV49DbibnukWyDGIde5aV4bg0VaazvCBWJVpv2q93r28iO9PcM3UZM9wy7e egyCfMqmZtFenqYk9seGYgbl+1T4Tc9WJs3tU= 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=8GsFNs0jtgkX613BljerM4ScjYw1l7gJAwQ/uaGeca0=; b=okmSrpRvXnflyCcYJroSIx/k3lXe7ryUlHoJh8uPZzfUmBqcnMp2JNTWkRbbmkeS+q LAgVJUzMIuZG7O88vkCteJOXm1O6PBWPorsg9NLceP9O9HGAvA+6fKi9wFEkJpW5hf8h K9eaYJrVvO6490knmnDGjH8WyxMr6VsB4Jd36DfGV0l9lC8dxVX4YyD7WjvOTobYD53m 6XlycBCnL3drthja7md7ywz6oas46kyPxNuSoDkF3D6UEk1k77X1D46Pp4XWeshYXNYU h6DWxpVXwgu7BcsDck0T4P+2AsG4pgk1OBpkE2y6wDbFFL6iPpkF5a747clKiFD9x+c8 ocWQ== X-Gm-Message-State: AKwxytcVI1f9KUZ0NCepKRN5zzAAvxCIsPL/XHMdNL+oljyDkPZ325sp pM/28HRLLQA4gWhfM5Ngho5SgY36mKk= X-Google-Smtp-Source: ACJfBoszrP45Kp6ao06cT0f8sWBaHUewXGe9hvuAePNs4FAOXx1dovQmPrIJo57mgdEA3VCd1Udydw== X-Received: by 10.80.144.233 with SMTP id d38mr547599eda.291.1515760849816; Fri, 12 Jan 2018 04:40:49 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w2sm13893585edb.4.2018.01.12.04.40.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 04:40:49 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Fri, 12 Jan 2018 12:40:17 +0000 Message-Id: <1515760819-15116-24-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 23/25] arm: imx: hab: Define rvt_failsafe() 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" The hab_rvt_failsafe() callback according to the HABv4 documentation: "This function provides a safe path when image authentication has failed and all possible boot paths have been exhausted. It is intended for use by post-ROM boot stage components, via the ROM Vector Table." Once invoked the part will drop down to its BootROM USB recovery mode. Should it be the case that the part is in secure boot mode - only an appropriately signed binary will be accepted by the ROM and subsequently executed. 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/include/asm/mach-imx/hab.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h index 5c13aff..a0cb19d 100644 --- a/arch/arm/include/asm/mach-imx/hab.h +++ b/arch/arm/include/asm/mach-imx/hab.h @@ -140,6 +140,7 @@ typedef void *hab_rvt_authenticate_image_t(uint8_t, ptrdiff_t, void **, size_t *, hab_loader_callback_f_t); typedef enum hab_status hab_rvt_check_target_t(enum hab_target, const void *, size_t); +typedef void hab_rvt_failsafe_t(void); typedef void hapi_clock_init_t(void); #define HAB_ENG_ANY 0x00 /* Select first compatible engine */ @@ -170,6 +171,7 @@ typedef void hapi_clock_init_t(void); #define HAB_RVT_AUTHENTICATE_IMAGE (*(uint32_t *)(HAB_RVT_BASE + 0x10)) #define HAB_RVT_REPORT_EVENT (*(uint32_t *)(HAB_RVT_BASE + 0x20)) #define HAB_RVT_REPORT_STATUS (*(uint32_t *)(HAB_RVT_BASE + 0x24)) +#define HAB_RVT_FAILSAFE (*(uint32_t *)(HAB_RVT_BASE + 0x28)) #define HAB_RVT_REPORT_EVENT_NEW (*(uint32_t *)0x000000B8) #define HAB_RVT_REPORT_STATUS_NEW (*(uint32_t *)0x000000BC)