public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Add 'ftinfo' command for displaying a flattened device tree image
Date: Sun, 29 Oct 2006 15:54:08 -0700	[thread overview]
Message-ID: <1162162451805-git-send-email-grant.likely@secretlab.ca> (raw)
In-Reply-To: <1162162451844-git-send-email-grant.likely@secretlab.ca>

Note: I've added this command to ft_build.c instead of a seperate cmd_*.c
because it is such a small amount of code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 common/ft_build.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/common/ft_build.c b/common/ft_build.c
index 980e40f..9a36187 100644
--- a/common/ft_build.c
+++ b/common/ft_build.c
@@ -20,6 +20,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <malloc.h>
 #include <environment.h>
 
@@ -588,4 +589,26 @@ #ifdef DEBUG
 	ft_dump_blob(blob);
 #endif
 }
+
+int do_ftinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	void* addr;
+	if (argc < 2) {
+		printf ("Usage:\n%s\n", cmdtp->usage);
+		return 1;
+	}
+
+	addr = (void*)simple_strtoul(argv[1], NULL, 16);
+	printf("Printing device tree at 0x%x\n", addr);
+	ft_dump_blob(addr);
+	return 0;
+}
+
+/* -------------------------------------------------------------------- */
+
+U_BOOT_CMD(
+	ftinfo, 2, 2, do_ftinfo, "ftinfo - print a flattened device tree\n",
+	"ftinfo addr\n"
+	"    - print device tree at address 'addr'\n"
+);
 #endif
-- 
1.4.3.rc2.g0503

  reply	other threads:[~2006-10-29 22:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29 22:54 [U-Boot-Users] Set of patches for FDT support Grant Likely
2006-10-29 22:54 ` Grant Likely
2006-10-29 22:54   ` Grant Likely
2006-10-29 22:54     ` Grant Likely [this message]
2006-10-29 22:54       ` [U-Boot-Users] [PATCH] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel Grant Likely
2006-10-29 22:54         ` [U-Boot-Users] [PATCH] Enable the IceCube/lite5200 variants to pass a device tree to Linux Grant Likely
2006-10-30  0:10           ` Wolfgang Denk
2006-10-30  5:49             ` Grant Likely
2006-11-02 16:32               ` Grant Likely
2006-11-02 19:57           ` Jon Loeliger
2006-11-29 10:17           ` Stefan Roese
2006-11-29 14:27             ` Grant Likely
2006-10-30  0:06         ` [U-Boot-Users] [PATCH] Allow CONFIG_OF_FLAT_TREE to boot a non-arch/powerpc kernel Wolfgang Denk
2006-10-30  1:13           ` Grant Likely
2006-11-02 16:37         ` Jon Loeliger
2006-11-28  9:44         ` Stefan Roese
2006-11-28 14:37           ` Grant Likely
2006-11-28 16:13             ` Jon Loeliger
2006-11-28 16:21               ` Stefan Roese
2006-10-30 20:31       ` [U-Boot-Users] [PATCH] Add 'ftinfo' command for displaying a flattened device tree image Matthew McClintock
2006-10-30 21:16         ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1162162451805-git-send-email-grant.likely@secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox