Message ID | 1514596142-22050-2-git-send-email-bryan.odonoghue@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5314280qgn; Fri, 29 Dec 2017 17:09:41 -0800 (PST) X-Google-Smtp-Source: ACJfBouOI9RCCh42dson1IPv/qw+KpOv2SaXAw4+6Uvl89Iz32EC5sSas0oqvqRTIOdgR3vOUgaj X-Received: by 10.80.216.74 with SMTP id v10mr46771949edj.258.1514596181827; Fri, 29 Dec 2017 17:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514596181; cv=none; d=google.com; s=arc-20160816; b=fR1mthaMxv1JMzHTeutSXS4f5NVdfO0x04hdkusTV4O0Q37wnykVyz7XLudLnW6yOk XK5a9nnvf+eS3S1wOfndiYAUjd0FW7Np16jr2VLOKgBrgTU6bKF9viOKBtv8kU1Vu+yv zFWP/LXMBGe0hYrbz8ESSNZb9IRs7aJuB4J+HOE3ZdYM2ICJlvahT5aCpNTLxYeAJQh9 75T/+Bm9dHVmSxEmuGh3/WmAdZS3R2DGwzDI1UeylvkmQX+qshJ+/4VZTZObswE/mlMN F8RztfU/r44zpEiqVQdyUirvZ3Wtq0W3ONDClZXu71ZADwh6bYX2HTquLBcDSQjlaWzk uT6Q== 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=HS7KCmC5EP3My/+W1w4nqOM20jbfY7ICfxQOJquCBzI=; b=zwm+2bt1kGq1v10sSpGBjYk4VuPXIR5SWQXA/596EKDbnD2gE0p9gEQ1sC+ibvhwDl 6bPHSlqymmDfF8C3xSjv/quK01rWR52Ikqy+o7UI5v3QC3lSiLeU0L4wmhaafgBVMx+F EVKBX7MRTwcxRZAN3XcrZcVt3oC56GvXYcb+npxxTWDCCV3PvTq2+mN/OHbW/a7hxZrX cLgr7atzNuxswtT4kRiwLASGLayq7JjaGCyLhYXUdX1sTLbLv4sUr7kQjDEJRfPVKfoo iL/BQGtDsKKLWK/w9VNiQOZr28ZmSG2cwD8BRdoTLbvDaFTM4y3xlEu6jAQHoBK4VMRS 9u/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=IMKx0+6u; 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: <u-boot-bounces@lists.denx.de> Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r49si2667796eda.331.2017.12.29.17.09.41; Fri, 29 Dec 2017 17:09:41 -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=IMKx0+6u; 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 6D60DC21E11; Sat, 30 Dec 2017 01:09:27 +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 E8D85C21DB5; Sat, 30 Dec 2017 01:09:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0A37CC21D56; Sat, 30 Dec 2017 01:09:05 +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 61842C21C34 for <u-boot@lists.denx.de>; Sat, 30 Dec 2017 01:09:05 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id f140so50080994wmd.2 for <u-boot@lists.denx.de>; Fri, 29 Dec 2017 17:09:05 -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=3YZdInYDxFuSNZyaa3f41D9mVUQyXzcYYtPmrUIIf60=; b=IMKx0+6uTPYUMjuJmiBOSoQ/twRfGXdtLC1Et86PFeL1tFjkyt7o1Y+hnuKrDK96GZ /RkkKru98I9GC6PYiZ6rzmlbZ7GBBqRxg/VDyi9ICOLsVCUfjYI4Ya53CiqSMQ1Smatv U0IIFIMNL6qXkuimWARqAcT/lLx90fNXuIfj4= 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=3YZdInYDxFuSNZyaa3f41D9mVUQyXzcYYtPmrUIIf60=; b=rZhiQVFU+abEt+vxBoWvNRi+bQjnpu/YqJ+T+KeUQa4vk/OAKKnaNtVayGrF+SxUM7 qzp6CvNR0dCc/vT4/W1kkfhoX9g70skO5O9iNfxCwxBXEtv5a0WlDVMY7IM1EwuJI1GD 0GOHzlQUNJWn005tc9+t7G+Qw1wMUCw62RAvf07KiW5egZ4RKy515taEuIodWbS/xNlK AcjLgrgPINyxk+AqNM1cwaJENtZ0gwn5gmr5Zn3k7sTM4soQRJrm/7Qw4BBaCSKUjqgI FNBNf7DFeiw7RROTj9Vn2PyAX+cCe32nhKDIK8O0lSFOFBxmaNyOXwqzrYCpuiPvMNG4 1Ydw== X-Gm-Message-State: AKGB3mJS8M/LsLda4BQgD2aDhhDHTp2+sVRrAAt3BmTcdUBPH2qRIgws gX/rtDmkpWVY7CG+Uf4ukyU3gBhPm3s= X-Received: by 10.80.140.176 with SMTP id q45mr49195607edq.186.1514596144808; Fri, 29 Dec 2017 17:09:04 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:04 -0800 (PST) From: Bryan O'Donoghue <bryan.odonoghue@linaro.org> To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:30 +0000 Message-Id: <1514596142-22050-2-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 <fabio.estevam@nxp.com> Subject: [U-Boot] [PATCH v3 01/25] arm: imx: hab: Make authenticate_image return int X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
Fix and extend i.MX HAB layer
|
expand
|
diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h index e0ff459..1b7a5e4 100644 --- a/arch/arm/include/asm/mach-imx/hab.h +++ b/arch/arm/include/asm/mach-imx/hab.h @@ -145,6 +145,6 @@ typedef void hapi_clock_init_t(void); /* ----------- end of HAB API updates ------------*/ -uint32_t authenticate_image(uint32_t ddr_start, uint32_t image_size); +int authenticate_image(uint32_t ddr_start, uint32_t image_size); #endif diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index 02c7ae4..09892a6 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -410,7 +410,7 @@ static bool is_hab_enabled(void) return (reg & IS_HAB_ENABLED_BIT) == IS_HAB_ENABLED_BIT; } -uint32_t authenticate_image(uint32_t ddr_start, uint32_t image_size) +int authenticate_image(uint32_t ddr_start, uint32_t image_size) { uint32_t load_addr = 0; size_t bytes;
Both usages of authenticate_image treat the result code as a simple binary. The command line usage of authenticate_image directly returns the result code of authenticate_image as a success/failure code. Right now when calling hab_auth_img and test the result code in a shell a passing hab_auth_img will appear to the shell as a fail. The first step in fixing this behaviour is to fix-up the result code return by authenticate_image() itself, subsequent patches fix the interpretation of authenticate_image so that zero will return CMD_RET_SUCCESS and non-zero will return CMD_RET_FAILURE. The first step is fixing the return type in authenticate_image() so do that now. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Sven Ebenfeld <sven.ebenfeld@gmail.com> Cc: George McCollister <george.mccollister@gmail.com> Cc: Breno Matheus Lima <brenomatheus@gmail.com> --- arch/arm/include/asm/mach-imx/hab.h | 2 +- arch/arm/mach-imx/hab.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)