]> git.sur5r.net Git - u-boot/commitdiff
warp7: hab: Set environment variable indicating HAB enable
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 24 Apr 2018 17:46:33 +0000 (18:46 +0100)
committerStefano Babic <sbabic@denx.de>
Thu, 26 Apr 2018 06:52:51 +0000 (08:52 +0200)
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>
Tested-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
board/warp7/warp7.c
include/configs/warp7.h

index 327f656c44c646cf894550ebaabcca1bb505f930..0d3d32457106343e8939813a6bbb7142cb42f0e9 100644 (file)
@@ -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);
index 98fedb89246dacb822e7240f936bb52ab9aad1e9..10db716cff49043b0ab677e8ad2e3260b9acbbeb 100644 (file)
 
 #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