From patchwork Mon Jan 8 17:36:38 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: 123780 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3016966qgn; Mon, 8 Jan 2018 09:48:15 -0800 (PST) X-Google-Smtp-Source: ACJfBou+LZekq0rwpLvd8qhGRbYga3fFy9Ucsp7l9zUO2Fylqnq67+2oI2fvEa5B27wLk501mGcP X-Received: by 10.80.164.169 with SMTP id w38mr17232883edb.154.1515433695090; Mon, 08 Jan 2018 09:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515433695; cv=none; d=google.com; s=arc-20160816; b=rWWqPLXmVE3JKZMWA2jAgtY7D7O4PszYZSvuPfrx1cHvKNxXziiINveyglVYHghSaO ixM2JfI7378PliNgNYrxiXUMEfYLkV1Ce8EfPuvBoIrd/ZMIRZLvn9wOYakMxryi68XG qB9I+TbcadirT7g6vvy5qiAwUeUtA0PZz7oTrUPLbG6Q3c853T8t1i8GAiX9Vc3u/Cuh CsLjec1IB3jNM3w2oiDH9PzYNjx9KgqQkLDtnjkjyd7lZ1z/RiIpcZVCbdUKU+fXoMZJ co1+DU0Yb0wzTUxKKrn6lz/q2x8khJ7XMY3knLbM7kIPggXoEtFiVEuJYydyjgeN6aTD XNMw== 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=R1sTE8ZbVOpiILZyGlQKjH9kno3AWVf2RTC/Po96NK0=; b=tN5jVDfQYiTRw3LAD0+nj+e+ltzU6ce/W+yk2+zeCzdLDHFVcRsP8PxEVKLOGPOBik ibx7/ZL+1Q+5Xw22zaOjD1U4bJc5lfVjnyfUG4sUjoUddWTIALRfhCRAMwCB1g6b2++D m7d77PKBvtqZLDxeu2ya+hil7YYU4PISHbi2rp6OiNlc1KWl2fz3OWmj1Le6fkF+4Zfx 8owqKQlLwTDwzIUBaPVtpLX7mCgyjSc2oZw22rZI0LeFSQ2Pny5/Y+jpEINVTI5W5Bfo 5EFQNSnbt4dhxE+ymvEUqqaG+CflkI56AF22GfH4BuG/yw8OtWcKC4MTuTAELU/1DuJ0 01Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Jy96ZZEQ; 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 i93si2229368edi.281.2018.01.08.09.48.14; Mon, 08 Jan 2018 09:48: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=Jy96ZZEQ; 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 A0125C21FC7; Mon, 8 Jan 2018 17:42:17 +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 30211C21FE6; Mon, 8 Jan 2018 17:38:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 607DFC21F74; Mon, 8 Jan 2018 17:37:15 +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 7EB23C21FA6 for ; Mon, 8 Jan 2018 17:37:11 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id b141so15724457wme.1 for ; Mon, 08 Jan 2018 09:37:11 -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=umGmZEjot344qOI5ziRpJJ80+Fs+00BhzDmOISm0mco=; b=Jy96ZZEQKlO+R+8Q7mzYscBjY18yJoFCa+O0DLaVWBBcca1YPx7r84jhS4PkuVCRSg nqy6BPvZVMKXF/vyRyNHw8zj/S8Q23MoTPEmzIVarhNAdQV7+zO4HmS480b7UAHves/4 FMxO2MYtFxTwfLqhIhLOjg03i3kBwMb3uOIy0= 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=umGmZEjot344qOI5ziRpJJ80+Fs+00BhzDmOISm0mco=; b=Ni4hX9nMMuoHIzS082og689c5Z4wS6rNScjf2tihViLb1Z3RR39axgV1+gsdx6wpIR hzsvQX4YqzF+yhXIQioeve0iJIjubxsp57/kkZDQ55fkeXY9Aq3PkRGVFSPY9cKCoRLX glQOo+3uHng9sgBuxDxY97Z2vgikZVWhWnvSEuLNQq18qTZNhfN8dTPH2PPQe7lgUHSc aDlH/qiuJZwA5RmqZPQeLAyyA0clx+OQriKX+b6xh0aY5yQ7EVBx632tAX3JR0hD7TJG B8Iefub6hULkv/ZG9mItJJZDr/2kpWFza3jlP1y6TE98ws6iWX47Rx9dyiItHcZqlrk8 HXPg== X-Gm-Message-State: AKGB3mItAL3pUX2TY4NUffgzwzV9455gEqz5/YTdcxyvvNmBmJaNtJfi HgS30bcNXm/x78LhJuT/wlMqEG7bKW8= X-Received: by 10.80.145.252 with SMTP id h57mr17264572eda.19.1515433030888; Mon, 08 Jan 2018 09:37:10 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a38sm7160033edf.3.2018.01.08.09.37.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jan 2018 09:37:10 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Mon, 8 Jan 2018 17:36:38 +0000 Message-Id: <1515433001-13857-22-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> References: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v5 21/24] 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 d917ac3..86b4018 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;