From patchwork Tue Aug 19 20:27:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 381478 X-Patchwork-Delegate: yorksun@freescale.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 3AEA41400B2 for ; Wed, 20 Aug 2014 06:28:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0829FAB55A; Tue, 19 Aug 2014 22:28:23 +0200 (CEST) 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 6oZxKoBpOIUh; Tue, 19 Aug 2014 22:28:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 17D994A03B; Tue, 19 Aug 2014 22:28:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 68B994B5D2 for ; Tue, 19 Aug 2014 22:28:16 +0200 (CEST) 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 jhJ8C-coyUnA for ; Tue, 19 Aug 2014 22:28:13 +0200 (CEST) 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 na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0188.outbound.protection.outlook.com [207.46.163.188]) by theia.denx.de (Postfix) with ESMTPS id 70BC24A03B for ; Tue, 19 Aug 2014 22:28:09 +0200 (CEST) Received: from BN3PR0301CA0053.namprd03.prod.outlook.com (25.160.152.149) by DM2PR03MB317.namprd03.prod.outlook.com (10.141.54.15) with Microsoft SMTP Server (TLS) id 15.0.1010.13; Tue, 19 Aug 2014 20:28:05 +0000 Received: from BN1AFFO11FD032.protection.gbl (2a01:111:f400:7c10::151) by BN3PR0301CA0053.outlook.office365.com (2a01:111:e400:401e::21) with Microsoft SMTP Server (TLS) id 15.0.1010.18 via Frontend Transport; Tue, 19 Aug 2014 20:28:04 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD032.mail.protection.outlook.com (10.58.52.186) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Tue, 19 Aug 2014 20:28:04 +0000 Received: from oslab-l1.am.freescale.net ([10.214.85.130]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s7JKS1Bt025588; Tue, 19 Aug 2014 13:28:02 -0700 From: York Sun To: Date: Tue, 19 Aug 2014 13:27:59 -0700 Message-ID: <1408480082-4617-2-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1408480082-4617-1-git-send-email-yorksun@freescale.com> References: <1408480082-4617-1-git-send-email-yorksun@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019006)(6009001)(54534003)(199003)(189002)(74502001)(85306004)(31966008)(74662001)(19580405001)(86362001)(76176999)(81156004)(87936001)(229853001)(105606002)(99396002)(33646002)(50986999)(106466001)(95666004)(83322001)(77156001)(19580395003)(6806004)(92726001)(83072002)(44976005)(21056001)(92566001)(4396001)(81542001)(93916002)(69596002)(89996001)(48376002)(88136002)(87286001)(85852003)(68736004)(50226001)(36756003)(80022001)(62966002)(79102001)(26826002)(104166001)(97736001)(64706001)(84676001)(81342001)(104016003)(50466002)(102836001)(46102001)(107046002)(76482001)(47776003)(110136001)(2351001)(20776003)(77982001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB317; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 0308EE423E Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=yorksun@freescale.com; X-OriginatorOrg: freescale.com Cc: trini@ti.com, scottwood@freescale.com Subject: [U-Boot] [Patch v2 2/5] fdt_support: Make of_bus_default_count_cells non static 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Arnab Basu of_bus_default_count_cells can be used to get the #address-cells and #size-cells defined by the current node's parent node. This is required when using of_read_number to read from FDT nodes that can be 32 or 64 bytes depending on values defined by the parent. Signed-off-by: Arnab Basu CC: Scott Wood --- Change log v2: new patch common/fdt_support.c | 2 +- include/fdt_support.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 7ec7d4f..3f64156 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -963,7 +963,7 @@ struct of_bus { }; /* Default translator (generic bus) */ -static void of_bus_default_count_cells(void *blob, int parentoffset, +void of_bus_default_count_cells(void *blob, int parentoffset, int *addrc, int *sizec) { const fdt32_t *prop; diff --git a/include/fdt_support.h b/include/fdt_support.h index 649fbd6..c3d1fbc 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -142,6 +142,9 @@ static inline u64 of_read_number(const fdt32_t *cell, int size) return r; } +void of_bus_default_count_cells(void *blob, int parentoffset, + int *addrc, int *sizec); + #endif /* ifdef CONFIG_OF_LIBFDT */ #ifdef USE_HOSTCC