From patchwork Fri Jan 12 12:40:15 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: 124323 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2022385qgn; Fri, 12 Jan 2018 04:50:56 -0800 (PST) X-Google-Smtp-Source: ACJfBos3F0aA2jwQ/rVijoZiQFsGPolEinP1Wss0LmBsbJ2HnyDFAGWpFL4F80GOjdCjdjE8Lhrp X-Received: by 10.80.136.129 with SMTP id d1mr35992825edd.256.1515761456093; Fri, 12 Jan 2018 04:50:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515761456; cv=none; d=google.com; s=arc-20160816; b=PGNPt0cphKbmNEygyupbiPqibzb79apzJAYOwjjlgfjzXFQRX+ulBw2y/FBB7BW/kA 8PaV7lqhWZBCelAuov9KClcFEEl3lyE3bhZXgPIsZp6RVDiP4cAEnm4ZiYcJblVFsb/l bykJinG4W0oiSddZf8okllOPYQH1hfo68Dgi/l2BRc6dwR2ww6aj0WcSo35UhsIQpSGz 2UV1g7kGN1UdrxoL7QT2EJkVWpnIGNOxzZBXhVk4Y73OjZOu1fiBg8HBF3gGEOw+o818 7XnrKDcOn/ugkdokI8QSxheGL0gpB8CiXux9cSHEs6WAm+B4ocEm0ybiTFgjhFHE37vt +MpQ== 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=94MMmcnA4iKvLcnwoaqJLkxlkSdko+a1zk2C6PnP6P0=; b=aSDnQLDwc7A2jd/gAthiJoSmWj5Sg2rLmLuRNs2/90Jrj3lwsRzitFgP77CFYufnRe FipLHTcy7/TTmgVSaJBO5oFNLjxL+dnYaRnFmdJptx8c9NxmgIBwsrHVuGiq/lAF1Ikj 22xh3Trja6oARpm7gkMfY6zTFrnA00mteO88vr86JnOKKWepA+sSUa2MUP0IkVicbH12 TFiWVjRSThMxSlTmhoJi40ZHLRT/nHabwtPIOfwehkLG7YxBJk+nMVSMv4Eb6fd7rT6t RaTlY43O0WntHSGJoSs7RzoFHUJm4V1+PYqV0lDeNbAc/hPZHnrOhUaxgY1uoGGZgpDM hXMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Vv3OzQO3; 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 s15si4228882edj.332.2018.01.12.04.50.55; Fri, 12 Jan 2018 04:50:56 -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=Vv3OzQO3; 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 A7BC3C221EC; Fri, 12 Jan 2018 12:47:44 +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 68052C22208; Fri, 12 Jan 2018 12:42:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0F175C2221B; Fri, 12 Jan 2018 12:40:53 +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 2D452C22167 for ; Fri, 12 Jan 2018 12:40:48 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id b76so11630517wmg.1 for ; Fri, 12 Jan 2018 04:40:48 -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=AweezIEBRSX3muV82c6vfHsAmXM/yGF6ylEcgvYRBiU=; b=Vv3OzQO3zcR+ovAki/KGPTIiW2tEoRiUxRw5B5C6JbVQlTPl7j9Vn/X5uugLIRinoI K5RwuFleGdzQdSFhtj/mDvq8W8JLh1MSvSeGJUVMlM1q6oWivrUOrc84ClodYgNposi5 +9ITav49NeTtgguOdeIeiktu+fPd6kzk0hb5s= 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=AweezIEBRSX3muV82c6vfHsAmXM/yGF6ylEcgvYRBiU=; b=NPy+D2czQYLPZeACkKCZGtpM+cqTnjpZsj/vWJz7jHP/K7sFhpTMaLY92hjjM9BdWd XY+566Zko0KJJ7UEBcgrPw++gSGeVj6jjufFBafDdnCaHG+3+znhR2x0PpgSuErZH7xS +bxYZo0X1zItfkAOrf2zlrB8tFuhFnhLBjMcZuvoE20Oru4R568rDyslCvOpCxqAv/ov A/quNX66OG9XjS2+MWtpg9fSYJXeNXZQvbrrFH8hze1Jj6muVE2MNuZaZL4JdOy5tRkS 8ZGpIgbJC2SM7P1oSdI0cZVHSCzvLtMC7T+2Bh6HKMjjHIJ+c0iDwb+s5QgxzhCDKJQO Lz4Q== X-Gm-Message-State: AKwxytfXwU7NElkVJOynG9CeoUuY+OFq+kG6nu8E1tKEIeHTVmvWuejX Sk3HMBcRrBtVe8px4ciGLbx1I8LzqFw= X-Received: by 10.80.219.8 with SMTP id o8mr15949173edk.301.1515760847704; Fri, 12 Jan 2018 04:40:47 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w2sm13893585edb.4.2018.01.12.04.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 04:40:47 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Fri, 12 Jan 2018 12:40:15 +0000 Message-Id: <1515760819-15116-22-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 21/25] arm: imx: hab: Make authenticate_image() return zero on open boards 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 BootROM will not successfully process a HAB image passed by u-boot unless the board has been set into locked mode. Some of the existing usages of authenticate_image() expect and rely on unlocked boards doing the following 1. Not calling into the BootROM authenticate_image() callback 2. Returning a pass status for authenticate_image() calls anyway A previous patch removed the necessity to call into imx_hab_is_enabled() twice. This patch ensures the reliance on authenticate_image() returning zero is maintained. Signed-off-by: Bryan O'Donoghue Suggested-by: Breno Matheus Lima Cc: Stefano Babic Cc: Fabio Estevam Cc: Peng Fan Cc: Albert Aribaud Cc: Sven Ebenfeld Cc: George McCollister Tested-by: Breno Lima --- arch/arm/mach-imx/hab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index d917ac3..3b19a7e 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -458,7 +458,7 @@ int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size, if (!imx_hab_is_enabled()) { puts("hab fuse not enabled\n"); - return result; + return 0; } printf("\nAuthenticate image from DDR location 0x%x...\n",