From patchwork Mon Mar 18 23:51:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 228862 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5E0862C00B1 for ; Tue, 19 Mar 2013 11:00:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 34B4C4A115; Tue, 19 Mar 2013 00:58:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1S5T5HVKwIDO; Tue, 19 Mar 2013 00:58:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F85F4A133; Tue, 19 Mar 2013 00:54:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 744D54A03C for ; Tue, 19 Mar 2013 00:53:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mSO45W6P-xtj for ; Tue, 19 Mar 2013 00:53:39 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-vb0-f73.google.com (mail-vb0-f73.google.com [209.85.212.73]) by theia.denx.de (Postfix) with ESMTPS id 219324A048 for ; Tue, 19 Mar 2013 00:53:22 +0100 (CET) Received: by mail-vb0-f73.google.com with SMTP id fj18so633013vbb.4 for ; Mon, 18 Mar 2013 16:53:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=+gcK7yyQJ/D9SuyuBIsl2bzb8QS9UAWeZYCmuKaXmmk=; b=JxexzSy0T0X8/WISBEk6eJya20IV0V0xf0STaGcO6QefERbcbEf8lPIMvs3jc/6EaA tG8asf17y7JpiOjRd6b7Z9DhPJg3F309sV9Nb/eyCULA+M/LsfqnCcLD7z9aqhQkNtDu VF4gW5kCulNRFdocKWBjxlwB42UMuKt0UFxQBig3aSQnmDOAPAMYM6eMQ6mUMnVewFhv 5woD5T+eo/+fZgDV8qF/mMBxY/Mc57YI/peIIhHLHT22h+T6D8F4l1U/fHe1FMoulqvw znv5cTQgdfO+JxVIIBXNM8Qdt6CodpWreyb51izaCqTHwLauA4SjZ6ASMuKVJ2f12T+a yUEw== X-Received: by 10.58.172.228 with SMTP id bf4mr15877822vec.9.1363650799447; Mon, 18 Mar 2013 16:53:19 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id u21si2190242yhj.0.2013.03.18.16.53.19 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 18 Mar 2013 16:53:19 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 490155A41B0; Mon, 18 Mar 2013 16:53:19 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 27C58160623; Mon, 18 Mar 2013 16:53:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 18 Mar 2013 16:51:34 -0700 Message-Id: <1363650725-30459-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1363650725-30459-1-git-send-email-sjg@chromium.org> References: <1363650725-30459-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkFxYdt2UuUK6MCqtpyhuuDtVYw+kzTZEhNBQ8HKGF62GyXhSuaEFjhrCW+/RiINIy+xBJxFzxf+/7FPZYb3Z2kLbJJdgBVIpg7lbeciOt19WZpf8Wm/mJBcbnw8jrS5wlFxvDAgViw5IqN6txcXOZcaX0MMT0QxLUZIVePqTWwvE9iG2tKXQDxCzjCBH1+riPHObLS Cc: Joel A Fernandes , Will Drewry , Joe Hershberger , u-boot-review@google.com, Bill Richardson , Randall Spangler , Tom Rini , Vadim Bendebury , =?UTF-8?q?Andreas=20B=C3=A4ck?= , Kees Cook Subject: [U-Boot] [PATCH v2 14/45] image: Export fit_conf_get_prop_node() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This function will be needed by signature checking code, so export it, and also add docs. Signed-off-by: Simon Glass --- Changes in v2: - Put params before description in fit_conf_get_prop_node() comment common/image-fit.c | 8 ++++---- include/image.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index 97f8521..b8a1eb4 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1310,7 +1310,7 @@ int fit_conf_get_node(const void *fit, const char *conf_uname) return noffset; } -static int __fit_conf_get_prop_node(const void *fit, int noffset, +int fit_conf_get_prop_node(const void *fit, int noffset, const char *prop_name) { char *uname; @@ -1340,7 +1340,7 @@ static int __fit_conf_get_prop_node(const void *fit, int noffset, */ int fit_conf_get_kernel_node(const void *fit, int noffset) { - return __fit_conf_get_prop_node(fit, noffset, FIT_KERNEL_PROP); + return fit_conf_get_prop_node(fit, noffset, FIT_KERNEL_PROP); } /** @@ -1359,7 +1359,7 @@ int fit_conf_get_kernel_node(const void *fit, int noffset) */ int fit_conf_get_ramdisk_node(const void *fit, int noffset) { - return __fit_conf_get_prop_node(fit, noffset, FIT_RAMDISK_PROP); + return fit_conf_get_prop_node(fit, noffset, FIT_RAMDISK_PROP); } /** @@ -1378,7 +1378,7 @@ int fit_conf_get_ramdisk_node(const void *fit, int noffset) */ int fit_conf_get_fdt_node(const void *fit, int noffset) { - return __fit_conf_get_prop_node(fit, noffset, FIT_FDT_PROP); + return fit_conf_get_prop_node(fit, noffset, FIT_FDT_PROP); } /** diff --git a/include/image.h b/include/image.h index 0d3d1db..c5e8844 100644 --- a/include/image.h +++ b/include/image.h @@ -630,6 +630,20 @@ int fit_conf_get_kernel_node(const void *fit, int noffset); int fit_conf_get_ramdisk_node(const void *fit, int noffset); int fit_conf_get_fdt_node(const void *fit, int noffset); +/** + * fit_conf_get_prop_node() - Get node refered to by a configuration + * @fit: FIT to check + * @noffset: Offset of conf@xxx node to check + * @prop_name: Property to read from the conf node + * + * The conf@ nodes contain references to other nodes, using properties + * like 'kernel = "kernel@1"'. Given such a property name (e.g. "kernel"), + * return the offset of the node referred to (e.g. offset of node + * "/images/kernel@1". + */ +int fit_conf_get_prop_node(const void *fit, int noffset, + const char *prop_name); + void fit_conf_print(const void *fit, int noffset, const char *p); int fit_check_ramdisk(const void *fit, int os_noffset,