From patchwork Tue Jan 2 16:44:08 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: 123181 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9185370qgn; Tue, 2 Jan 2018 09:02:10 -0800 (PST) X-Google-Smtp-Source: ACJfBosdPmuymoHo6fip49nteux2QXffd3oxpfVNBLaVIdmBjWOm7kl7Ee7M+RquN1O2+JAiS+7r X-Received: by 10.80.168.162 with SMTP id k31mr64843070edc.253.1514912530589; Tue, 02 Jan 2018 09:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514912530; cv=none; d=google.com; s=arc-20160816; b=lakMTqxhjIVUGQwrJa1bI54/Li0eyTGeiLyZdngk6l3f4a+N181zuARD+0ZA0f1I2A ARk49rQNt2fFBYZjQ7GdQi6OgE1f1+OzMucjNWp4bacf37y4MI70iHu8jnkf2NnkuZNV 0VSRN5kXcTxpMpPGsYb4DKIvE7e4+AdWVthYOdR8mEL8vqSj+SvLwj9QMXpzyX/5VPHR O64SGL0lg3s+cENDY6TbtcfgyIT2xS7gu+ItG6fGXChTkReTd2j1a+TncB9A9KtyTHOj nfHqH7b37tbq1igTNHEZEyDrVYvk01gQoQgr9iZf+/4YaZLVO5ScUgo82peiHx5rGcou pAZQ== 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=R9avwgqFddUomNIB7aDnWBoO8/toFIyRAvBryJEn3oQ=; b=yGhwLJUAaHCkKhQiZcT5qFymAqSe2cZko0N30R6dyK/h1vBYdClJ4Vi15ikeCYmhfy nxHRunr3X4vDjkFyhCJo8fN0UgAohQo/T90Vq0Tt59Ey6Tgh08bk6my0FMKZyPGvfyDI kUEAnaugs1FS3YD2UGajhxDJWpOFsWAU19iJcTi6x8p8h+4OiLKx5q4zpnbk8gTqtUsl rSk3AxXzfpKe8UW0FCYhauQZQqBNUEdiQDPOE5JaXYKCqXdgGJvFUG2gHSF3z8EbZ9Uh VvSmFIWNth2YyVcHrQo+MoCVnYcXAHyGAJ6770Fa4CmKsP3LspodMP7/GAfLKc/bOipq aX5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Zm2S78bM; 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 s10si1092919edc.387.2018.01.02.09.02.10; Tue, 02 Jan 2018 09:02:10 -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=Zm2S78bM; 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 20B6CC21DE8; Tue, 2 Jan 2018 16:51:50 +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 9CB09C21E76; Tue, 2 Jan 2018 16:46:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C0D6DC21E4C; Tue, 2 Jan 2018 16:44:57 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id 53A62C21DA9 for ; Tue, 2 Jan 2018 16:44:52 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id n138so62061769wmg.2 for ; Tue, 02 Jan 2018 08:44:52 -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=ktW14LjkBOmNYdKs8hyHshup1gAU1RkLhU0pGCF1UXI=; b=Zm2S78bMc+WIcsIYW2M8pl1BzNTjx53wiPhqSil2cO+acrn1RKc+zpoLJl2Oo8R1un ujqGoGUiiltnyaNt0XmMlsCHXnDQtqNaLtRxMcepQNa3UCsiTlxgRWTJR/HucLYQ7CG2 xu/reysEbTiRvofvxXybjl5/phsIq6QN1KAnE= 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=ktW14LjkBOmNYdKs8hyHshup1gAU1RkLhU0pGCF1UXI=; b=pD3SPtEIj+8yqFGP+ia8TyYhuL8fpCIX0zAa9yxR+5H8R64qWaefOORVK8fYzFJcTS 2P/iuOSHtToU2zKyoDLI+xKcpy9mOXdXkCdIWSWrS15naWId+Gu+tePXwGSY9E3GbjJK FDqNEAk/xzT9JZEG6l2dSVRlzk7LbSof8Q1sI7kl+RvFzcHtRP6NRm7wxCMCBHNgw+ik iCWpknHHBAFiX0FJVNCAX+09CGNU1r4V3Kh0hmieXAANpQZMjeO8y0SZKkVmlqVZW+Pr pXFw6sOkSVzcXnC1uNcxgY6QmX4J8XCwxKDFL0XHUCmqGz7ylChML2h7WC1lUrqo0Xrd ECnw== X-Gm-Message-State: AKGB3mKop+0hsz5bQS08tNdt3wGUOvGqaiCwcvzRxsCF9/Rvtfp1Ryf+ AiNf/mIbA8d1QnR3QDO7xqvZ16WUL5Y= X-Received: by 10.80.173.170 with SMTP id a39mr61928768edd.49.1514911491707; Tue, 02 Jan 2018 08:44:51 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Jan 2018 08:44:50 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Tue, 2 Jan 2018 16:44:08 +0000 Message-Id: <1514911451-4520-23-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 22/25] arm: imx: hab: Make imx_hab_is_enabled global 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" It will be helpful to boot commands to know if the HAB is enabled. Export imx_hab_is_enabled() now to facilitate further work with this data-point in a secure-boot context. 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 | 1 + arch/arm/mach-imx/hab.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h index 98bc1bd..5c13aff 100644 --- a/arch/arm/include/asm/mach-imx/hab.h +++ b/arch/arm/include/asm/mach-imx/hab.h @@ -187,5 +187,6 @@ typedef void hapi_clock_init_t(void); int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size, uint32_t ivt_offset); +bool imx_hab_is_enabled(void); #endif diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index f39174d..99834c5 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -96,8 +96,6 @@ static inline enum hab_status hab_rvt_check_target_new(enum hab_target target, (is_soc_type(MXC_SOC_MX7ULP) ? 0x80000000 : \ (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2)) -static bool imx_hab_is_enabled(void); - static int ivt_header_error(const char *err_str, struct ivt_header *ivt_hdr) { printf("%s magic=0x%x length=0x%02x version=0x%x\n", err_str, @@ -419,7 +417,7 @@ U_BOOT_CMD( #endif /* !defined(CONFIG_SPL_BUILD) */ -static bool imx_hab_is_enabled(void) +bool imx_hab_is_enabled(void) { struct imx_sec_config_fuse_t *fuse = (struct imx_sec_config_fuse_t *)&imx_sec_config_fuse;