From patchwork Sat Dec 30 01:08:55 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: 122994 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5327612qgn; Fri, 29 Dec 2017 17:29:45 -0800 (PST) X-Google-Smtp-Source: ACJfBovZFvhPhyz4DcqzwPTLddWqx2yTew9BPo/RUBk4QngNXyogVRBkU07umD5z1f12ItBvHDD0 X-Received: by 10.80.183.148 with SMTP id h20mr45885377ede.53.1514597385028; Fri, 29 Dec 2017 17:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514597385; cv=none; d=google.com; s=arc-20160816; b=0Rg1d6+qY4ajOChaXZ3ry2HOn03KwjbR79XdhtML/75bW1RzUB1xgPl/YKHfu47WIG 7NttenwqZtzA7rncNUHKkBUpV4V9mo5iZ6fwgrwZJDAHdcb+PQdfyw02fIQ4EC39A8nI zPBdS6D68CMSiadxTK0+q3mZ0XPBTAyoRlXPInz6HySAkBHcJTSIzFqbHgOeXuvnSKMW 0/1BucCC/vRM1gdyFClsz3wsT4l6VrTdvo19RlADutdG+I6agmeAqR+futGmdhByEIox UM/nLdmlRlQEhDWCFcWg2+2zMeDSIjIju2pK/nfjomsBN2FM1SRHvzE5wHGWgOJe6XTi 3Qbw== 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=pitJutkx7QAyKTNUHpcrZdqUtSQfK+3bDkjWgvzfw4upYTKXEOPSKDC7dAxwfJyTEg q9aMJndJXrOnc2g3Ww2frgJ5rI1sS+ZCw4givP+S2wF9voRNt5NkkxsyiPOn4rqbJ4y8 kMSBxWCGqkxVw8HppmCo5sIXExrWubyEb4KpY5Rtzwnv1v0YRB4weCQeTiXxfsCqFG6M bQCDsoyq8vfSPCM4YvKFu938Xe3gAFSL4J047NYFZEyCJ8DMBFB3gigXCuuPQ7PbHHgR lTLSzanvZB+uVkoCzi58R/Eu4mjwMLLD91Pc16KNIhF5twW4zcIfQoSq+v5oHyHEXetZ 7EMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aYG7sKsh; 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 k21si4555212ede.3.2017.12.29.17.29.44; Fri, 29 Dec 2017 17:29:45 -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=aYG7sKsh; 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 98BB8C21DA2; Sat, 30 Dec 2017 01:18:28 +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 38EADC21E13; Sat, 30 Dec 2017 01:12:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 467EDC21DAB; Sat, 30 Dec 2017 01:09:38 +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 826E3C21DE5 for ; Sat, 30 Dec 2017 01:09:34 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id i11so50084065wmf.4 for ; Fri, 29 Dec 2017 17:09:34 -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=aYG7sKshmKAMVOInCEIGGvQisA9Xi17VwXwZELhXbl4PavamafhoK3nlZWQ+xOMLxz FLBNCHtY90mhIE8/kotN84RcbXbIZomPoD/sud44IXOYoXq7aqDbekbCqS24ZfsNf6sS EVywdmJuZi9fPXGyB6Rt+Sr0iwFwjlAk6IWI8= 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=E6fMzpFKauCoB4OXd2CycygU5hsWILKr/ZliFybSulYqs1V72onQlmf0BvAxSDW7Cw Og3vKX129IkY0t7nSOHDitKDvQj3QT8cUvz/Vj0KG09/EYATspPJz0UeI5PKQGzi4p/U BsXDked35gAD1G0gIXBrqYZiA42BeyxmvgI03CpdfSeCtJTPyvfrybS7pjBt/TMQz2k2 LOpwwcPl/twz2LdlxkWXh/5bFkFb6yI2c3ftieRdPeQZR2n1kvYhR+g4L6juBULfF0ZE jPyA8fABqVezjU3ieKSo6cEXD41OdzxzWd6nEZ4cRW/daS5bhzslxArPGmgZVclrbUbN dJNw== X-Gm-Message-State: AKGB3mIDagjzctjpAMVRBQIevGlAxV3xBqjTGFJAWdsErCICF1mV1ctl 6ttSIK1vYrt7wBz2gW6cq9UfzUPCg+A= X-Received: by 10.80.181.83 with SMTP id z19mr47566048edd.48.1514596173954; Fri, 29 Dec 2017 17:09:33 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:33 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:55 +0000 Message-Id: <1514596142-22050-27-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 22/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)