Message ID | 1514596142-22050-20-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 90csp5323106qgn; Fri, 29 Dec 2017 17:22:51 -0800 (PST) X-Google-Smtp-Source: ACJfBou9QKWs5RSWWNbnwGSWpcw6XpCdVqYmfnInwyh41cg3fxgT5CLO2kLwh2v0Aq701HRXO/uh X-Received: by 10.80.145.195 with SMTP id h3mr48633669eda.240.1514596971177; Fri, 29 Dec 2017 17:22:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514596971; cv=none; d=google.com; s=arc-20160816; b=J4fjEnoFadrLQ2v78svYGKyGnjs4KgQUV7+VFOe2grHRkh5t+pzUqt67Cmp/ndiQob SkzxVoOS++FR8fbCSF9ZPMST8hLsNN84hcfeL8h7g+yAbC+x1yhErLFo+aMU8GEEK0xr PY2GOsXKU2z+uaxZUb5Mw80Drua6m7WUwYGf2jjqho+ovRF7207mve7LzMwDNdyxfFxk gOPjEnafdocv0VEQWJWF5Y/um3VSPk3a977V/jw+sEH7xscLi4r2KyIgR+k74hn9R1Vc LeBeADbWEnEt2IS7l2usjGb/objHm2q5Yy1/xHkeI1dv3zNkzaZZG6F+DGpkFGkCKKJq 8LEg== 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=S0JhmcHhc1e3FB+iAlVlIisarDxPw3YaYB4JP6wXzfg=; b=KOGWrC8v33mbpoOQE6Vi8fyv545GAsKRZN7OPNRtILKswOE/UgBtqKPkr4LnnBh37A Fnfsp14kDLoNT6BT4td+p4oiFejE6XCG7I++38uf69Z7DIX9JnTchvlXRIr3q8GcGg5k oQnGsQWEmwV776GE4uxVuU0jBEwN3TH0aEXq+DRzXxnymf1oadWR1oWbhGZ64ZHA/KnR yut7HKYxQMPmyPviFT1Hb2HOcQR5iQpGwjQzfloCl19oJTTq8ZT8xVH/iRDyQWVD6Qk8 UVG4mEI1gCROhcfLt5B4kWMUj1BZSWOSt3cLKvzs6YCG5BR7MtZoWik+RkaLG1qPA4X1 Rvww== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ASZAqzQH; 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 o28si4068788edo.135.2017.12.29.17.22.50; Fri, 29 Dec 2017 17:22:51 -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=ASZAqzQH; 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 D47A1C21E90; Sat, 30 Dec 2017 01:14:10 +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 C7120C21E4C; Sat, 30 Dec 2017 01:10:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A9ACCC21DBA; Sat, 30 Dec 2017 01:09:30 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id 6C987C21D9F for <u-boot@lists.denx.de>; Sat, 30 Dec 2017 01:09:26 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id i11so50083866wmf.4 for <u-boot@lists.denx.de>; Fri, 29 Dec 2017 17:09:26 -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=G0phrzE8QBsqEkSlDYYFjGIrOOsENIKZJkqtSyjgeQY=; b=ASZAqzQHmcDmxlFUjZo0uV+OwrlcurWVNyNg/Aq+JYUd30nbAibeFSfsS6xWy0sj0O /lrjHCxPxNx9fFijIZsQzY+gSX+BwvSl+uyXh4toP2vETsSV/fvS1qRYaYDQVycaVTUd uFIg398yYNTrcqRinhrITHEih7ax+Q7NRjqOo= 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=G0phrzE8QBsqEkSlDYYFjGIrOOsENIKZJkqtSyjgeQY=; b=PpzK/4TKr998AliuEGjc0QDg5AKx5iympjcx8bcPqeLf2w8KpvP+X/E7YBeasylIUf yvP72R3OH2cEF+qLZSS7KwyZX6f74E0dstCnWovk9j3OUdhqTy3s9kl5cLwtbPBgmN15 /HJm7jw0CtufIFE8gaM76VHSm0j+CDAg0aqFOSU/MKl9VSn0gd8XsWRA1L+0Kqi840d5 qIHXHYBeN+VN5vy/ULzVy/woO+rGMhMj0og8NYb3/nj6rZvDbLdTrD+MGKGnUg51CDBc JWCQQnoqVY732FGknZYnaHmO8OIri8gKIDfxD22nnoM83648goLh/NQX42HV4WaW7VTf +IBQ== X-Gm-Message-State: AKGB3mKBV3uYYZDK//vMRBn7OiJaYXG4giXeewOVaWRbV/Gmufdc4eJK AD/z8+7n6Q1pxgEfrTWTgMvBHWIe4xc= X-Received: by 10.80.148.112 with SMTP id q45mr46450588eda.161.1514596165871; Fri, 29 Dec 2017 17:09:25 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:25 -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:48 +0000 Message-Id: <1514596142-22050-20-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 18/25] arm: imx: hab: Print HAB event log only after calling ROM 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/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index 92d342b..d574f2e 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -478,14 +478,14 @@ int authenticate_image(uint32_t ddr_start, uint32_t image_size, if (hab_rvt_entry() != HAB_SUCCESS) { puts("hab entry function fail\n"); - goto hab_caam_clock_disable; + goto hab_exit_failure_print_status; } status = hab_rvt_check_target(HAB_TGT_MEMORY, (void *)ddr_start, bytes); if (status != HAB_SUCCESS) { printf("HAB check target 0x%08x-0x%08x fail\n", ddr_start, ddr_start + bytes); - goto hab_caam_clock_disable; + goto hab_exit_failure_print_status; } #ifdef DEBUG printf("\nivt_offset = 0x%x, ivt addr = 0x%x\n", ivt_offset, ivt_addr); @@ -558,12 +558,14 @@ int authenticate_image(uint32_t ddr_start, uint32_t image_size, load_addr = 0; } -hab_caam_clock_disable: - hab_caam_clock_enable(0); - +hab_exit_failure_print_status: #if !defined(CONFIG_SPL_BUILD) get_hab_status(); #endif + +hab_caam_clock_disable: + hab_caam_clock_enable(0); + if (load_addr != 0) result = 0;
The current flow of authenticate_image() will print the HAB event log even if we reject an element of the IVT header before ever calling into the ROM. This can be confusing. This patch changes the flow of the code so that the HAB event log is only printed out if we have called into the ROM and received some sort of status code. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Suggested-by: Cc: Breno Matheus Lima <brenomatheus@gmail.com> 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> --- arch/arm/mach-imx/hab.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)