From patchwork Sat Dec 30 01:08:53 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: 122980 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5322106qgn; Fri, 29 Dec 2017 17:21:15 -0800 (PST) X-Google-Smtp-Source: ACJfBovHelcEqsyZHepKKTDcXvQ7fa/O3owdnCTLGCuXdt7tDlpMMkr5zDN6yycPkSCmEPkVfXor X-Received: by 10.80.177.188 with SMTP id m57mr47711937edd.178.1514596875482; Fri, 29 Dec 2017 17:21:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514596875; cv=none; d=google.com; s=arc-20160816; b=JzOWuuw4osMJ9hlw/ea6yAFNyaKNdUssUpXm3uj39lE2O5jg4ICRibcgt0HnKP1AAM aDeEwk1TC1zrPzkcVuwfzmxFYiXWVJd8a3lgUiYkJsH6yl6tdUZA5Pnj70Vwgj+toZu+ JK+qB++O+ilDcQYLFFLbbbnwy5qk75T23XwyDKVLfP+mWHMtDKvftiOJch+g68hVdgBr gvnL1HEbi2VNicPB4SByK2KFwsoRMjLsiykJJhW/+Ki855BdIJJLxe9mkGtfPH5d3Pdk KHymQKDZ9FSfPZwpPgIKOYKRJcxIOQxpuuUHpEC0U4sg9GW7dCArPLceYcNcdSl0526T JdEg== 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=m98eucAUHRiyPP24zsfkU+IH0wmj3VMRm7hT4pxYyqM=; b=eaiyfVGpF34ejOcb/0qoX81QlPQuEKDFp9G/caPzI9jG6NIpUcK/bP+9OnwDL8GMPU KdMS5lA58A3lSkbfjiGMhQ5AdOHd+gJLmVKvXpYHQTl/q4ML5xNOwT2/pAu7t2RX0Hr0 mqkTYpzqkPpmGiUmOh492On3yTBwCw2aezvfCxyehg0kPhLdKXpr4g2eAciuGfo8GtBv YZoMzQJfZPiWhLYfPN3NOlI7EgCQJYkbC8t6v0dxf6a8e5Ti0Inri8ZosmFL1GmMzTnC JUICDpVdA2VAMY23OaochAvv75+QrkdOrh6VLI9/qlTSjcbZGYdpq5ncmyi3hoTXTCO7 oLUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dI2Ef96E; 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 u92si920841edc.43.2017.12.29.17.21.15; Fri, 29 Dec 2017 17:21:15 -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=dI2Ef96E; 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 2B077C21E55; Sat, 30 Dec 2017 01:18:46 +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 047C8C21E85; Sat, 30 Dec 2017 01:12:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9963EC21DA3; Sat, 30 Dec 2017 01:09:36 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 4B69FC21DF1 for ; Sat, 30 Dec 2017 01:09:32 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id g130so7017988wme.0 for ; Fri, 29 Dec 2017 17:09:32 -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=NyKnQdFxcTIiKS/iN/TWVLhycjC4fKN7qKNqGeJI2jU=; b=dI2Ef96EJxwZk2YQ/7yntzUCOjwwI3a9AeyldrwDS05mtGaJkdkwXieMNBhEzE1WAT AZsFH+t+Rz8QgcZ70FAb2RwhmNA/k8Xwi0NnE+l1Ywg5s7LMJRR0uMvHagUouwoNoOJu +op7mMkTTL/cbqv33XZaGlzChA506ab0aK18A= 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=NyKnQdFxcTIiKS/iN/TWVLhycjC4fKN7qKNqGeJI2jU=; b=K5g3uTElyab8Pe/wutpOFP+Hx8jOnp+qIp3m02jKD1gS9QSN499UFcPbZa1TdfjCCe IIpKmO/VvRIHPUO8WqzLXxLIm81bjaXYOze6U/fVS7hzgQYuYg+lx1r89lisbHyoUY/p aaOPQzEuKXFVVluOLQCAhCL2dhCuPF7n6MWmb4wxmlp5eDN4vYzKWdGk8lG/7Tn5xC02 kcX/GXYMPGix9znujJ9Jeurar/vl4baNEZ7qKANPrceXZMrFUPmReqPvXjLpusaQGfHX EhgWTQaYsrBGGlocp3fx3/B/dpPaR5MDW08QdQYnZrmQseL1AskIdGeQxtg6tR9UAVT6 AF8g== X-Gm-Message-State: AKGB3mIGhHuz4pmpLquCotkeCv5+hJ82pcqAB/bZqgV7rIuRi2pqLGJC ZRsvC3eXjLNBR6a/iKAEzGVUnl9nlVs= X-Received: by 10.80.231.151 with SMTP id b23mr47334749edn.94.1514596171715; Fri, 29 Dec 2017 17:09:31 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:31 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:53 +0000 Message-Id: <1514596142-22050-25-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 Subject: [U-Boot] [PATCH v3 21/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 fc15254..1f3253e 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;