From patchwork Mon Apr 2 22:42:02 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: 132678 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3098610ljb; Mon, 2 Apr 2018 15:44:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Xf+B23whrkj7n4HA0Qo7n/GUaC3XR/lr9G2bGMZ9g0iH1ecfc7bLq/RjN7R+ufbDyGzar X-Received: by 10.80.135.233 with SMTP id 38mr14446584edz.8.1522709050747; Mon, 02 Apr 2018 15:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522709050; cv=none; d=google.com; s=arc-20160816; b=ed8RkjO3zIQwAUiBKLiZUBbbq3igJ33OMzaqNF38gfrKkcjSMrJqS57HkDlhcL4rtk GXjjbigKOYOTREUE1Kyc7JdIFGVk3zLvJSHAcDUHsRrfkT47X5wn9Bv1xHBCW7cJDELq dhFanLFvtRt7h4W07XLhYuKNE8Z2exyMs3QYqVkX/E0ToyfGGvmbCxOHPV91qYWEnX/G lNObbQbFos4bCHLcUr6AANAYsuGg5OHQ+NSAekSB5Ug4jvLMRn2gfzuemFMQTiWHidir AAAx+dE2v1qBgih7MBagNfi9HKKzGJhaDn6t+uJaRE/k/g8DPiVofzHbo7E5CkcKXOEm ZnHQ== 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=1IYszOfkYydCuAHasd4AqVpWZ/pV7C0zaSvkM1I0aGo=; b=cslXu5xJa1clm0tKtnCLSQOEEXAjqPVm02FzutLCNrpC2qXMKfb8P0HWO8ToFDf22i T+G4bLibB1Io80hDeBZ/MUjBaeO1WH0D4KGo2Rjmz/xt+mNxKgFAgECRAf0XZ3+obRV2 QamNNzHWqXY0HUzuOZZe3fBJOb7EQE+MkbDpGiV87DvCT1S6QRWgyl17MeJtKbFj4KWT eoThuu//kU0Ur6qZfCd8a3OmR16i+yRguFF2SU7pswTI0+mrFlpFIT5ogVazOEeRIdg8 4r055cWeh54iLjCz9RiyiWhon+34ZBOOUy5W2WQSuicD+Ck/nXMCq6Gy+Ld8d8fYChQO EeGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SHMCNmmn; 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 o13si1050364edh.136.2018.04.02.15.44.10; Mon, 02 Apr 2018 15:44:10 -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=SHMCNmmn; 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 2AFF4C21DB5; Mon, 2 Apr 2018 22:43:03 +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_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 257C1C21E90; Mon, 2 Apr 2018 22:42:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E5B0AC21E90; Mon, 2 Apr 2018 22:42:27 +0000 (UTC) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by lists.denx.de (Postfix) with ESMTPS id 9F21BC21E34 for ; Mon, 2 Apr 2018 22:42:22 +0000 (UTC) Received: by mail-wm0-f42.google.com with SMTP id r82so30718317wme.0 for ; Mon, 02 Apr 2018 15:42:22 -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=h6EqZiKNRXZebAavX1JfxB4zDl1X1AgKjbKEYNfKeEM=; b=SHMCNmmnac9GRKN6XDxB8hh8hnyeAvxmzdDIxju6p1rpeyr1jZOJVaOiCZAVsNahA+ iOF5VLhSS+t9zyj2IyHT3XYrl2RUxKbDDfFpP9Gtr7OiE2p2pjUtzMuN8uYkhvdIXr4+ plKpmHmUfYSxRU3iATwphkM69cyGJrLQL8Kms= 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=h6EqZiKNRXZebAavX1JfxB4zDl1X1AgKjbKEYNfKeEM=; b=UhddMUCN2e0LrGQCGyuBxilySkUWg7deTufggYtzkUrSOSrvXKdHTjiJKck+PgVahh J8S2FGyGl1HtKoLqynk2k5maJHDAJD3UsJm4Qvq8kMaeCbjX79xmEMjBQ/szCyNC2wRM aH4O5qYxE8C6TL35piI5nWfyDE7KBFOzziKMtFYEzkPMYybj6TFwTWzGHr4bWQuxmWwL GVriMx2fa9EhxZHJ9MJdWTpbgDza1/GTGTFGGFL5xa115P0rX7fiz//cBbisqSVScXRU XsdmsxQF/2C0xdP/yvRkFTYu0SlCo3OyqEp7yYHmCPHraALiuoKk4i0T9K3liSOCcR94 mC+g== X-Gm-Message-State: ALQs6tArLf6FJtG9MkoU6DgTTKB65IA7MLgOgxQ42ThNRR7RWGRbQasL OGMSrAcls0HFjYVbXOL2yeYmY6H5fc4= X-Received: by 10.80.232.131 with SMTP id f3mr2249719edn.240.1522708942012; Mon, 02 Apr 2018 15:42:22 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id s8sm842086edk.76.2018.04.02.15.42.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Apr 2018 15:42:21 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com, sbabic@denx.de Date: Mon, 2 Apr 2018 23:42:02 +0100 Message-Id: <1522708936-7603-4-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522708936-7603-1-git-send-email-bryan.odonoghue@linaro.org> References: <1522708936-7603-1-git-send-email-bryan.odonoghue@linaro.org> Cc: breno.lima@nxp.com, rui.silva@linaro.org, paul.liu@linaro.org Subject: [U-Boot] [PATCH v2 03/17] 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 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