All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 03/17] warp7: hab: Set environment variable indicating HAB enable
Date: Mon,  2 Apr 2018 23:42:02 +0100	[thread overview]
Message-ID: <1522708936-7603-4-git-send-email-bryan.odonoghue@linaro.org> (raw)
In-Reply-To: <1522708936-7603-1-git-send-email-bryan.odonoghue@linaro.org>

This patch adds an environment variable called "hab_enabled" which gets set
to a boolean status indicating whether HAB is enabled or not.

Subsequent patches can use this environment variable to determine if its
necessary to run a given binary through the hab_auth_img console command.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 board/warp7/warp7.c     | 8 ++++++++
 include/configs/warp7.h | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 327f656..0d3d324 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -10,6 +10,7 @@
 #include <asm/arch/mx7-pins.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
+#include <asm/mach-imx/hab.h>
 #include <asm/mach-imx/iomux-v3.h>
 #include <asm/mach-imx/mxc_i2c.h>
 #include <asm/io.h>
@@ -203,6 +204,13 @@ int board_late_init(void)
 	 */
 	clrsetbits_le16(&wdog->wcr, 0, 0x10);
 
+#ifdef CONFIG_SECURE_BOOT
+	/* Determine HAB state */
+	env_set_ulong(HAB_ENABLED_ENVNAME, imx_hab_is_enabled());
+#else
+	env_set_ulong(HAB_ENABLED_ENVNAME, 0);
+#endif
+
 #ifdef CONFIG_SERIAL_TAG
 	/* Set serial# standard environment variable based on OTP settings */
 	get_board_serial(&serialnr);
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 98fedb8..10db716 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -139,4 +139,7 @@
 
 #define CONFIG_USBNET_DEV_ADDR		"de:ad:be:af:00:01"
 
+/* Environment variable name to represent HAB enable state */
+#define HAB_ENABLED_ENVNAME		"hab_enabled"
+
 #endif
-- 
2.7.4

  parent reply	other threads:[~2018-04-02 22:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 22:41 [U-Boot] [PATCH v2 00/17] warp7: Enable automated OPTEE/HAB boot flow Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 01/17] imximage: Specify default IVT offset in IMX image Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 02/17] warp7: hab: Add a CSF location definition Bryan O'Donoghue
2018-04-02 22:42 ` Bryan O'Donoghue [this message]
2018-04-02 22:42 ` [U-Boot] [PATCH v2 04/17] warp7: defconfig: Enable OPTEE for WaRP7 Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 05/17] warp7: Allocate specific region of memory to OPTEE Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 06/17] warp7: Print out the OPTEE DRAM region Bryan O'Donoghue
2018-04-07 12:36   ` Breno Matheus Lima
2018-04-08 11:21     ` Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 07/17] warp7: Specify CONFIG_OPTEE_LOAD_ADDR Bryan O'Donoghue
2018-04-07 12:23   ` Breno Matheus Lima
2018-04-13 15:11     ` Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 08/17] warp7: defconfig: Enable CONFIG_SECURE_BOOT Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 09/17] warp7: defconfig: Enable CONFIG_BOOTM_TEE Bryan O'Donoghue
2018-04-07 12:32   ` Breno Matheus Lima
2018-04-08 11:40     ` Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 10/17] warp7: Make CONFIG_SYS_FDT_ADDR a define Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 11/17] warp7: Add Kconfig WARP7_ROOT_PART Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 12/17] warp7: select uuid partition based on rootpart Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 13/17] warp7: Define the name of a signed boot-script file Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 14/17] warp7: add warp7_auth_or_fail Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 15/17] warp7: hab: Set environment variable indicating IVT offset Bryan O'Donoghue
2018-04-02 22:42 ` [U-Boot] [PATCH v2 16/17] warp7: defconfig: Enable CMD_SETEXPR Bryan O'Donoghue
2018-04-07 12:28   ` Breno Matheus Lima
2018-04-02 22:42 ` [U-Boot] [PATCH v2 17/17] warp7: Add support for automated secure boot.scr verification Bryan O'Donoghue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522708936-7603-4-git-send-email-bryan.odonoghue@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.