From patchwork Thu Dec 28 18:49:31 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: 122861 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3806167qgn; Thu, 28 Dec 2017 11:01:14 -0800 (PST) X-Google-Smtp-Source: ACJfBov36LAT6go/HxNLSToaryjS8cCPyzukmU1HrwO1dCCygSIEdC8d5VQkrVdgwIQfn9qmQ8M7 X-Received: by 10.80.241.72 with SMTP id z8mr41941795edl.35.1514487674009; Thu, 28 Dec 2017 11:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514487674; cv=none; d=google.com; s=arc-20160816; b=0ejcG8+h6tl7OqOWrihkNNP9SNMGS10OYn8FSs5jeayh0+ak/DIrf2zWfP2+znFtJR si633MMVFIQjFh9ef+smIPu04FI8HkTOZJfR3mUZNd9bA3QBx0q5jrEPK9e5Tr0m9GyI uvt6PSzDNiEvNiKO7zWnsElBgWlBUXJKvOAbr88xz0Af76y+SXnz66htR84ZDx9FcIY4 fVEAExnICmQmCPhWmM9txK5r6g6kwEVmJrl9OvWqqfxy4jE+0ByZxWrTJdacvQjsOORN mFCE5Zwt3AeuH9haxYVtiwl6xpGzn7WjaVN816Oypjg1fZVEtrO2a19SN9FZBNaoTQ/W kWJw== 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=MMzCGQKpDFcDk93IVE/DWfP/1fpC1U5PBBifuJl57yg=; b=v2vucOaKZXkc4C0bJk7yMB8kEeM34IYlOyjkFxWZAzZPJPt0Om7895+Qw07rGx5LwB x6YU5kKA79cLbHJkiY/UmPk9mF78pPtKfi1Wc11I5U50cMxKoQWui1fQEXwev3sl7qHU bJPKw0X3AnLeFV4C3/kQqKwqdXvuMj7qGgnBFNoQxOhpocA5t5LeWs1vS2C5gJzS687x Q/m1H056stkHcrgE9Ketnmsq6jfyMknfjfa5CnYRxd8PjxleKuAokyryYLQcq4KQoJs2 l/s+5sqndPSlS/elFj1FqDIH+LMikBIuVPm7LcSMvIZA859Rrwyi5Xt0RADNa57aGhUY WLHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MnFQx9LS; 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 c27si6734079ede.367.2017.12.28.11.01.13; Thu, 28 Dec 2017 11:01:13 -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=MnFQx9LS; 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 2CCE6C21DC1; Thu, 28 Dec 2017 18:55:53 +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 3AA07C21E30; Thu, 28 Dec 2017 18:51:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1AD0AC21E30; Thu, 28 Dec 2017 18:50:02 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id 10869C21DE8 for ; Thu, 28 Dec 2017 18:49:59 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id b76so45281861wmg.1 for ; Thu, 28 Dec 2017 10:49:59 -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=TcsPXXKd1/3qHv5EDureQHo50P6uMW97nTiFPAmub0M=; b=MnFQx9LSSc1xCKsV0p1mfshmFWaw26ZF/BjoLfBKgu4tSWcA2OFd0Djkxmkvmp7OqP fz6Y6KewqfKCsCeOj2FrKjbvBu4707BN7GMb3ybi6E7vvfR43vCJ/F11KuRkswmwW6FQ aCd5lpFs9aCAUL9tDSgzkvTZ4FLD6ocC9A4uI= 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=TcsPXXKd1/3qHv5EDureQHo50P6uMW97nTiFPAmub0M=; b=bvt0ggY1VK3+rvUETQ3ufPXxSeSM6HUEcjn7yqxO64W1QjHgjJ98GuCWbXcP4dQO29 QoZ0amEgMR7dEJTHldcaKaXp/Gwl77xMsMTTVfWCSAZK7jW/VMyTKAYq9irwslkamh2S OPvLSzUiW9ClHcJsFELmGa1AUH+QBn4rCjm31IlVvnQIGFr9hGHkyTaVzouj9Oc9JLCd aN7snRlf/9DSqFGM/uRoSKN6chPe3X89+uQ64RXKsgDQZVQeh8Mnv/15WHkA0217mEHb gOlxSHjysGZG8AsQ6ML/46v8peb1g6MZSwyMurvg9J8CSaECUpKZDM8xTY3rmEVBwcp7 a3wQ== X-Gm-Message-State: AKGB3mJJkXhkw1nHxCz5UxCqdRHGxGMB45lr2uZLbSaBLX26nh6vmdpH bjl3hR4ACCToBIhpd0DVXY8UNOk3Lo0= X-Received: by 10.80.165.139 with SMTP id a11mr41965138edc.95.1514486998417; Thu, 28 Dec 2017 10:49:58 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id x28sm35246579edd.0.2017.12.28.10.49.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Dec 2017 10:49:57 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, brenomatheus@gmail.com Date: Thu, 28 Dec 2017 18:49:31 +0000 Message-Id: <1514486982-19059-13-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514486982-19059-1-git-send-email-bryan.odonoghue@linaro.org> Cc: Fabio Estevam Subject: [U-Boot] [PATCH v2 12/23] arm: imx: hab: Print CSF based on IVT descriptor 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 IVT gives the absolute address of the CSF. There is no requirement for the CSF to be located adjacent to the IVT so lets use the address provided in the IVT header instead of the fixed CSF offset currently in place. Its worth noting if you use u-boot mkimage and the i.MX CST tool as described in the NXP documentation you will get an image like IVT | BINARY | CSF not IVT | CSF | BINARY as the code currently assumes. The IVT header must correctly describe the location of the CSF or the BootROM will reject it - so the current dependence on a fixed offset is nothing except limiting. Fix it now. 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/mach-imx/hab.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c index 479ed96..d620524 100644 --- a/arch/arm/mach-imx/hab.c +++ b/arch/arm/mach-imx/hab.c @@ -465,8 +465,7 @@ int authenticate_image(uint32_t ddr_start, uint32_t image_size, print_buffer(ivt_addr, (void *)(ivt_addr), 4, 0x8, 0); puts("Dumping CSF Header\n"); - print_buffer(ivt_addr + IVT_SIZE, (void *)(ivt_addr + IVT_SIZE), 4, - 0x10, 0); + print_buffer(ivt->csf, (void *)(ivt->csf), 4, 0x10, 0); #if !defined(CONFIG_SPL_BUILD) get_hab_status();