summaryrefslogtreecommitdiffstats
path: root/common/cmd_fdt.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-10-24 11:04:22 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-11-21 14:04:05 -0600
commit8d04f02f6224e6983f4812ea4da704950ec8539c (patch)
tree0e3193813d29fe82231ad618075efe257b2925f1 /common/cmd_fdt.c
parente93becf80d732b64aef81b23e8b6ece02c40533d (diff)
downloadtalos-obmc-uboot-8d04f02f6224e6983f4812ea4da704950ec8539c.tar.gz
talos-obmc-uboot-8d04f02f6224e6983f4812ea4da704950ec8539c.zip
Update libfdt from device tree compiler (dtc)
Update libfdt to commit 8eaf5e358366017aa2e846c5038d1aa19958314e from the device tree compiler (dtc) project. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common/cmd_fdt.c')
-rw-r--r--common/cmd_fdt.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index b665bd6c6a..d84c6f09ac 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -162,12 +162,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
pathp = argv[2];
nodep = argv[3];
- nodeoffset = fdt_find_node_by_path (fdt, pathp);
+ nodeoffset = fdt_path_offset (fdt, pathp);
if (nodeoffset < 0) {
/*
* Not found or something else bad happened.
*/
- printf ("libfdt fdt_find_node_by_path() returned %s\n",
+ printf ("libfdt fdt_path_offset() returned %s\n",
fdt_strerror(nodeoffset));
return 1;
}
@@ -202,12 +202,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
prop = argv[3];
newval = argv[4];
- nodeoffset = fdt_find_node_by_path (fdt, pathp);
+ nodeoffset = fdt_path_offset (fdt, pathp);
if (nodeoffset < 0) {
/*
* Not found or something else bad happened.
*/
- printf ("libfdt fdt_find_node_by_path() returned %s\n",
+ printf ("libfdt fdt_path_offset() returned %s\n",
fdt_strerror(nodeoffset));
return 1;
}
@@ -266,12 +266,12 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
* Get the path. The root node is an oddball, the offset
* is zero and has no name.
*/
- nodeoffset = fdt_find_node_by_path (fdt, argv[2]);
+ nodeoffset = fdt_path_offset (fdt, argv[2]);
if (nodeoffset < 0) {
/*
* Not found or something else bad happened.
*/
- printf ("libfdt fdt_find_node_by_path() returned %s\n",
+ printf ("libfdt fdt_path_offset() returned %s\n",
fdt_strerror(nodeoffset));
return 1;
}
@@ -567,13 +567,14 @@ static int fdt_print(char *pathp, char *prop, int depth)
uint32_t tag; /* tag */
int len; /* length of the property */
int level = 0; /* keep track of nesting level */
+ const struct fdt_property *prop1;
- nodeoffset = fdt_find_node_by_path (fdt, pathp);
+ nodeoffset = fdt_path_offset (fdt, pathp);
if (nodeoffset < 0) {
/*
* Not found or something else bad happened.
*/
- printf ("libfdt fdt_find_node_by_path() returned %s\n",
+ printf ("libfdt fdt_path_offset() returned %s\n",
fdt_strerror(nodeoffset));
return 1;
}
@@ -606,9 +607,10 @@ static int fdt_print(char *pathp, char *prop, int depth)
offstack[0] = nodeoffset;
while(level >= 0) {
- tag = fdt_next_tag(fdt, nodeoffset, &nextoffset, &pathp);
+ tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
switch(tag) {
case FDT_BEGIN_NODE:
+ pathp = fdt_offset_ptr(fdt, nodeoffset, 1);
if(level <= depth)
printf("%s%s {\n",
&tabs[MAX_LEVEL - level], pathp);
@@ -629,6 +631,8 @@ static int fdt_print(char *pathp, char *prop, int depth)
}
break;
case FDT_PROP:
+ prop1 = fdt_offset_ptr(fdt, nodeoffset, sizeof(*prop1));
+ pathp = fdt_string(fdt, fdt32_to_cpu(prop1->nameoff));
nodep = fdt_getprop (fdt, offstack[level], pathp, &len);
if (len < 0) {
printf ("libfdt fdt_getprop(): %s\n",
OpenPOWER on IntegriCloud