From patchwork Fri Jan 12 14:52:20 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: 124354 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2155039qgn; Fri, 12 Jan 2018 06:57:44 -0800 (PST) X-Google-Smtp-Source: ACJfBourLqjzGdmXURZsutt78jL2wV+xaAcqJJRKn/VGKOcowIU5w4xv6D3MZt76XXoui8zK0oft X-Received: by 10.80.213.7 with SMTP id u7mr35360465edi.224.1515769064115; Fri, 12 Jan 2018 06:57:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515769064; cv=none; d=google.com; s=arc-20160816; b=QdsvJA9lW+pB23RGBh6EMUZi0blUTX0BIQjaKkqmrqJs7KwHteEZUzMje4RO8lhMoC LgWsdcPbiayAn+yR/NCCOku/I3Fmh/H1437+FJAcNX4vdVC1H29r67BkEHMs3D5oTyW1 2HI027m0LVuPNWdeV13oQvfk0BW7o136AA5AYUaftmn4EDAT3WpZCuvx/FglDBiDmrFf RPeZAqMN6obdbl0L0vXvRB2bRaTv4vX/P3kuwKk6bJ68m1XEBjVxYTDgS4YI0R8W2wS6 KtMDY/ZaGOZDUklv6f3ntkKs0oQCaRl8al1B/7r5l0LGBeC4/3fUTVByCwZlK1/u7pOw lu7w== 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=BtsymwIaM+9GyGhGmLIkv4uzjvdR3gpOvLcNbVHBmOU=; b=ohOklsw6C2iFBpvvbI9WLGokkm7L2En7VMrYoAdnpKMadNUuRpsaBrXgYPOLN0SNZW RKZZthGwx1krToz59+VGBIwyRXtAuijJRCOb8mjH+wToyPQBmqRCVJWFJANeqXSk6umK A64t1GrtDsPB/Sx5WCni1F5rDJRN9JesOXk1wOfB9aLGQzl/gA+5DFYceeTpJRPX6tLB 1iz/CsXrO76fy9lSUCBKaPYWiALeadbZXmMZOZtPacA0G3WBRgBgfYEe338/3G5ADqO2 4oqEhLyTwTj/Y5R3eeQnC6+ptbo4E4zvJMwe5SHsmcrwnorkcbSbE2DVx6lANLl4ruyZ oFrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dOQ7x61a; 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 5si1287211edb.270.2018.01.12.06.57.43; Fri, 12 Jan 2018 06:57:44 -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=dOQ7x61a; 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 AD839C22288; Fri, 12 Jan 2018 14:57:43 +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_NONE, 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 EDD67C2226A; Fri, 12 Jan 2018 14:52:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 941AEC22271; Fri, 12 Jan 2018 14:52:35 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id C951CC2224B for ; Fri, 12 Jan 2018 14:52:31 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id g1so12589306wmg.2 for ; Fri, 12 Jan 2018 06:52:31 -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=LslhfyvRD0hlsaw/gphME8XZqPOst2lOMiZF+85gVc8=; b=dOQ7x61azDcfuA9scRFzkXTHiqxznvF5yYa9zrIrz8a6u8/dKwpa9wfPWhJY/XjIeB CmCtTYSTyWr8UN/DNZwv/aaz0BJu44aQf2b22zRnkAJcazZbROkScf8tvrL9ZpDxCpSW 3IaUb7D7yWPSXvkAo8EdlxRQud542Y+NPEBWw= 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=LslhfyvRD0hlsaw/gphME8XZqPOst2lOMiZF+85gVc8=; b=g6iHnafTvpQRij8Efh3rShqpM4+s79BJgYX6lxT8qShFzWzDVxoHjolndIQfiYODAh I2LW2JUaez4H2xf+GJ/xTp6Z31CLzuJeqqgn2ARJ0/lwGJOj/YsSVq0BZ4HpaozRFUKp zAOUnyya9X9Z3tE24Ve+uOOGjpZIivyhZFGAZQb2zGMF5QmUdEb4I3MrYmRKP+OUTNnz EQgW+FuTjqJiflXOVFzjDoRpLUJZn5gYEXwwiVnCFNJXDbEx0MlcBaDcgVLA6xm+8ocD St15FMeGMeW58TwC3eIl1Q5bvqgAHiHlYFaoK4UO4HF07MGlVkxqAdJe3YXBvmXuQNdS Kb7w== X-Gm-Message-State: AKGB3mKDrBgt7QcFXyaF8JVrHSgR8bUP1l4nMTarfLk4PviPmyM+SsnC Bj7Qp/yi4jLY1/TGGzDCfJsSzoUB1B0= X-Received: by 10.80.174.67 with SMTP id c61mr35969921edd.121.1515768751324; Fri, 12 Jan 2018 06:52:31 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id d20sm1318629ede.16.2018.01.12.06.52.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jan 2018 06:52:30 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Fri, 12 Jan 2018 14:52:20 +0000 Message-Id: <1515768744-25246-6-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515768744-25246-1-git-send-email-bryan.odonoghue@linaro.org> References: <1515768744-25246-1-git-send-email-bryan.odonoghue@linaro.org> Cc: trini@konsulko.com, harinarayan@ti.com Subject: [U-Boot] [PATCH 5/9] optee: Add optee_image_get_load_addr() 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" This patch adds optee_image_get_load_addr() a helper function used to calculate the load-address of an OPTEE image based on the lower entry-point address given in the OPTEE header. 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 --- include/tee/optee.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/tee/optee.h b/include/tee/optee.h index eb328d3..e782cb0 100644 --- a/include/tee/optee.h +++ b/include/tee/optee.h @@ -36,6 +36,11 @@ static inline uint32_t optee_image_get_entry_point(const image_header_t *hdr) return optee_hdr->init_load_addr_lo; } +static inline uint32_t optee_image_get_load_addr(const image_header_t *hdr) +{ + return optee_image_get_entry_point(hdr) - sizeof(struct optee_header); +} + #if defined(CONFIG_OPTEE) int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start, unsigned long tzdram_len, unsigned long image_len);