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: 856965 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Azwgt81g"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zFjHN5Cl7z9s4s for ; Tue, 9 Jan 2018 04:41:04 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 5A47CC21FDB; Mon, 8 Jan 2018 17:38:34 +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-Google-Smtp-Source: ACJfBov+kFuh56vDfD2UPA1FqCbGs+WEYgf2vAVz1wv6I2icivDBZv4Nzd1J/noqeFGw4oBrEF0g5w== 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 */