From patchwork Fri Mar 30 14:18:31 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: 893363 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BrSwUeES"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40CPCL1kN8z9sXV for ; Sat, 31 Mar 2018 01:29:26 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 42EFDC2222F; Fri, 30 Mar 2018 14:20:55 +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 4F949C22246; Fri, 30 Mar 2018 14:19:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9A2C7C221D5; Fri, 30 Mar 2018 14:18:56 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by lists.denx.de (Postfix) with ESMTPS id 9DB44C2221D for ; Fri, 30 Mar 2018 14:18:52 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id v21so15927897wmc.1 for ; Fri, 30 Mar 2018 07:18:52 -0700 (PDT) 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=WbpB/64d5Uw1E42Y59Z1rf0rZMHCcRGZaBHYwbCtSsM=; b=BrSwUeESS9SG/u5P+pZPOoB41yI8f/tZ2/1wvnCT62B4Jjy8X9ycHDibKnC2a1hf21 8ujqn0OiuUgye0bkimoanOkuFgPcTokdOu9obLwpXbF8I1znGjLu9eTlx3BHnmfAlazj sN9fOvpyoH2Z1NqYhCTQiMP5TlnoX7kpgVSUY= 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=WbpB/64d5Uw1E42Y59Z1rf0rZMHCcRGZaBHYwbCtSsM=; b=eS5HfOFQe5ZLwPUIs2KgnmsR4Ecs++psmD6KWKPhc1q4j7Dvr6TyTH4nX4m9kJyUMi Hts/Dxal5/fVCsrh+Og4maCWkxYsnEuwSyNci2JO20OaJ/cGTBTdBfIFj35I8y0DDwrr V+LIEQ49Ds+HLAgxMgnXFgGgjQoPwNDwFwfh99PPJmD+kTx2q6wMwO+ObgbNPdez6KGx thWwIvxeQ8GReq1WxlOsrxdzMwmBgZry3ot2OQSvTKInUW9swngZwaHlVvLf2UWEPpI3 HabHsK+QFCuq6S91z5ra0bUrXQLtyl5lhuDXoThyqk4cPu0x309BWOtID9FtaBR4M3q1 wB8A== X-Gm-Message-State: AElRT7ETqJGwKtgQ+YQIpr9t24Q4TLi8heV3ZN1NVc0eWU5BRU1PQXJS eEbkhmVBJAzvC+yCXODJz5QrhPWcnMc= X-Google-Smtp-Source: AIpwx4/RTNvExHvJscjAqzJ/iA1AlCbrItqHO2Wn507nsX5axlXH1ZuMQnjFt4X9VWeW2gJPn0T9jA== X-Received: by 10.80.164.182 with SMTP id w51mr3137143edb.152.1522419532122; Fri, 30 Mar 2018 07:18:52 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id d22sm5831758eda.31.2018.03.30.07.18.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Mar 2018 07:18:51 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com Date: Fri, 30 Mar 2018 15:18:31 +0100 Message-Id: <1522419526-29494-4-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522419526-29494-1-git-send-email-bryan.odonoghue@linaro.org> References: <1522419526-29494-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org, paul.liu@linaro.org Subject: [U-Boot] [PATCH 03/18] warp7: hab: Set environment variable indicating HAB enable 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" 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 --- 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 #include #include +#include #include #include #include @@ -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 0c3b605..c6ab29a 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