Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • early-display
  • variant-emmc-nvme-boot
  • 2023-01-25
  • v3
  • variant-emmc-nvme-boot
  • 2020-06-01
7 results

fdt_empty_tree.c

Blame
  • Forked from Reform / reform-boundary-uboot
    31988 commits behind the upstream repository.
    • Gerald Van Baren's avatar
      c71b64f3
      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
      History
      libfdt: Add helper function to create a trivial, empty tree
      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>
    fdt_empty_tree.c 2.83 KiB