From patchwork Tue Apr 17 18:50:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 153272 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 D608FB70FB for ; Wed, 18 Apr 2012 04:51:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3220280B4; Tue, 17 Apr 2012 20:51:02 +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 QDBlkRUEMIVN; Tue, 17 Apr 2012 20:51:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A42592807F; Tue, 17 Apr 2012 20:50:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E0732808A for ; Tue, 17 Apr 2012 20:50:48 +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 43VN+nPVMLAJ for ; Tue, 17 Apr 2012 20:50:48 +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 mail-wg0-f74.google.com (mail-wg0-f74.google.com [74.125.82.74]) by theia.denx.de (Postfix) with ESMTPS id 3B3292807D for ; Tue, 17 Apr 2012 20:50:46 +0200 (CEST) Received: by wgbdt11 with SMTP id dt11so346380wgb.3 for ; Tue, 17 Apr 2012 11:50:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=wJBcgK5n2UVn+pweBjJX1rlnlI/BFua0P9RowWwi9ig=; b=Sc327M77SvsoiH1waMC7Kd3brE0Y/Q3K97sqowRMwJpinsVxmwe3K84BpZliHUrgmS wGpSb7CqPMQHz1CVlP1CSmsVogN8kLNUXCFlSB2XTfH/K4QYshAEA5QBxv8Ofccg2oEf viV24VdN0z2wd5a1MojSHK7H5egclADxJkcJ9fPBe3ALJlEJksJUuIk6HV0zudNOt07s XUX3VrQvrzgTXWHYgCA4C9Ig8DHuYfhYziQBTpGRmts2au4NvQ7zYOMnlvN4liyt2/CZ ObXk4geBcjAK1fHUs1tfjSb4dHMKGewXZvZFUt/bCg3o8esCnD9h6RG5jzEfJZxhJxG8 7qyw== Received: by 10.213.19.144 with SMTP id a16mr1401317ebb.9.1334688646244; Tue, 17 Apr 2012 11:50:46 -0700 (PDT) Received: by 10.213.19.144 with SMTP id a16mr1401291ebb.9.1334688646070; Tue, 17 Apr 2012 11:50:46 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id a14si22249271een.0.2012.04.17.11.50.46 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 17 Apr 2012 11:50:46 -0700 (PDT) Received: from sglass.mtv.corp.google.com (dhcp-172-22-162-38.mtv.corp.google.com [172.22.162.38]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id D7FBD20004E; Tue, 17 Apr 2012 11:50:45 -0700 (PDT) Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id 3C9F4140F5E; Tue, 17 Apr 2012 11:50:45 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 17 Apr 2012 11:50:09 -0700 Message-Id: <1334688614-4977-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1334688614-4977-1-git-send-email-sjg@chromium.org> References: <1334688614-4977-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkYFpcJhWGzR7sq74Ix9Kd5kK06Unnm6nu0N9Tr7WZFXX//QleYHGYbWCIS5EpGaCcC4NYFQjerDE6jOa1iEGYvgmomf34MWSzwTPFHadUMZtqqFovspgSZcI0QnDVy5ATCqUqz2ju9M1qQlH7VN1xnrEg4mdgjzSCat3CA1AUK3V7zJOo= Cc: Devicetree Discuss , Jerry Van Baren , Tom Warren , Scott Wood Subject: [U-Boot] [PATCH v3 2/7] fdt: Add debugging to fdtdec_get_int/addr() 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 The new debugging shows the value of integers and addresses read from the device tree. Signed-off-by: Simon Glass --- lib/fdtdec.c | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 42c3e89..3885634 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -79,11 +79,16 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node, const fdt_addr_t *cell; int len; - debug("get_addr: %s\n", prop_name); + debug("%s: %s\n", __func__, prop_name); cell = fdt_getprop(blob, node, prop_name, &len); if (cell && (len == sizeof(fdt_addr_t) || - len == sizeof(fdt_addr_t) * 2)) - return fdt_addr_to_cpu(*cell); + len == sizeof(fdt_addr_t) * 2)) { + fdt_addr_t addr = fdt_addr_to_cpu(*cell); + + debug("%p\n", (void *)addr); + return addr; + } + debug("(not found)\n"); return FDT_ADDR_T_NONE; } @@ -93,10 +98,15 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name, const s32 *cell; int len; - debug("get_size: %s\n", prop_name); + debug("%s: %s: ", __func__, prop_name); cell = fdt_getprop(blob, node, prop_name, &len); - if (cell && len >= sizeof(s32)) - return fdt32_to_cpu(cell[0]); + if (cell && len >= sizeof(s32)) { + s32 val = fdt32_to_cpu(cell[0]); + + debug("%#x (%d)\n", val, val); + return val; + } + debug("(not found)\n"); return default_val; }