From patchwork Fri Jan 19 19:43: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: 125220 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp444174ljf; Fri, 19 Jan 2018 11:47:51 -0800 (PST) X-Google-Smtp-Source: AH8x225dCEVmC1SLTSngISB8t4hLwxDCeLd5p399eDW6cdUPDkdAyGlHW/pfoSopOgyWEZz2uV5p X-Received: by 10.80.215.91 with SMTP id i27mr45040edj.95.1516391271118; Fri, 19 Jan 2018 11:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516391271; cv=none; d=google.com; s=arc-20160816; b=UGsrf/E7Sh7gFojRvL4vwbsU9yx9J8/XRtiwoy4W20ibsUrufZarfMk5DrPiIHibq8 OUzOjnM9n/etpWcVC+GJl9Hy8Twpd2ija63xreamfB0DhIracVKDl+5P7u9GZWw0rpQs DVKjZQ+mcWQ0R5S3RV85YbkjD7GexAhEcIt3SQskIXqa1HYCJx8QwgvEML35EAJ2Xt9E HzM7DzvGXWiDIxhpSE60aTiPWqCZicGvx4hENKjKqBWdkQx83gB+CCvS7+x4KfO1rMEv rTyUT8vWBq3QQFqc+QrSofIwVRHNTJ95BB2SaNET3dYtbYqT82ssDNqyQc8P04GmwMAa BTDQ== 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=9SeYNN7fAzc9ye43F64/zjFVwEPTVm8fj91KG77oSig=; b=FhPHe5Im0iE2FHzRGV50T9jl+H8l9ykHIopgpcibtesOK786kfq30tF/wLvxP8XdhP zfShmeFDBjgfiJBu6lhA8gVrMHhAcSvB6mNfCTU3BODVHoeuDKS9r/X1au/dW30Uwfb5 HrN5hwEcrXoSPn13wxtBu2uDqhUp8tMix2NZXz04YLbaT62S19nZMFu0Q3gr4m74ZTRr ANGpCAR19bf185oCMuTsvjseiCYOj79qEdkPmIz54iUUxYJ+N1tEt0UYgKolPJxZyJUZ 1KZUkn9fDjbEUTY2xzEIz1Xvf9kOyRTSydSdJzUGcRvoWDYfzpTVH0KxLvr6ldjPl9d0 PQ/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CuMqA1Dd; 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 h61si158271edc.183.2018.01.19.11.47.50; Fri, 19 Jan 2018 11:47:51 -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=CuMqA1Dd; 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 9CD93C21F8A; Fri, 19 Jan 2018 19:44:55 +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 0A5F5C21F81; Fri, 19 Jan 2018 19:43:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 28B53C21DDF; Fri, 19 Jan 2018 19:43:44 +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 725A8C21F53 for ; Fri, 19 Jan 2018 19:43:40 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id b21so5705154wme.4 for ; Fri, 19 Jan 2018 11:43:40 -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=ESPTwR3kNFGmQZLp6cbr7Sd9trs1Y1G/LXwiNCzV96k=; b=CuMqA1Ddj5218vbWPoMknhkxeqcZnOqxVHXOYYbt9l2Bu7LRTYJRqxlR2ts8hNQack aRHNJe7oEzHRVA+5vg7AL3YAt7/t2v3xSp1fmO53i1SnPTpr8ThGF2hwoUkLA2tnkFks Pn5n9XCx89DZ6BtcCRco21oBCA+AgytQki9Nk= 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=ESPTwR3kNFGmQZLp6cbr7Sd9trs1Y1G/LXwiNCzV96k=; b=tTb7iY2fkQn1qvlGKW1OYXb1+Ciwfgj4mVHPAMGHG+kOdmONnWjmyrb1EUL3k1Mn8p lg0ojysNJiEdP3lav+FexduEjtsH/715zNLa2nmjdXmZkDyaZndalkElmgwjf28vicz8 r+Bf/vVR5A4/HpACxBdN6oYNN+h3YNr+9xYw4AenE5zMxYQHvAfuaW/xWbazYCFYkwCJ e0yKMWm+fJ33Tm8jWA4gUmDyvCAYTmnfqX9Zyhjl+e548K9RgA/opwYdV1wo+3LprCO/ qaHaEDeqd91wLo5yE8u02iiA/jp245u5ObANtaVQugr3bqSMbTdNV0BgaxSZgFDf64uN OkSA== X-Gm-Message-State: AKwxytcMVao/9qkafVenQEs1Im4lv786ljSgg4ikd1kpU+WzvNEUVpxC UNVvv67p7D7XxJ5xadVm5ZyMJrKoT5w= X-Received: by 10.80.175.102 with SMTP id g93mr57180edd.156.1516391019875; Fri, 19 Jan 2018 11:43:39 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id p6sm5936051edh.68.2018.01.19.11.43.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jan 2018 11:43:39 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de, trini@konsulko.com Date: Fri, 19 Jan 2018 19:43:25 +0000 Message-Id: <1516391006-22483-9-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516391006-22483-1-git-send-email-bryan.odonoghue@linaro.org> References: <1516391006-22483-1-git-send-email-bryan.odonoghue@linaro.org> Cc: harinarayan@ti.com Subject: [U-Boot] [PATCH v2 8/9] optee: Improve error printout 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" When encountering an error in OPTEE verification print out the address of the header and image. Signed-off-by: Bryan O'Donoghue Cc: Harinarayan Bhatta Cc: Andrew F. Davis Cc: Tom Rini Cc: Kever Yang Cc: Philipp Tomsich Cc: Peng Fan Tested-by: Peng Fan --- lib/optee/optee.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/optee/optee.c b/lib/optee/optee.c index e28627d..78a15e8 100644 --- a/lib/optee/optee.c +++ b/lib/optee/optee.c @@ -8,9 +8,11 @@ #include #include -#define optee_hdr_err_msg "OPTEE verification error tzdram 0x%08lx-0x%08lx " \ - "header 0x%08x-0x%08x size=0x%08lx arch=0x%08x" \ - "uimage params 0x%08lx-0x%08lx\n" +#define optee_hdr_err_msg \ + "OPTEE verification error:" \ + "\n\thdr=%p image=0x%08lx magic=0x%08x tzdram 0x%08lx-0x%08lx " \ + "\n\theader lo=0x%08x hi=0x%08x size=0x%08lx arch=0x%08x" \ + "\n\tuimage params 0x%08lx-0x%08lx\n" int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start, unsigned long tzdram_len, unsigned long image_len) @@ -55,9 +57,10 @@ int optee_verify_bootm_image(unsigned long image_addr, return ret; error: - printf(optee_hdr_err_msg, tzdram_start, tzdram_start + tzdram_len, - hdr->init_load_addr_lo, hdr->init_load_addr_hi, image_len, - hdr->arch, image_load_addr, image_load_addr + image_len); + printf(optee_hdr_err_msg, hdr, image_addr, hdr->magic, tzdram_start, + tzdram_start + tzdram_len, hdr->init_load_addr_lo, + hdr->init_load_addr_hi, image_len, hdr->arch, image_load_addr, + image_load_addr + image_len); return ret; }