From patchwork Sat Dec 30 01:08:56 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: 122977 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5321521qgn; Fri, 29 Dec 2017 17:20:19 -0800 (PST) X-Google-Smtp-Source: ACJfBou6gwfXNmFHXXFqwM14C5JILnUVlzsc9oFxtBFfAnqIrsTMxl6+mW9rxnT4vt0PSiMUIIs9 X-Received: by 10.80.137.106 with SMTP id f39mr48688003edf.148.1514596819628; Fri, 29 Dec 2017 17:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514596819; cv=none; d=google.com; s=arc-20160816; b=QG5zBE8kgI0PQMVN7l8jUkkrGbtGYz5e6mes/ZeIHQuHnVAawkZzVqJ79R5lFleGx+ x0KmUNuZTBS3XzwTrooNspIY4LUWgjTo3y9v+We/YXui6Vy+YYgjY9KdrjQ/lPIVd1Qt p0VGgkLnJTm851jIuNEg1gUMazSccd7Al26CZV8qxg3U4EGnxY73t30+Za5HvhWWDmvB O/AjodxoleJEu6VLlGj8TattmnUdbNVmAYavvUbQHTG0ufRCxUJyLaGYWJT2U78oNS7U txe5jD+Xm8Q0jzKBrTLMr496+F5VUTr4TVWDc71xurOM2zfsg89t/mvYl5JTI3E+Jgj2 BNrA== 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=ods2pVmJ8Q4ttxfbNwHzyhyLUHC+yxbvvcWpcU0kTAukUVtX8SqS3zaCW7Z28rPplC 7kiibjXwhKUt7tmCz6r4mlCVLO94ylzhjpAaKDtO5uUaJJjveQ/BkjXE8OUZFw3o7rWq oH7DA6TQLsKdHt9XQNUSqDWAxzSgzVZgKgegTudWhxXce4240kmGtFCELf8q+Xb7K3Te TqkOrabpgGPJt+yT4ZmAIHlkL9bBhMgjaDMq/VrqNERKgi08RlXhdELylEW1FCa6B70x RKet00lQkfMt3Lfr/JtU82T9BipCBlGR8fyk4sMKG2jKQnRQIycvn02oN7UjOTJxkc/U U0jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gRW40mjy; 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 g32si2325876ede.546.2017.12.29.17.20.19; Fri, 29 Dec 2017 17:20:19 -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=gRW40mjy; 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 37E30C21E39; Sat, 30 Dec 2017 01:17:51 +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 E0158C21E8A; Sat, 30 Dec 2017 01:11:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2F504C21E63; Sat, 30 Dec 2017 01:09:39 +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 979ACC21DCE for ; Sat, 30 Dec 2017 01:09:35 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id a79so11259689wma.0 for ; Fri, 29 Dec 2017 17:09:35 -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=gRW40mjygIpX4gb/jxoJfGOw4vK7AfOKl/ksHt9GbYQUsunGpnVDGCa7a8WZylUtOM sLp02E77dvKAXmtHsglbiMZlCfJrcPqrwwKDMmguXhGL+WH+oBkEjwVzVntzni1JNMAs 2U6n/o60HQ2XRfyHRu67U3A3VV3Z29aBjWqA0= 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=Co9ba39m7JdckYjKXQLyJXWz6xh0gRta/GFqsozpafAPIfqclkqg07AUOAWmHXMgl4 aNvUc7g7EqhS0toB0hqazLYlb4ZxhjIC8QMH9mOZmYnZ7eEeB2ymcPE4yAM4fg61CJSb qis31LCKJi7XqMvi7PJJFoXBpQ0kCZTFx7odlDB05yLpD3fWAE9tMrWkS5MVqt8V8BOv r2w3flnbrfAg/cOKHWs2u7a6dSUMqwQvevNiyNqzq99G5b8QHd44nPdXywImL3jOZT7y Vqs6HxveIV0IwGioP5RYW0nq0rIFjYy6V9xYWcULxw/K6wK3BlRaIX7i81TGRgJC/TgZ 4hUg== X-Gm-Message-State: AKGB3mKzt64IZXbP395bS1/9dgEiy0W8i09mhmfFBEvmvVuoO/Glmxax 3APVeQIdGpj4nfXwCnCCgixgvRLg304= X-Received: by 10.80.182.148 with SMTP id d20mr31706734ede.63.1514596175062; Fri, 29 Dec 2017 17:09:35 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:34 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:56 +0000 Message-Id: <1514596142-22050-28-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 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;