From patchwork Mon May 23 07:53:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 96834 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 7E5EFB6FB9 for ; Mon, 23 May 2011 18:03:30 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61B80280A5; Mon, 23 May 2011 10:03:27 +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 ZsrNRYuHijtZ; Mon, 23 May 2011 10:03:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F8AE280C2; Mon, 23 May 2011 10:03:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F5B4280C2 for ; Mon, 23 May 2011 10:03:22 +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 ibgXcWX4iYw7 for ; Mon, 23 May 2011 10:03:21 +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 dakia2.marvell.com (dakia2.marvell.com [65.219.4.35]) by theia.denx.de (Postfix) with ESMTPS id 04115280A5 for ; Mon, 23 May 2011 10:03:19 +0200 (CEST) X-ASG-Debug-ID: 1306137797-082e06c00001-4l7tJC Received: from maili.marvell.com (maili.marvell.com [10.68.76.51]) by dakia2.marvell.com with ESMTP id jd9oKRS3DHt0b45R; Mon, 23 May 2011 01:03:17 -0700 (PDT) X-Barracuda-Envelope-From: haojian.zhuang@marvell.com Received: from localhost (unknown [10.38.164.65]) by maili.marvell.com (Postfix) with ESMTP id EE0DB8A002; Mon, 23 May 2011 01:03:16 -0700 (PDT) From: Haojian Zhuang To: wd@denx.de, u-boot@lists.denx.de X-ASG-Orig-Subj: [PATCH] common/cmd_fdt.c: fix wrong data displayed in fdt print Date: Mon, 23 May 2011 15:53:30 +0800 X-ASG-Orig-Subj: [PATCH] common/cmd_fdt.c: fix wrong data displayed in fdt print Message-Id: <1306137210-31942-1-git-send-email-haojian.zhuang@marvell.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <2011052301> References: <2011052301> X-Barracuda-Connect: maili.marvell.com[10.68.76.51] X-Barracuda-Start-Time: 1306137797 X-Barracuda-URL: http://10.68.76.222:80/cgi-mod/mark.cgi X-Barracuda-Spam-Score: -1002.00 X-Barracuda-Spam-Status: No, SCORE=-1002.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 Cc: Gerald Van Baren , Haojian Zhuang , Haojian Zhuang Subject: [U-Boot] [PATCH] common/cmd_fdt.c: fix wrong data displayed in fdt print 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Haojian Zhuang All data in dtb is big endian. Some ARM devices are little-endian. In print_data(), it displays data with big-endian format. For ARM device, data should be converted to little-endian first. Signed-off-by: Haojian Zhuang Cc: Gerald Van Baren --- common/cmd_fdt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 3d0c2b7..9bdecca 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -665,7 +665,7 @@ static void print_data(const void *data, int len) printf("<"); for (j = 0, p = data; j < len/4; j ++) - printf("0x%x%s", p[j], j < (len/4 - 1) ? " " : ""); + printf("0x%x%s", fdt32_to_cpu(p[j]), j < (len/4 - 1) ? " " : ""); printf(">"); } else { /* anything else... hexdump */ const u8 *s;