From patchwork Sat Jan 5 01:51:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 209611 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 34D712C0089 for ; Sat, 5 Jan 2013 12:59:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 44AF54A0FA; Sat, 5 Jan 2013 02:59: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 hM8Qat4QNMPN; Sat, 5 Jan 2013 02:59:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A04474A0FB; Sat, 5 Jan 2013 02:57:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0569E4A0BB for ; Sat, 5 Jan 2013 02:56:52 +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 XAp3GTfoFS-h for ; Sat, 5 Jan 2013 02:56:50 +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-ea0-f201.google.com (mail-ea0-f201.google.com [209.85.215.201]) by theia.denx.de (Postfix) with ESMTPS id 243854A041 for ; Sat, 5 Jan 2013 02:56:38 +0100 (CET) Received: by mail-ea0-f201.google.com with SMTP id b14so1065269eaa.4 for ; Fri, 04 Jan 2013 17:56:37 -0800 (PST) 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=Si2rJp0b7ekE85D2PFxwFV2vE5JQ/imT1EvdJ2JI634=; b=gd8qtq7QBU6DX28FvqmIHr30+/opJN/Eep2TlzxPGnwACMoyFw9TaQLy9kpr+GdaRA CG61O1/Wd8ojHIJ82PbhHgAZm10ZCaSppbKHzlqgCIQhv+BIsN4EhA6Eydmik5md8Pky z4ppl+h/GeTstp8FIvPN4mzkLpQneN+NyjXBd+ZZadeLcr4DNcEj0nkL3Ot0qUS671M3 3NQTUeiI3U9pRkaZnfpnENRUtuEhUyZyMH42ezQA46MWtk/gGl1SmHY2lBm2Vu2uMBg3 WS5wtaIA/Ib3vAfgFNQh9PG8VnUWPWgmWY3+K3J0S3325AfNHrKeRCoXcbuqSTUgMLcv TXwA== X-Received: by 10.14.201.1 with SMTP id a1mr69247508eeo.3.1357350997730; Fri, 04 Jan 2013 17:56:37 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si4922743eeo.1.2013.01.04.17.56.37 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 04 Jan 2013 17:56:37 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 5C8C2200065; Fri, 4 Jan 2013 17:56:37 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id B31A3161161; Fri, 4 Jan 2013 17:56:36 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 4 Jan 2013 17:51:43 -0800 Message-Id: <1357350734-13737-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1357350734-13737-1-git-send-email-sjg@chromium.org> References: <1357350734-13737-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlyqWoOp0s31759PiaUncJvpq0SJ0P3sw/Tp1DT41cR7oklx1rcpC2fL1MU7Fs1JuNb6RiMf3ZHmXURTwNGoNtVxVqf4F6ZoSiG+B3eOmfVhhFwcKe/oypQgwdUBMNtdMYe2mJxkN41LnaB4fPRyvoq3KTK7yAW+7a6uOnT/96n5CZt7Igl3G50nAKIWMeO4ZwkrDaN Cc: Joel A Fernandes , Joe Hershberger , Tom Rini , Vadim Bendebury , =?UTF-8?q?Andreas=20B=C3=A4ck?= Subject: [U-Boot] [RFC PATCH 14/44] 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 --- common/image-fit.c | 8 ++++---- include/image.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/common/image-fit.c b/common/image-fit.c index 19942e2..db5382d 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1322,7 +1322,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; @@ -1352,7 +1352,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); } /** @@ -1371,7 +1371,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); } /** @@ -1390,7 +1390,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 ed351ef..d933bad 100644 --- a/include/image.h +++ b/include/image.h @@ -626,6 +626,21 @@ 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 + * + * 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". + * + * @fit: FIT to check + * @noffset: Offset of conf@xxx node to check + * @prop_name: Property to read from the conf node + */ +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,