| c3c4c005 | 23-Jun-2015 |
Simon Glass <sjg@chromium.org> |
fdt: Add fdt_first/next_region() functions
These have been sent upstream but not accepted to libfdt. For now, bring these into U-Boot to enable fdtgrep to operate. We will use fdtgrep to cut device
fdt: Add fdt_first/next_region() functions
These have been sent upstream but not accepted to libfdt. For now, bring these into U-Boot to enable fdtgrep to operate. We will use fdtgrep to cut device tree files down for SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 73e1e795 | 14-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
libfdt: fix error code of fdt_count_strings()
Currently, this function returns a positive value on error, so we never know whether this function has succeeded or failed.
For example, if the given p
libfdt: fix error code of fdt_count_strings()
Currently, this function returns a positive value on error, so we never know whether this function has succeeded or failed.
For example, if the given property is not found, fdt_getprop() returns -FDT_ERR_NOTFOUND, and then this function inverts it, i.e., returns FDT_ERR_NOTFOUND (=1).
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Fixes: bc4147ab2d69 ("fdt: Add a function to count strings") Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 5094eb40 | 26-Aug-2014 |
Thierry Reding <treding@nvidia.com> |
fdt: Add functions to retrieve strings
Given a device tree node, a property name and an index, the new function fdt_get_string_index() will return in an output argument a pointer to the index'th str
fdt: Add functions to retrieve strings
Given a device tree node, a property name and an index, the new function fdt_get_string_index() will return in an output argument a pointer to the index'th string in the property's value.
The fdt_get_string() is a shortcut for the above with the index being 0.
Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| fc503c17 | 26-Aug-2014 |
Thierry Reding <treding@nvidia.com> |
fdt: Add a function to get the index of a string
Given a device tree node and a property name, the new fdt_find_string() function will look up a given string in the string list contained in the prop
fdt: Add a function to get the index of a string
Given a device tree node and a property name, the new fdt_find_string() function will look up a given string in the string list contained in the property's value and return its index.
Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| c71b64f3 | 16-Oct-2012 |
Gerald Van Baren <gvb@unssw.com> |
libfdt: Add helper function to create a trivial, empty tree
The libfdt read/write functions are now usable enough that it's become a moderately common pattern to use them to build and manipulate a d
libfdt: Add helper function to create a trivial, empty tree
The libfdt read/write functions are now usable enough that it's become a moderately common pattern to use them to build and manipulate a device tree from scratch. For example, we do so ourself in our rw_tree1 testcase, and qemu is starting to use this model when building device trees for some targets such as e500.
However, the read/write functions require some sort of valid tree to begin with, so this necessitates either having a trivial canned dtb to begin with or, more commonly, creating an empty tree using the serial-write functions first.
This patch adds a helper function which uses the serial-write functions to create a trivial, empty but complete and valid tree in a supplied buffer, ready for manipulation with the read/write functions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
From git://git.jdl.com/software/dtc.git patch hash be6026838 with adaptations to include/libfdt.h and lib/libfdt/Makefile for the U-Boot environment.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
show more ...
|
| d1c63148 | 09-Mar-2010 |
David Gibson <david@gibson.dropbear.id.au> |
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
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>
show more ...
|