From patchwork Wed Dec 27 12:25:55 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: 122783 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2126054qgn; Wed, 27 Dec 2017 04:37:36 -0800 (PST) X-Google-Smtp-Source: ACJfBotT9XCm4Mq8yJH03EhjTW16RcXpiXSKZdfOjrdggtFlMYW2ou5v4bAMQaxfMABBBu+2oj4r X-Received: by 10.80.190.76 with SMTP id b12mr35012934edi.184.1514378256229; Wed, 27 Dec 2017 04:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514378256; cv=none; d=google.com; s=arc-20160816; b=zvuR9+gAuKuhI80iizlp6Lu3oxlWTqNNGboebx+JFewBg7njWFJsLIWdoCzW9jy0G3 V9Ys/zKLLlEga0S1ctkImno6bhvvl+N50J+80KdVKnMCfcHV2yFcmU4lVcI53hTtgs0o CniZGO4sGF55itVdKYXXwyssQq8rb3LOtQPZTWn0ekVX0On0IU+nTcL3ogz4+LSpIjFX S97ypV7QGVhB7PZl3ea9ztjoihtpzVlAr5vDqJzYIbwJkOozHzn9yazt7bmx6NQQuSn7 TxjLw71jXNsQ96KNYPqXOZ35qCgQyeJb8wh/Ge55K6IV2GbKTUK7wdnGCzK7uZjfe41h sQOw== 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=xOjecpo9Jgckosth5wRZrCn9Gvi1Ci6/zWKjT+zgBKU=; b=C1WPQ4s2dxsMuSdwtibyeV3v9+q3a5SR1as8THStaXP2sYE8F8Sp5Bdg7Khft0Sl3F tQ4gOw37DIUH0dSkH0vmV94lNbLiYxdhwX/nbwt/+nW4rFdsEM2ceNbMeP8p5ENMDWJO 9o13iI8MXPDsoYPgzvLWZt0SO4l1EPIcwyGDbWjbDqoZBjVELt0nEL64OoLdh/u+cP0q cXhkjy3l1ztaLCnJcItRLdkMq630Dj6DrVjwXPJXlFE9vvz1MjLTKKGtdF7ft5YXl70E 1pwV04ttakmVIhqjNDzRWSJzkyiyfEmSrRQtQ1r6P7y9IluID53pOMb8mwF+pU3V506C wttQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Wss5rvDV; 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 l88si1869729edl.104.2017.12.27.04.37.35; Wed, 27 Dec 2017 04:37:36 -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=Wss5rvDV; 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 C2ECBC21C8F; Wed, 27 Dec 2017 12:36:58 +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 9BB19C21DA3; Wed, 27 Dec 2017 12:33:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C4CAC21C8F; Wed, 27 Dec 2017 12:26:34 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id D35EAC21C34 for ; Wed, 27 Dec 2017 12:26:33 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id r78so39361060wme.5 for ; Wed, 27 Dec 2017 04:26:33 -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=CkdnPXfOXQqIS5rrychK13o/iiofDYcfEtfbR4mz924=; b=Wss5rvDVD08wwJJHUSzIEGPmwk1Y5Yd2hWDjp7MSLrteO9IjC0fhqpVG/s8v5ZVXwA 1/bldzJHlGKXu6IYjIipBueKqUV/UeYoke9Yh/ctz5+hxCBN3IH8417+aErwhGtLA8Aj SAqwBnz8LFvK7BJ9tNcDuRDu1oaZixl6QX8NY= 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=CkdnPXfOXQqIS5rrychK13o/iiofDYcfEtfbR4mz924=; b=rHJdt+fLGURKw71cga4eGpmZSua2AzyVIzCjdPXIszfI6qIWnoT/deon3CLhnU4tLN /2+IeEyGXmfDiiPwwZ7nQP/9di+w1mdX5ZWPaIWdOdQt4Cwhgon51beVPzP3k2VKvt/K DRSG2AVsJfDV51GaqvHTTV4k69NcPqxjD68Be41Tv+VNzWlOlD4BXb+g5tO92oRj+3h7 Dn3BqiJK8Q6PdrQ10MFtDG4bxZ9eWjncLbh40038v6iNE30Z3iUqFnnF1lcWkuzRSxAc Gk+te3CoaYI8xABgGWrT9dyEF6Hte9KqWp3+u5q0sPt794rlG70V6Atb6aVZM2GDRySt O5QA== X-Gm-Message-State: AKGB3mJXgcP6yLtTwMe0GKJfPjSV0NUXdDvGlMeF22vlQe940c/3iHX+ jGwhK7hAcUHEuEUsOyanRvdVPe+9E+w= X-Received: by 10.80.145.81 with SMTP id f17mr35496568eda.215.1514377593266; Wed, 27 Dec 2017 04:26:33 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a5sm28388838edm.47.2017.12.27.04.26.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Dec 2017 04:26:32 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Wed, 27 Dec 2017 12:25:55 +0000 Message-Id: <1514377566-28512-13-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> References: <1514377566-28512-1-git-send-email-bryan.odonoghue@linaro.org> X-Mailman-Approved-At: Wed, 27 Dec 2017 12:32:58 +0000 Cc: Fabio Estevam Subject: [U-Boot] [PATCH 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 --- 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 8ac4f92..e59e105 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();