1. 20 Sep, 2013 1 commit
  2. 26 Jun, 2013 1 commit
  3. 14 May, 2013 1 commit
    • Simon Glass's avatar
      libfdt: Add fdt_next_subnode() to permit easy subnode iteration · 88f95bba
      Simon Glass authored
      Iterating through subnodes with libfdt is a little painful to write as we
      need something like this:
      for (depth = 0, count = 0,
      	offset = fdt_next_node(fdt, parent_offset, &depth);
           (offset >= 0) && (depth > 0);
           offset = fdt_next_node(fdt, offset, &depth)) {
      	if (depth == 1) {
      		/* code body */
      Using fdt_next_subnode() we can instead write this, which is shorter and
      easier to get right:
      for (offset = fdt_first_subnode(fdt, parent_offset);
           offset >= 0;
           offset = fdt_next_subnode(fdt, offset)) {
      	/* code body */
      Also, it doesn't require two levels of indentation for the loop body.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      (Cherry-picked from dtc commit 4e76ec79)
      Acked-by: default avatarGerald Van Baren <vanbaren@cideas.com>
  4. 10 May, 2013 2 commits
  5. 08 Feb, 2013 1 commit
  6. 16 Oct, 2012 1 commit
    • Gerald Van Baren's avatar
      libfdt: Add helper function to create a trivial, empty tree · c71b64f3
      Gerald Van Baren authored
      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
      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: default avatarDavid 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
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
  7. 15 Oct, 2012 2 commits
  8. 15 Jul, 2011 1 commit
    • David Gibson's avatar
      libfdt: Implement property iteration functions · d1c63148
      David Gibson authored
      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()
      No explicit testcases are included, but we do use the new functions to
      reimplement the existing fdt_get_property() function.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      This was extracted from the DTC commit:
      73dca9ae0b9abe6924ba640164ecce9f8df69c5a Mon Sep 17 00:00:00 2001
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
  9. 01 Apr, 2009 1 commit
  10. 04 Oct, 2008 1 commit
  11. 02 Oct, 2008 2 commits
  12. 25 Aug, 2008 3 commits
    • David Gibson's avatar
      libfdt: Implement fdt_get_property_namelen() and fdt_getprop_namelen() · 0219399a
      David Gibson authored
      As well as fdt_subnode_offset(), libfdt includes an
      fdt_subnode_offset_namelen() function that takes the subnode name to
      look up not as a NUL-terminated string, but as a string with an
      explicit length.  This can be useful when the caller has the name as
      part of a longer string, such as a full path.
      However, we don't have corresponding 'namelen' versions for
      fdt_get_property() and fdt_getprop().  There are less obvious use
      cases for these variants on property names, but there are
      circumstances where they can be useful e.g. looking up property names
      which need to be parsed from a longer string buffer such as user input
      or a configuration file, or looking up an alias in a path with
      IEEE1275 style aliases.
      So, since it's very easy to implement such variants, this patch does
      so.  The original NUL-terminated variants are, of course, implemented
      in terms of the namelen versions.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    • Wolfram Sang's avatar
      libfdt: Improve documentation in libfdt.h · 46390da1
      Wolfram Sang authored
      Fix a few typos and mistakes.
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    • David Gibson's avatar
      dtc: Enable and fix -Wcast-qual warnings · c6683026
      David Gibson authored
      Enabling -Wcast-qual warnings in dtc shows up a number of places where
      we are incorrectly discarding a const qualification.  There are also
      some places where we are intentionally discarding the 'const', and we
      need an ugly cast through uintptr_t to suppress the warning.  However,
      most of these are pretty well isolated with the *_w() functions.  So
      in the interests of maximum safety with const qualifications, this
      patch enables the warnings and fixes the existing complaints.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: default avatarGerald Van Baren <vanbaren@cideas.com>
  13. 20 May, 2008 1 commit
    • Wolfgang Denk's avatar
      Big white-space cleanup. · 53677ef1
      Wolfgang Denk authored
      This commit gets rid of a huge amount of silly white-space issues.
      Especially, all sequences of SPACEs followed by TAB characters get
      removed (unless they appear in print statements).
      Also remove all embedded "vim:" and "vi:" statements which hide
      indentation problems.
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
  14. 19 Mar, 2008 2 commits
  15. 29 Feb, 2008 1 commit
  16. 08 Jan, 2008 2 commits
  17. 02 Jan, 2008 2 commits
  18. 21 Nov, 2007 2 commits
  19. 06 Sep, 2007 1 commit
  20. 10 Aug, 2007 2 commits
  21. 15 Apr, 2007 1 commit
  22. 06 Apr, 2007 1 commit
    • Gerald Van Baren's avatar
      libfdt: Make fdt_check_header() public · 6679f929
      Gerald Van Baren authored
      Changed _fdt_check_header() to fdt_check_header() and made it part of
      the interface - it is a useful routine.
      Also did some asthetics cleanup to the include files (headers).
  23. 03 Apr, 2007 1 commit
  24. 31 Mar, 2007 2 commits