1. 14 Mar, 2016 1 commit
    • Simon Glass's avatar
      libfdt: Add a function to write a property placeholder · f8a2d7a4
      Simon Glass authored
      The existing function to add a new property to a tree being built requires
      that the entire contents of the new property be passed in. For some
      applications it is more convenient to be able to add the property contents
      later, perhaps by reading from a file. This avoids double-buffering of the
      contents.
      
      Add a new function to support this and adust the existing fdt_property() to
      use it.
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      f8a2d7a4
  2. 04 Nov, 2015 1 commit
  3. 21 Jul, 2015 2 commits
  4. 20 Jul, 2015 2 commits
  5. 24 Apr, 2015 1 commit
    • Hans de Goede's avatar
      fdt: Fix handling of paths with options in them · 77d7fff8
      Hans de Goede authored
      After syncing the sunxi dts files with the upstream kernel dm/fdt sunxi
      builds would no longer boot.
      
      The problem is that stdout-path is now set like this in the upstream dts
      files: stdout-path = "serial0:115200n8". The use of options in of-paths,
      either after an alias name, or after a full path, e.g. stdout-path =
      "/soc@01c00000/serial@01c28000:115200", is standard of usage, but something
      which the u-boot dts code so far did not handle.
      
      This commit fixes this, adding support for both path formats.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Acked-by: default avatarSimon Glass <sjg@chromium.org>
      77d7fff8
  6. 08 Dec, 2014 1 commit
  7. 22 Oct, 2014 3 commits
  8. 09 Aug, 2014 1 commit
    • Simon Glass's avatar
      fdt: Sync up with libfdt · 0596d35d
      Simon Glass authored
      This brings in changes up to commit f9e91a48 in the libfdt repo.
      Mostly this is whitespace/minor changes. But there are a few new
      features:
      
      - fdt_size_cells() and fdt_address_cells()
      - fdt_resize()
      Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
      0596d35d
  9. 19 Jun, 2014 1 commit
  10. 31 Oct, 2013 1 commit
  11. 14 Oct, 2013 1 commit
  12. 10 Aug, 2013 1 commit
  13. 24 Jul, 2013 1 commit
  14. 26 Jun, 2013 1 commit
  15. 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>
      88f95bba
  16. 10 May, 2013 1 commit
  17. 08 Feb, 2013 1 commit
  18. 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
      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: 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
      environment.
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
      c71b64f3
  19. 15 Oct, 2012 1 commit
  20. 15 Jul, 2011 2 commits
    • 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()
      respectively.
      
      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>
      d1c63148
    • David Gibson's avatar
      Support ePAPR compliant phandle properties · 05a22ba0
      David Gibson authored
      Currently, the Linux kernel, libfdt and dtc, when using flattened
      device trees encode a node's phandle into a property named
      "linux,phandle".  The ePAPR specification, however - aiming as it is
      to not be a Linux specific spec - requires that phandles be encoded in
      a property named simply "phandle".
      
      This patch adds support for this newer approach to dtc and libfdt.
      Specifically:
      
      	- fdt_get_phandle() will now return the correct phandle if it
                is supplied in either of these properties
      
      	- fdt_node_offset_by_phandle() will correctly find a node with
                the given phandle encoded in either property.
      
      	- By default, when auto-generating phandles, dtc will encode
                it into both properties for maximum compatibility.  A new -H
                option allows either only old-style or only new-style
                properties to be generated.
      
      	- If phandle properties are explicitly supplied in the dts
      	  file, dtc will not auto-generate ones in the alternate format.
      
      	- If both properties are supplied, dtc will check that they
                have the same value.
      
      	- Some existing testcases are updated to use a mix of old and
                new-style phandles, partially testing the changes.
      
      	- A new phandle_format test further tests the libfdt support,
                and the -H option.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      
      This was extracted from the DTC commit:
      d75b33af676d0beac8398651a7f09037555a550b Mon Sep 17 00:00:00 2001
      Signed-off-by: default avatarGerald Van Baren <vanbaren@cideas.com>
      05a22ba0
  21. 17 Nov, 2010 1 commit
    • Sebastien Carlier's avatar
      Switch from archive libraries to partial linking · 6d8962e8
      Sebastien Carlier authored
      Before this commit, weak symbols were not overridden by non-weak symbols
      found in archive libraries when linking with recent versions of
      binutils.  As stated in the System V ABI, "the link editor does not
      extract archive members to resolve undefined weak symbols".
      
      This commit changes all Makefiles to use partial linking (ld -r) instead
      of creating library archives, which forces all symbols to participate in
      linking, allowing non-weak symbols to override weak symbols as intended.
      This approach is also used by Linux, from which the gmake function
      cmd_link_o_target (defined in config.mk and used in all Makefiles) is
      inspired.
      
      The name of each former library archive is preserved except for
      extensions which change from ".a" to ".o".  This commit updates
      references accordingly where needed, in particular in some linker
      scripts.
      
      This commit reveals board configurations that exclude some features but
      include source files that depend these disabled features in the build,
      resulting in undefined symbols.  Known such cases include:
      - disabling CMD_NET but not CMD_NFS;
      - enabling CONFIG_OF_LIBFDT but not CONFIG_QE.
      Signed-off-by: default avatarSebastien Carlier <sebastien.carlier@gmail.com>
      6d8962e8
  22. 13 Apr, 2010 1 commit