[PATCH v2 1/3] libfdt: Add function to find regions in an FDT

Simon Glass sjg at chromium.org
Wed Mar 13 14:46:12 EST 2013


Hi,

On Fri, Feb 15, 2013 at 2:49 PM, Simon Glass <sjg at chromium.org> wrote:
> Given a set of nodes and properties, find the regions of the device tree
> which describe those parts.
>
> A test is provided which builds a tree while tracking where the regions
> should be, then calls fdt_first/next_region() to make sure that it agrees.
>
> Further tests will come as part of fdtgrep.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>

I just wondered if there any any comments on this new version?

> ---
> Changes in v2:
> - Move region code to separate fdt_region.c file
> - Fix info->count <= info->max_regions in fdt_add_region() merge case
> - Add new FDT_ERR_TOODEEP error type and use it
> - Change returned error from BADLAYOUT to BADSTRUCTURE
> - Return FDT_ERR_BADLAYOUT error if strings block is before structure block
> - Add note that changes in node/property order can cause false hash misses
> - Add more comments about the -1 return value from h_include
> - Drop FDT_IS_COMPAT and pass node offset to h_include function
> - Drop stale comment about names / wildcards
> - Move to a model with fdt_first_region()/fdt_next_region()
> - Add long comment explaining theory of operation
>
>  libfdt/Makefile.libfdt |   3 +-
>  libfdt/fdt_region.c    | 452 +++++++++++++++++++++++++++++++++++++++++++++++++
>  libfdt/libfdt.h        | 213 ++++++++++++++++++++++-
>  tests/.gitignore       |   1 +
>  tests/Makefile.tests   |   3 +-
>  tests/region_tree.c    | 336 ++++++++++++++++++++++++++++++++++++
>  tests/run_tests.sh     |   5 +
>  7 files changed, 1010 insertions(+), 3 deletions(-)
>  create mode 100644 libfdt/fdt_region.c
>  create mode 100644 tests/region_tree.c
>

Regards,
Simon


More information about the devicetree-discuss mailing list