u-boot/lib/libfdt
David Gibson d1c6314887 libfdt: Implement property iteration functions
For ages, we've been talking about adding functions to libfdt to allow
iteration through properties.  So, finally, here are some.

I got bogged down on this for a long time because I didn't want to
expose offsets directly to properties to the callers.  But without
that, attempting to make reasonable iteration functions just became
horrible.  So eventually, I settled on an interface which does now
expose property offsets.  fdt_first_property_offset() and
fdt_next_property_offset() are used to step through the offsets of the
properties starting from a particularly node offset.  The details of
the property at each offset can then be retrieved with either
fdt_get_property_by_offset() or fdt_getprop_by_offset() which have
interfaces similar to fdt_get_property() and fdt_getprop()
respectively.

No explicit testcases are included, but we do use the new functions to
reimplement the existing fdt_get_property() function.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

This was extracted from the DTC commit:
73dca9ae0b9abe6924ba640164ecce9f8df69c5a Mon Sep 17 00:00:00 2001

Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
2011-07-14 21:10:34 -04:00
..
Makefile Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
README Move libfdt/ into lib/ 2010-04-13 09:13:04 +02:00
fdt.c libfdt: Implement property iteration functions 2011-07-14 21:10:34 -04:00
fdt_ro.c libfdt: Implement property iteration functions 2011-07-14 21:10:34 -04:00
fdt_rw.c Move libfdt/ into lib/ 2010-04-13 09:13:04 +02:00
fdt_strerror.c Move libfdt/ into lib/ 2010-04-13 09:13:04 +02:00
fdt_sw.c Move libfdt/ into lib/ 2010-04-13 09:13:04 +02:00
fdt_wip.c Move libfdt/ into lib/ 2010-04-13 09:13:04 +02:00
libfdt_internal.h libfdt: Implement property iteration functions 2011-07-14 21:10:34 -04:00

README

The libfdt functionality was written by David Gibson.  The original
source came from the git repository:

URL:		git://ozlabs.org/home/dgibson/git/libfdt.git

author		David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
committer	David Gibson <dgibson@sneetch.(none)>
		Fri, 23 Mar 2007 04:16:54 +0000 (15:16 +1100)
commit		857f54e79f74429af20c2b5ecc00ee98af6a3b8b
tree		2f648f0f88225a51ded452968d28b4402df8ade0
parent		07a12a08005f3b5cd9337900a6551e450c07b515

To adapt for u-boot usage, only the applicable files were copied and
imported into the u-boot git repository.
Omitted:
* GPL - u-boot comes with a copy of the GPL license
* test subdirectory - not directly useful for u-boot

After importing, other customizations were performed.  See the git log
for details.

Jerry Van Baren