From patchwork Wed Dec 27 12:26:03 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: 122790 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2133544qgn; Wed, 27 Dec 2017 04:45:25 -0800 (PST) X-Google-Smtp-Source: ACJfBov8fXO6frvAaV2SfVaRP1ZgAuxgjBNfJK3A29XveYyzPIRVpy8veFaRcxOvPbemg2ombuxy X-Received: by 10.80.186.111 with SMTP id 44mr34949650eds.261.1514378725289; Wed, 27 Dec 2017 04:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514378725; cv=none; d=google.com; s=arc-20160816; b=k2lWSWYZ9xpFpVTmwEu6kq9vs+GSTGA0nMxpJBhqC46I+FllEW1ja1OlD+SrJ5GS1r amkME0BmfFbL5/IgriY87Pn8DLF0JlMcWnnEH9XE6AuCY6129TuYP8uxPb5Lv20Ynzg5 YxlA+S4+uH1Z7sYM4hZ5qcujhT1v94tg/6bHBFHidmFgmezl1a47CWCmje0bhVDmyWdY bdInTJ65a5haY0i0clqAs7bFcNihiXtZAGy8XtmRn/CcxDcJr810j8UxH3dxlnVdt5r5 F+3eE2+7qksX40rCHFfMwUvdgWBxdSHdrFkldYATMtyLNyrBfxPrbu62LXjXZJkfyqrQ BUWg== 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=+RZWNeVpjiEi+TquuJVKalmZdAhscdjnsVZfuPTRH9s=; b=lH+dog+MbQJ7NWstArkZzcquYFXb9tWUBYTZPRB4gz7k9pnCbX90VhaYsp2DSA6Ekt YCzl5FKMa+OSeECP8in0vxOS6gYuZyxmEZcZtxxmlGF87sk7LDxK7fD96gt2+aih3mWi cXvFvtB0ymy1VjLGeKYzFZHg/A60BENkrqlZdm4KBr0K/m3+vATtGgGw2x65W1jlzXAM xpCEMF4sxKFO00b+254e/KI2KVhCH1EPwVOzLJqteXlwkF63UwP9Wm6PJVN4zR1VSmvD CQJB//f0oOs7tF0kV9pnodTlOVFF/6nml4UYcphgKgQzGEfWBbrMNwOwdsRY/M+1YNVL vy5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UNfaubRx; 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 w38si4509717edd.51.2017.12.27.04.45.25; Wed, 27 Dec 2017 04:45:25 -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=UNfaubRx; 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 E3B17C21E4B; Wed, 27 Dec 2017 12:39:24 +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 401B2C21EFF; Wed, 27 Dec 2017 12:33:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F1482C21C34; Wed, 27 Dec 2017 12:26:43 +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 8FA03C21C4A for ; Wed, 27 Dec 2017 12:26:43 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id r78so39361768wme.5 for ; Wed, 27 Dec 2017 04:26:43 -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=nlVZR16izZ9oN610L5cz1llmHALqNVjFPRelgcpfIz0=; b=UNfaubRx87XchyL8qxeZoLcGoBkGiaL8tufN3h+ZJOSHhbOurtaBfCrVcTO9eE7o3k vqOn7dbQ39JYpNTWaVMyJjii7X3nuP50enLug7TK+TVTPXxGpNr3JucDFSuVrs0xbeF3 NpHN/7LxhS7S4nG464xxmqTk9KZV2qaKJoPS4= 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=nlVZR16izZ9oN610L5cz1llmHALqNVjFPRelgcpfIz0=; b=geXtnYKixt7TiugH8AP2Fe0BjAY+3GSJnQtFQQFgEfl3w7jcGgnTRCNbnHv3BXV2F7 PsSeoSSObtMqvpM6DcXSUICI3guSRRLIxypYzVYSxLbDjDIUAo15WbqWbMi6ZRX2nnoO DzfffnmWMB264S0dds5swUAf84hkKSETZaZ8qv7D2a07yds7qIWt+Tc/KRXy5fgdzUSr e6TloLOQnJh4YRugqVSpsEinVMSYEirV4uJldekVzSuUrQwrOCbDiRo38j3BH3oQAs55 O4MzfzXgfsC3Jf5lMipX8kdjxRNpTNTRQ6uBDO8iuX2pbra6VDKCOkzeGw4T8+OCb/df No3w== X-Gm-Message-State: AKGB3mIKiNPCmj25fMq82whxCm9zYHg+q4ppmliu/PaxCPPsIIsccJpD gsszzo1DNZ63bb73Pe1CGsytvRDmkHw= X-Received: by 10.80.240.17 with SMTP id r17mr34410466edl.57.1514377603001; Wed, 27 Dec 2017 04:26:43 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a5sm28388838edm.47.2017.12.27.04.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Dec 2017 04:26:42 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Wed, 27 Dec 2017 12:26:03 +0000 Message-Id: <1514377566-28512-21-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> X-Mailman-Approved-At: Wed, 27 Dec 2017 12:32:58 +0000 Cc: Fabio Estevam Subject: [U-Boot] [PATCH 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 --- 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 749dfa1..9f344a8 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -96,8 +96,6 @@ static 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); - #if !defined(CONFIG_SPL_BUILD) #define MAX_RECORD_BYTES (8*1024) /* 4 kbytes */ @@ -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;