From patchwork Fri Apr 13 15:31:07 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: 133387 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp848719ljb; Fri, 13 Apr 2018 08:33:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JSCz6Av97GDd0hzpsHsb079s+LuZ9pc+WS5/XeFGkM3wwuX1ain7Voul8WSqdG60L5AcP X-Received: by 10.80.190.6 with SMTP id a6mr20963727edi.269.1523633618763; Fri, 13 Apr 2018 08:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523633618; cv=none; d=google.com; s=arc-20160816; b=AvUouUEJqV7QQyiTqbRMRpwutummuQVY2rSWrpua/4GzKJcUmG/QE+BWln2Kucl6Fb jFCR0OGXZY4iTy6kLT7h+I1QTPKfXJ4lB/nzjibPOJuXpdXhclwb4wrGsVzq1ARan85f uEFz7OaeeuZgtzLHVvn62TZ3nZhfimYSo1L9QUN4tTOynVhjpaV9fuxABgTB5j9wKibg 0172/42znK39oSCnSBC1QqRqehIIc5GAiiw2/X+k764F+9cu4o2I5/R3bTKG1TFgkcf9 kkzrVeUmvudE0+htipb7SHUy1GBRc8RNp3JNmiEnA7LBDWALSrfuTeacvdiVLw4px33C Lpeg== 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=eIzZDii7kdEy9YiKSVdzGFvuUEOTHGTUmqi6RreS4jvXeTZPhT59Q0N79OHa9P4PDA EuX4MXp74rLuDT9BgGkJsfR1MpSlsn3C/eeH8NX/jZCS+S7bOgV71x09v6fQjcI8YbHz XHsQwoBWT7ESUlMnW47dQ6h9mGJro4XdUqCuCTsbEhKKHkBw/kFy10LR8F5ybC9mFRMN o5uCkta4CQgsGxj8vBu6/R/qiolTg/ezyQLncn3EwD+MyzrixhGrW6KDSuKhtH/k+bY7 jSGCqI2yrkEbWb0d/FwRkPHG0pwfCgcJtZ3JUfd84D2m/Sj5C9Wfct6kikX4Jt/0vjtA QKcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bVNZcJoD; 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 22si1476106edt.374.2018.04.13.08.33.38; Fri, 13 Apr 2018 08:33:38 -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=bVNZcJoD; 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 49B5DC21D4A; Fri, 13 Apr 2018 15:33:04 +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_NONE, RCVD_IN_MSPIKE_H2, 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 AB5A9C21D8E; Fri, 13 Apr 2018 15:31:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F10DCC21C2F; Fri, 13 Apr 2018 15:31:32 +0000 (UTC) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by lists.denx.de (Postfix) with ESMTPS id 57FB2C21DB6 for ; Fri, 13 Apr 2018 15:31:27 +0000 (UTC) Received: by mail-wr0-f176.google.com with SMTP id d1so9151443wrj.13 for ; Fri, 13 Apr 2018 08:31:27 -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=bVNZcJoDl63ZPsc8hbCU9ZJRB+7P6dHDilRSElQO2X0fVjLDyF11HeGdcYH6QKXN+i lc4J1ukFtnHrS1JBbDadCWeulrKSaE0v8nnD+ucaS8KJSHmw1RzkLHydkkjRub7Nv+ij 3vWvBX9r6YqkcEc5uIr4W2Xms67zOdLUTldpw= 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=KlhjpsMR9klOw/wMFUjP+AHqHiDoL1BCD0wkpwXQEGEmnkOlpGLHAYAMDbat9rQjpJ prnaaCSl4+swGcB++iqeIMM4l0e6PR7OKX49m7f5gB7cgUU8MquBl/9ozylFyuqHQ1Io zWTOFiDFBdLrgTj9b7fgim/Zxfmu/1ymtRA+2WIDya5laaCE2K0HldcwVJksDUOitCLD MDO2vh4L6Upi8n5vteLv+EhlPYTZREa4lli9M8lSGMEpCgrrrKIcAthBfxsI5DaY+N1x sMvOMfudEASggjydKXuxCqeVr+PG6qNQAHSPTGcOu0uu6f3O+dfUHkk8lznNmYC/cBb1 9EtA== X-Gm-Message-State: ALQs6tCR9HTuVq7TtD2DgGMSP4V2NsK+maGMKPqRuqv0w3RmbKnbVzL7 8zq9voLkjzs944cGARMh1MApyfgUZa4= X-Received: by 10.80.201.129 with SMTP id w1mr20714167edh.224.1523633486837; Fri, 13 Apr 2018 08:31:26 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id x35sm3516008edx.86.2018.04.13.08.31.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Apr 2018 08:31:26 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com, sbabic@denx.de Date: Fri, 13 Apr 2018 16:31:07 +0100 Message-Id: <1523633481-20914-4-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523633481-20914-1-git-send-email-bryan.odonoghue@linaro.org> References: <1523633481-20914-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 v3 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