From patchwork Thu Dec 28 18:49:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 122856 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3803675qgn; Thu, 28 Dec 2017 10:58:53 -0800 (PST) X-Google-Smtp-Source: ACJfBovJwxMHjg6/770nCjLlLNPIOhEqEh+tZeINSpod+/VyZKRH+h4yo7RpNWKZRRC2q809qKo9 X-Received: by 10.80.177.250 with SMTP id n55mr6805876edd.30.1514487533279; Thu, 28 Dec 2017 10:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514487533; cv=none; d=google.com; s=arc-20160816; b=P9C3cKBNzm0BpTc7PjqidlUuiwmUZJTlwz2qsHaWQy/YM4m9Pog62brs7m35/g/da/ wVYva6G14Nt3K1utzETTw0oTNh/ekP50eWT5csGThAFQ1XYJzwkcK9hT6zBRIpOBGUVf 8FxLfXRSulF1Id72Xl4ESxa5i1HWw8K9HlElRGuyep0UnzpVwKRw2UTPqkuO/UKcg5TE 0To2wEG9QLx3AI+1uKh7w4prY4EaiTVFz1o+pKOmL03YVsYrCuJ+0V2fhQj56NtBVDnd UEWx5IK2Yoo30hkdHzRug2wDfy9W8uNJ27IhLmjuS+Viv0eBHO8ujcb6PSWUocwOsylW MZEg== 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=9ygGMgA9G9oEgXGRhz21oZwTSV5584HRp9HwlRkbI9I=; b=E04gZO7Xzt4/BS1HPfELrN6bZuOvScocYKbcuXFm4xPnsbSVwPand5LAaBRlp/eNSS Rs7irGJzCoFKJWPpgiGZ3kKZtOiIif2S4ub9MIfmzEYPwqHyd/iPPod5m4hJhPWv8H9t wyQng/pOQVDz6RfHmi9B8GmqJUaai99ccezKwtgLBXyLK4d9HIHfzFYJnRgOKepxqtOE rau5NoZg1cMeaNXPBnchMgMyAY/gRwCIKhCPJxehNwaV7YKFQVyUlC14CLWXVsa1TyzR bup7osXD+2WVmeSAQTZ6i6Qt2YpMH4DhrlAg2juMjQdLyH29HSWeR6Y0DM6eHQ2MW28R De9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hr/f5T08; 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 o59si208505edd.98.2017.12.28.10.58.53; Thu, 28 Dec 2017 10:58:53 -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=hr/f5T08; 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 DED1CC21DDA; Thu, 28 Dec 2017 18:53:33 +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_DNSWL_BLOCKED, 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 556F8C21E37; Thu, 28 Dec 2017 18:50:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2B97EC21DE4; Thu, 28 Dec 2017 18:50:12 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id F27DFC21E09 for ; Thu, 28 Dec 2017 18:50:08 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id f140so44992618wmd.2 for ; Thu, 28 Dec 2017 10:50:08 -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=GkVER+7hdyRcUFl+4U3LBuOoPDMfCWlBe59l70l6Po0=; b=hr/f5T08Jg5qvy7v/yvqt/aeCySp74AOKvwQKuOJn9d8fns5o/0j+pUk+hTZ084br3 0zWtCJ/HFyhy4QJk9v/b8Oic10CCvsuFMXu9Dc0jPaoCS+SJj000nuOHrV7/watM/0NV tqVlmweNQimVabRkDW+z8mRAVLvfSWN5jL1Ck= 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=GkVER+7hdyRcUFl+4U3LBuOoPDMfCWlBe59l70l6Po0=; b=iwy76Q3N0jew+bYx8qVI86kKgJz6o8YFVyjDkKDV5jK/TImZ+u6Qbntmqk7gdcr+fH N5XnWWW4l8v4uL8cc5mFudKxZQgBSyvfxBphJBSydddmuQZ3KJVsSl+m1xHIe17+RnzZ +jrDAcVtcUcKNgdkkn7iF/EzOADOVd2m/X2L/gXxNd583VcTh8fu0/lIK/lewL+vqexx v68gweScIzDVfHU4qIFxgin53Tln/Pr+eekFUCCHC4Qg9JTqNwH6AlxTkl9WUtCfNu1U BrYSpEHrO4RXPkxDHNukbfWs1/hiEneEGFEeViidqGItcoi0kFPrtVaZHh+0AZoz7GBo wi5w== X-Gm-Message-State: AKGB3mJ9/VbDo1zCMlIF49Kgw+lyek+FvmFVHWRMeeeJgrp40++3FZrF CtLhlfAiTjLXDHbOWY1RzPdMbrjrWp8= X-Received: by 10.80.240.80 with SMTP id u16mr42122016edl.5.1514487008395; Thu, 28 Dec 2017 10:50:08 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id x28sm35246579edd.0.2017.12.28.10.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Dec 2017 10:50:07 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Thu, 28 Dec 2017 18:49:39 +0000 Message-Id: <1514486982-19059-21-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v2 20/23] 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 a1a13d6..7b50ef5 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;