From patchwork Sat Dec 30 01:08:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 122967 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5313978qgn; Fri, 29 Dec 2017 17:09:11 -0800 (PST) X-Google-Smtp-Source: ACJfBotSf8zY/Q5arOxZYXD9QYqfCsKuN8yDvE0z6K6Az3GtUWZa2y5I5jmhNcxHZEnXBtb2JaLs X-Received: by 10.80.153.142 with SMTP id m14mr47013445edb.265.1514596151026; Fri, 29 Dec 2017 17:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514596151; cv=none; d=google.com; s=arc-20160816; b=flJ1IUSRDS9Us7/nmXRUhoOPqrCydaDWBJ/exwMfsSZWBE+PvqxPJRgw0AoJes36Hp Oug+jaPmV7MaJfOdlE0MXeuB82bQfzC4x6icoPA3NSjhJocgorgKNXR/8cpT1efpQQJy aJOlEjjRlTVpUKjnY4m8EP1lr6ffvvM9sUbg5IiSVDOzisU2/GltLp52csMTWte5CCb3 TN2bTQPhdXTRWFECpp/PfiTwGRLz96Do1x4Ecbn6C/tksFH0Mvk019fivdawtpbJ9Lh/ IPjyu/+G5vZG7iVw8G6XxaQqXBJu4UaplwHaBgSfCA2HKSuqIZG6gJHKYqtnIFQ2+Wg+ zzJg== 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:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=jA0Ocbdy959RNAkqP049usZc1lU9YFi3+0046Mr2ulg=; b=nUJiLFszY0FlKrnh6LjWybN++gpfUQ5xe4YgoYfdd7rSLRJlU6FQ24v28vffglGXYf ygF0J5H1bkf8JngFk6ZeQP6AJWPS66sI7GT8TP/p9HgRgMzBHEjVSOOtiYy5qHUFzDa0 bUZbKJb/++bFh9JtvLXuUmrGSokJD4gSp//CS78pXBh+kl9xeWuCbmFKndeBNmvb8sLJ jIdsz0OThVHfGs7djUQPVHiKh8h8ToeARxHzVhExWpP59prLyTxl/lvY/E+721WWEPkE TEZ5uKwHWb+PSQvk9RWnDGGm6RUU+7Ao8SVf+V7u97MDTw/4FBGQPS4inKJEGPr8F6qb f/eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HD4+cNGM; 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 k12si3986393edd.18.2017.12.29.17.09.10; Fri, 29 Dec 2017 17:09:11 -0800 (PST) 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=HD4+cNGM; 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 E2F5EC21D5D; Sat, 30 Dec 2017 01:09:08 +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 896ECC21D5D; Sat, 30 Dec 2017 01:09:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BCD1DC21C59; Sat, 30 Dec 2017 01:09:04 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id 4CF56C21C34 for ; Sat, 30 Dec 2017 01:09:04 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id t8so50410653wmc.3 for ; Fri, 29 Dec 2017 17:09:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gsI1+T3aiZGzL/gj/kbkLYXfarC5NXyISFtREKi99/k=; b=HD4+cNGM3W1epT4DIY4LsWSb+dIXc9Qewy8mwf4jgoo6nLV7sNkkTjpWDxyouRr68G hU5zhRoxyE4WKn95/uIL00r84gTTQ8biUYn8LIcgr87EDbRuNR/1tO+AFhfTOkYfTTqC qViRqHLnRoAYUr4jWmNMhS1O0dkHfMnwl9iiA= 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; bh=gsI1+T3aiZGzL/gj/kbkLYXfarC5NXyISFtREKi99/k=; b=eK2iKm6jZ+5PebEH6mrDLXhB962UcEukzDkmXoo4EhOMWLHme1tDcQd/qVIu1qYjOA j/Af5SlgikvMh6vfpJksLDc4CsYCIciDiE4s+ZpVsx/2vGRt48l0w4GBk8hXiRKRUm6s 41B7lpl6XTdzJPawchHVxtHXHmJtw63lbQKrxOzsrwmSwTvJ+XTUP831XVGui/gVF8Nu jYB+3tDLtJ80CjlmW1RQKWWKJ4X1cCxEv13gsfrZ+Jonhn2k0M35igYojQ2V+GzLDeLr vod9apR4pLFahnrt5r6GTi376HhmPkLwfCsjVT3v/4QvEkeg0EDObb3Rb5El4zuGII5a QKZA== X-Gm-Message-State: AKGB3mKJcTu6Bk072rJXKs5KRkPyJiRPQpZkDbUuW624/W1642BsRVwJ 9FGLNlDKLQMxyYCXAwabxNEtI8gVCRE= X-Received: by 10.80.202.72 with SMTP id e8mr47544173edi.60.1514596143552; Fri, 29 Dec 2017 17:09:03 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id f9sm26484148edm.83.2017.12.29.17.09.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:09:02 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Sat, 30 Dec 2017 01:08:29 +0000 Message-Id: <1514596142-22050-1-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH v3 00/25] Fix and extend i.MX HAB layer 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" v3: - Only call into ROM if headers are verified. - Bryan - Print HAB event log if and only if a call was made to HAB and a meaningful status code has been obtained. - Breno v2: - Fix compilation warnings and errors in SPL highlighted by Breno Matheus Lima - Add CC: Breno Matheus Lima to all patches v1: This patchset updates the i.MX HAB layer in u-boot to fix a list of identified issues and then to add and extend existing functionality. The first block of patches 0001-0006 deal with fixing existing code, - Fixes indentation - Fixes the treatment of input parameters to hab_auth_image. The second block of patches 0007-0013 are about tidying up the HAB code - Remove reliance on hard-coding to specific offsets - IVT header drives locating CSF - Continue to support existing boards Patches 0014 onwards extend out the HAB functionality. - hab_rvt_check_target is a recommended check in the NXP documents to perform prior to hab_rvt_authenticate_image - hab_rvt_failsafe is a useful function to set the board into BootROM USB recovery mode. Bryan O'Donoghue (25): arm: imx: hab: Make authenticate_image return int arm: imx: hab: Fix authenticate_image result code arm: imx: hab: Optimise flow of authenticate_image on is_enabled fail arm: imx: hab: Optimise flow of authenticate_image on hab_entry fail arm: imx: hab: Move IVT_SIZE to hab.h arm: imx: hab: Move CSF_PAD_SIZE to hab.h arm: imx: hab: Fix authenticate_image input parameters arm: imx: hab: Fix authenticate image lockup on MX7 arm: imx: hab: Add IVT header definitions arm: imx: hab: Add IVT header verification arm: imx: hab: Verify IVT self matches calculated address arm: imx: hab: Only call ROM once headers are verified arm: imx: hab: Print CSF based on IVT descriptor arm: imx: hab: Print additional IVT elements during debug arm: imx: hab: Define rvt_check_target() arm: imx: hab: Implement hab_rvt_check_target arm: imx: hab: Add a hab_rvt_check_target to image auth arm: imx: hab: Print HAB event log only after calling ROM arm: imx: hab: Make internal functions and data static arm: imx: hab: Prefix authenticate_image with imx_hab arm: imx: hab: Rename is_hab_enabled imx_hab_is_enabled arm: imx: hab: Make imx_hab_is_enabled global arm: imx: hab: Define rvt_failsafe() arm: imx: hab: Implement hab_rvt_failsafe arm: imx: hab: Add hab_failsafe console command arch/arm/include/asm/mach-imx/hab.h | 46 +++- arch/arm/mach-imx/hab.c | 476 ++++++++++++++++++++++-------------- arch/arm/mach-imx/spl.c | 38 ++- 3 files changed, 369 insertions(+), 191 deletions(-)