From patchwork Mon Jan 8 17:36:25 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: 123778 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3016375qgn; Mon, 8 Jan 2018 09:47:42 -0800 (PST) X-Google-Smtp-Source: ACJfBosx1AyLRQhBOobUuUw4QRFzQUYrmgqxm+zhlULgH97xH8opJOy80A+jMIa2eA73s1TCpXPf X-Received: by 10.80.179.45 with SMTP id q42mr17749312edd.71.1515433662232; Mon, 08 Jan 2018 09:47:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515433662; cv=none; d=google.com; s=arc-20160816; b=o13KvQnqTkT2le5RmNDeL3O7/2gr7vEHojQUKE8Ot7zrCpYq1r4bwNUkbaqMbcW1Sv 3Q1JFBecpzPnNCfGNjkjOgzloMka3MEywzcmcpXjr7iyUDS7WSXxIBYg1xGzNIAESqiG dfKqpKrtnG15K41F3SLkuN5e6wnYlj2U0hvYAgijGvmOF7ww9sB4AjaujKWzRcSVl2le i4t7SZ6Ww8jziRnY+1kN0C2iNaY2qCUAU2UGMrRi5ET9l1+Ee5f+L2rfJsXTiD+3528O NI+BWxYxq0vCDWOBpLuXWAoy32sk6ggXI8c16cjw+gDEneHExFbh1V+blmYgLp0WuwpU ZpbA== 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=wMUOic2TFDmrDvyogVjf9hvh3SaCoaZsPmQv9SLgU/M=; b=Zc/HASB1goQhMXhT4c17ieIYP6mvNsa2OC1XnkI1QHs/UXYRKYQ8vJJsAfQp+Iz6be 6rZEJ1Y1Iou03FvTFPAVQDpZ2hJ5fqINBi0OicPtNUe2gYmTLwsn51ZsmrsRBMFRtyY9 Rv6so4jjAfIAYefX1+uxXRwB70ZrMdxPjjeNw9eMxNZBiWbogtjEQtZ9cioGYz8r4JW0 ZBIjB50ju7IJxq4ZsDG0MWMu3fuBnvbWJJ/862NIUta0lCjH7r4efWUj+EIo1LyU/1sg D0DEFjO1C5W4G4Ty+8btcW2bZcD8MN9L937Rc1ynswHx37si8pn+wqA/umAUJNCv04au ouAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Azwgt81g; 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 94si752428edo.485.2018.01.08.09.47.41; Mon, 08 Jan 2018 09:47:42 -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=Azwgt81g; 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 A8245C21FD5; Mon, 8 Jan 2018 17:38:33 +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 CDCDAC21F1D; Mon, 8 Jan 2018 17:37:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CEDACC21FAD; Mon, 8 Jan 2018 17:36:59 +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 DD1DFC21FB2 for ; Mon, 8 Jan 2018 17:36:55 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id r78so15701436wme.5 for ; Mon, 08 Jan 2018 09:36:55 -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:in-reply-to:references; bh=W3aaLbqI/MaiX5sYMhnL4aKeCAri3WIVr9Implx4W6o=; b=Azwgt81gjklJW5OUtPf69SZ6DXQc6IMHbQHZLQldGnHVhOUBQqcFub+LU3TRuvGkZ5 qgRHwLNMupUi5gjXY3e+jodXa05RhI0w/RIC6UBV68wMCLDe+9CWLZCXH48AnT31rs0u 9hWC1R5cQJU4A1sd59BOkm7iBkBYJlRBaQMeU= 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=W3aaLbqI/MaiX5sYMhnL4aKeCAri3WIVr9Implx4W6o=; b=OPrgRTW62ixQ1T0mkSsUKOsCooo7FT7ZUrwaB7jdF788Zfloxao6WGedy+QPWfQZ5d 5vTHPfyKRokhrLfcZkEZsLsRm2yaBZN5fKZT54IixYWkUOKsAcjfAF1xMkBViu7/e1vS QwzuF01cCdcF8T/sneQvyvAGoCBxmxqli9Uhz/nfe0jwqwxhcQyE47caYG3eElrLj99X /wc8l8xj/A+6Yw+rEQMiDe50R7YbVlDABnZ0IRFQM6mPaP3OASHUumTGbZ4FOhL2lomi 6wqWVaa0qu/eVRgLq/bDk8jOi5a9i5eiXPpG0dixtsGA/TJDrXflTW31ANgqv/HRu6Su DNGg== X-Gm-Message-State: AKGB3mKSCEaROhrhmS4LPTi8tMzSVxhTR7QrzvUl+JcC3R4bddwkPVdB vi7N0v4CiaecIiqr7t5klLL60atR50E= X-Received: by 10.80.159.141 with SMTP id c13mr17221847edf.12.1515433015264; Mon, 08 Jan 2018 09:36:55 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a38sm7160033edf.3.2018.01.08.09.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Jan 2018 09:36:54 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Mon, 8 Jan 2018 17:36:25 +0000 Message-Id: <1515433001-13857-9-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> References: <1515433001-13857-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v5 08/24] arm: imx: hab: Add IVT header definitions 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" The various i.MX BootROMs containing the High Assurance Boot (HAB) block rely on a data structure called the Image Vector Table (IVT) to describe to the BootROM where to locate various data-structures used by HAB during authentication. This patch adds a definition of the IVT header for use in later patches, where we will break the current incorrect dependence on fixed offsets in favour of an IVT described parsing of incoming binaries. Signed-off-by: Bryan O'Donoghue Cc: Stefano Babic Cc: Fabio Estevam Cc: Peng Fan Cc: Albert Aribaud Cc: Sven Ebenfeld Cc: George McCollister Cc: Breno Matheus Lima --- arch/arm/include/asm/mach-imx/hab.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h index b2a8031..28cde38 100644 --- a/arch/arm/include/asm/mach-imx/hab.h +++ b/arch/arm/include/asm/mach-imx/hab.h @@ -10,6 +10,34 @@ #include +/* + * IVT header definitions + * Security Reference Manual for i.MX 7Dual and 7Solo Applications Processors, + * Rev. 0, 03/2017 + * Section : 6.7.1.1 + */ +#define IVT_HEADER_MAGIC 0xD1 +#define IVT_TOTAL_LENGTH 0x20 +#define IVT_HEADER_V1 0x40 +#define IVT_HEADER_V2 0x41 + +struct ivt_header { + uint8_t magic; + uint16_t length; + uint8_t version; +} __attribute__((packed)); + +struct ivt { + struct ivt_header hdr; /* IVT header above */ + uint32_t entry; /* Absolute address of first instruction */ + uint32_t reserved1; /* Reserved should be zero */ + uint32_t dcd; /* Absolute address of the image DCD */ + uint32_t boot; /* Absolute address of the boot data */ + uint32_t self; /* Absolute address of the IVT */ + uint32_t csf; /* Absolute address of the CSF */ + uint32_t reserved2; /* Reserved should be zero */ +}; + /* -------- start of HAB API updates ------------*/ /* The following are taken from HAB4 SIS */