From patchwork Fri May 6 19:56:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 94431 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 BBCB3B7005 for ; Sat, 7 May 2011 05:57:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74AD728093; Fri, 6 May 2011 21:57:25 +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 1Q19+04DfCMM; Fri, 6 May 2011 21:57:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0AF8028095; Fri, 6 May 2011 21:57:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5A76C28095 for ; Fri, 6 May 2011 21:57:21 +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 v2WBRGGAEjYG for ; Fri, 6 May 2011 21:57:19 +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 DB3EHSOBE001.bigfish.com (db3ehsobe001.messaging.microsoft.com [213.199.154.139]) by theia.denx.de (Postfix) with ESMTPS id 0729128093 for ; Fri, 6 May 2011 21:57:17 +0200 (CEST) Received: from mail78-db3-R.bigfish.com (10.3.81.249) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.8; Fri, 6 May 2011 19:57:16 +0000 Received: from mail78-db3 (localhost.localdomain [127.0.0.1]) by mail78-db3-R.bigfish.com (Postfix) with ESMTP id 787901760255; Fri, 6 May 2011 19:57:16 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail78-db3 (localhost.localdomain [127.0.0.1]) by mail78-db3 (MessageSwitch) id 1304711832415186_1980; Fri, 6 May 2011 19:57:12 +0000 (UTC) Received: from DB3EHSMHS004.bigfish.com (unknown [10.3.81.253]) by mail78-db3.bigfish.com (Postfix) with ESMTP id 872261C80135; Fri, 6 May 2011 19:56:41 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS004.bigfish.com (10.3.87.104) with Microsoft SMTP Server (TLS) id 14.1.225.8; Fri, 6 May 2011 19:56:40 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.270.2; Fri, 6 May 2011 14:56:38 -0500 Received: from efes.am.freescale.net (efes.am.freescale.net [10.82.123.3]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p46JubcG016619; Fri, 6 May 2011 14:56:37 -0500 (CDT) From: Timur Tabi To: , , , Date: Fri, 6 May 2011 14:56:37 -0500 Message-ID: <1304711797-10549-1-git-send-email-timur@freescale.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH 1/2] [v2] fdt: add support for the ePAPR "phandle" property X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 The ePAPR specification says that phandle properties should be called "phandle", and not "linux,phandle". To facilitate the migration from "linux,phandle" to "phandle", we update some functions to support both properties. Signed-off-by: Timur Tabi --- Upstream libfdt already has the ePAPR changes, so would someone please pull in those changes? common/fdt_support.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 496040b..85715ff 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -1187,6 +1187,12 @@ int fdt_alloc_phandle(void *blob) for (offset = fdt_next_node(blob, -1, NULL); offset >= 0; offset = fdt_next_node(blob, offset, NULL)) { + /* Check the ePAPR-compliant "phandle" property name */ + val = fdt_getprop(blob, offset, "phandle", &len); + if (val) + phandle = max(*val, phandle); + + /* Also check the deprecated "linux,phandle" property name */ val = fdt_getprop(blob, offset, "linux,phandle", &len); if (val) phandle = max(*val, phandle);