From patchwork Tue Jan 2 16:44:09 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: 123171 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9179011qgn; Tue, 2 Jan 2018 08:55:48 -0800 (PST) X-Google-Smtp-Source: ACJfBovUIF6dM5QAFcurwtPabFhp4wEvTUXhMq8A+/ShBSgoY2GPnXAcKJJ6N75KbehPFI02Jps3 X-Received: by 10.80.134.197 with SMTP id 5mr63703820edu.129.1514912147900; Tue, 02 Jan 2018 08:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514912147; cv=none; d=google.com; s=arc-20160816; b=GYPuXj8K7qzdC6TTck5JKmDlUD32UzvlIb2i26of/xehibQuU7ACAWEcRJp2lYt+6P gUi6tt3CSg8LHhVIw5IwHWHd5D1aHMT0mSwud4HlrMLNQne0JfP90dikvV8D/uZILkg2 xFO7MFHrZ2Wj8re8CV+c+y0Qhmu1gMns2S8tmkf43J0ufCCibR7tAxcJHCFoYiYM+6+w F+02tHXWSijWJl2C1OtFuf/jq9BZBRe3YXVSCrcWaZ+C8Lye6CMmWU4s53Wv0BbxDSpV tSlx5+4bk7I39hYYgnRwykI6Tpf2zKMHjzpSlE196mtzUuor1FwzasOf1NuS2C11RnBx flTg== 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=nEiq0xect4AoWDmrA6PY0pIBd0aNAXXS+iZ9gzfxaCI=; b=NgJ7lbPLlYNmhnL/Hkw+7oFOEb4CPiM9XzHmaWO14120/lGQCBbQ1B0lmArZ3Hn2hk wUX6J3Ye4SYIXIvHUds2E6jn62WR/E2sZJ1xc440RzsPsGtaCrgfIjSLXzVJSZMlS13B /4vYlDxDINo0nNHJZkI44W9yB+Q06yjjs43YDOadw8qg9hLlfBimhgkhRFGb+r0XHsJW ZpmXNdQ3LeBNfKLIRwklaKpo3BRHux/74K5A3SFXfJbPIXLzoH+LF6unu/ebHeuST2ze Px0qF9Vld/wnZ/OPqyWwOM5A/tFVV5/ZOwhSFnrRRuz5yiEClGe5hcvMFpy1lOEJLRRm Sk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=a1zgUGSK; 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 r38si2445719edd.139.2018.01.02.08.55.42; Tue, 02 Jan 2018 08:55:47 -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=a1zgUGSK; 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 96122C21D9F; Tue, 2 Jan 2018 16:52:29 +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 0F2FBC21DF0; Tue, 2 Jan 2018 16:49:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 343E2C21DDE; Tue, 2 Jan 2018 16:44:57 +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 82E72C21DE8 for ; Tue, 2 Jan 2018 16:44:53 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id b141so15533493wme.1 for ; Tue, 02 Jan 2018 08:44:53 -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=cYwMYV7HIFFPZjWLmuiyD2xuH7kQg/RPLyU9z34NM2o=; b=a1zgUGSKza1WgNXKWZzxU5CY48F/PD3FW82pB/aJwtM6iEmy6zJmboFYEmZwNbkwag JWnoBfDlkYAGg/+VGaAD2K5cLnIawk6NcdnBgWIRTtNzSD9DlOzoNsEzBrlTLNeqLHf5 WvI8A4waeVXiXnhYwONQrEsvaydOEGGWvlYRY= 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=cYwMYV7HIFFPZjWLmuiyD2xuH7kQg/RPLyU9z34NM2o=; b=Jm4CvfAf6ns/D/wPNqGOWeRJrYbXSLTEm6zNDh0Kj4rYaVIDs8dv3WAATM6U+9HDjG 1q4IlYIs1Acx7QW2+TYdcMJzGiOA2bxlXWvPzX//7YqxScgO0ICiFHrhQaR5N8nJn5R3 Y6NwTT+wFIaDfO50jIneZ5lRLCAMVRrY83QLxIpbgoOWp2nMST68McJYvUIGSVAuyAqH 2CR6ns+rHWnIfNDls8EITAetpYgre4Ao0QmfaUmBnNFCmKzHXR81uGgjTqANbdJlohmT LxF8sxO6SkE3jLnzzVgXaah5PGnwb9XdaG2hT9x5DMSQob3+LRAvNlUodkOXsc1+75/X JEOg== X-Gm-Message-State: AKGB3mKb8WNG51ofOnLsbP7xfppzpb2jieXVCLdB2hHuFL4+dVYLJfT7 yxVyPSgY6++PKTu9qz8IUQKRGKh5hsU= X-Received: by 10.80.146.77 with SMTP id j13mr63224647eda.298.1514911492930; Tue, 02 Jan 2018 08:44:52 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id z5sm29850584edh.76.2018.01.02.08.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Jan 2018 08:44:52 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Tue, 2 Jan 2018 16:44:09 +0000 Message-Id: <1514911451-4520-24-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514911451-4520-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514911451-4520-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v4 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 --- 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)