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: 132626 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3109081ljb; Fri, 30 Mar 2018 07:30:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4951Q+6gnfuDGWGM+9EdfUZi2rNzYhRNyvjHxIfSJIQbE373w/Ek2QaRwhYR1jwWQln/IEd X-Received: by 10.80.153.206 with SMTP id n14mr3124553edb.303.1522420256588; Fri, 30 Mar 2018 07:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522420256; cv=none; d=google.com; s=arc-20160816; b=WG1xlCVdfBJXnuLpthRBybol5xVVWSJwqKV7dxGCEMO8jHcHpKA1jk3mhMZFQGKR/l hc5w2Puf709HFQVOiTxiiwIJaySU4BosKS13ke7pQ1FYILWbPQ+Lsx63vCoN7Wx/oKr2 5dNukihUG1aFzgHQs9USBuC+9tmm4vjGJXkebOQyjcFpQmFufwfvIa9n10ZAFrH72+oT Cw1cUAT+7Vx3waWn9VYJmMUrmr3mEmpnArswTxfDZqbFGfSj5fBcg07Ike1DO8QzOu7h 57YfqMUEK2B/x9DrqRkPLGyVn8dcspHvbOl8DvNiUeqhbKq69re2/rQ/3EoPC6cdqGJ6 FJyQ== 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=6a/h2n6scH76uOzkI9AJS8AjySg4cWhs66VX9yPA02Y=; b=I4+hVP0GgHYMo5x4/Iw+Cq8ELMsaZKlsFFbodP/uTyMyKiWpM1Q1g7O6RYgqCdI52g kjz3Vvqan694S7GXrd6t/z/EUkEAoyfj1fO8PhdzaWAkMRE5RzJsHGePheG3ljsGn5Ff y1f/0hLadzOU+XVFjCif8/uUh5fMDZJ/HOVexhupMalcprbRrMHttp2EeiyMksinlP7Z rCtcM0WuY6YLmL6zDD/5xD9Bt3HQTiMdeQCuJ5KAJiLIE8sd4AnsLLPgZKtm+hf0jQBo lWj//jnqRe33lVDo35KizesPkjzmOscjQ+mcoKrYr+xXnRgrkl5zec/K2u/IAREbI32F mIWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BrSwUeES; 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 x23si1019134edx.396.2018.03.30.07.30.56; Fri, 30 Mar 2018 07:30:56 -0700 (PDT) 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=BrSwUeES; 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 35FB5C2223D; 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-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