From patchwork Fri Jan 12 12:40:16 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: 124329 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2024694qgn; Fri, 12 Jan 2018 04:53:23 -0800 (PST) X-Google-Smtp-Source: ACJfBot8q/LNFa/deoHTjvO+5gxBLw8M6UGfsES0Jm+oSlfsX0eW9IEi668ZANHml2JC/IUDOV1F X-Received: by 10.80.184.25 with SMTP id j25mr35922782ede.5.1515761603817; Fri, 12 Jan 2018 04:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515761603; cv=none; d=google.com; s=arc-20160816; b=r8XufVv7Oxqk1epj1JLR3BCgCQJH8cbAfVqOVDx30IrBvvkR7uO+ac6M4tSfa3FYfM Vib4MfCp5XooFG2yeVJhuaQYcBFdo4f9sL8yLaa8C/u+sKj/NmYSeblStkHsS0Cq9tp7 +/5wLa+SaSlCIATwpuEhra1kdsA3XEK/khpJ8P2ouJSHpSExa1MFnm0ab4es3wR3itXU 4G+up2EmTLP6iGjdobNxi2ksgV4msPE1UrrWDmy9Oa1leUlUlU3HgllgnrDTZPm9eapg lsRE9u9+iUEcPElzireFcNXzPfAwCd9SRO1eHI7t8g1ZKj7fvcJxuAziJC7JTT2vEnj4 1bdg== 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=aZ43QdyV+PV0sNs36RU7Ucl/tQFSC+UeBgSEfAHYN/s=; b=xoB8jmbReWhO9uYruj460wQhhcQimci+tSLMpXskyIUFMsTLYKvBi18nWwdmZml1uk LRF+a10y+Hubo2QNMUrUjI3X7qEfdx5qYx+dnnswmp3Gh3zlzHGMFBJnZuavvMy1Hoc8 oWlkPh09G8sqnUlsJcN+koQDC/rjPbQEaX6jKGOKnVbi8cV8qmHkFtdXqjpyCRg/1Pdh HDeFXgQfzwMAWxYP+AH79QyUtnXujkuFqol4lHkGPsic3j8ijJ0VahXo/8nFD6scKF2o ii8yoBrWSSNZMuj8pOtVwiQ6jIwmazVw9mdWGb/3RWBoZjr3XGbupOX0DEiNDXOzN/hI b7fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=X2mnX+e5; 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 q10si24238edc.473.2018.01.12.04.53.23; Fri, 12 Jan 2018 04:53:23 -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=X2mnX+e5; 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 6F87FC22204; Fri, 12 Jan 2018 12:48:42 +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 74AD9C22212; Fri, 12 Jan 2018 12:42:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 91AF4C2221E; Fri, 12 Jan 2018 12:40:54 +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 3E771C221DC for ; Fri, 12 Jan 2018 12:40:49 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id g75so11925316wme.0 for ; Fri, 12 Jan 2018 04:40:49 -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=bzlqo70ox3kAZ39TlshqaYRMf9OxZ64Z7ef58WdvqsU=; b=X2mnX+e551Sb7k98hjyWKsUl8N2kIF5XKyLh0zxkoXMHbxyv/P1oh+Jx7LKWKUlAxu Ea3ZFSVn+UyeViaXgHH7IFAQDGrtFsvcVwOyWe6cuwsHntTTQks1wuAtfeCIE8v/wnxb WRTsUKh4a+SIwP9+qzFS1a1ojyIMz2Pkpe6mI= 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=bzlqo70ox3kAZ39TlshqaYRMf9OxZ64Z7ef58WdvqsU=; b=WBYy5d9GRE6Q+bJeiBfrDKDzelqOwTVNeJTfVj12gY9FMyHeUgJi2SX9kstOwOAE8K Zgwa1WEbr/aiYz1+mf0aF1OC8hAhgMrJ1uwUsJATnj4fX9G+Ot7BTwQ0IsCkX6eT9+Fu JecTte98vwtuUjEW1wkgTYHN/trf6yXRbxlGyse8UWyjvJe6AI+pNIy9YByRw5+Db6X8 f5KOIEA1i5mje0+AhWZevaMJoV7+uZRw/f1QXIH4PihGCRRleWzczO+vsBcCiyqxzA9z jYzNBavZhP/qMFxai+mFaikPqr1Yz8RPrt9eHPF75gmZD3EUSag02PJh/2Exm+yiGq7q ufMQ== X-Gm-Message-State: AKwxytc2CeX6P6R5jgG5HIIVlWPj3AjV4YubWjhqEC3WtqLtbnVgtPNs +DZTEQEcX627ncaGSYXQx1ZMEWBFVgY= X-Received: by 10.80.137.233 with SMTP id h38mr8145127edh.39.1515760848736; Fri, 12 Jan 2018 04:40:48 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w2sm13893585edb.4.2018.01.12.04.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 04:40:48 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Fri, 12 Jan 2018 12:40:16 +0000 Message-Id: <1515760819-15116-23-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 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 Tested-by: Breno Lima Reviewed-by: Fabio Estevam --- 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 3b19a7e..d1c5f69 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;