[U-Boot] [PATCH 00/19] fdt: Move to the new upstream pylibfdt library

Tom Rini trini at konsulko.com
Tue Apr 18 16:25:38 UTC 2017


On Sun, Apr 16, 2017 at 08:22:14PM -0600, Simon Glass wrote:

> Python libfdt bindings have recently been accepted upstream. While the
> internals have changed a fair bit most of the API remains the same. Still,
> a few functions are different from how they are used in U-Boot so changes
> are needed to make this work.
> 
> At present in U-Boot there are two libraries for accessing a device tree
> file:
> 
> - FdtNormal which uses U-Boot's own Python bindings
> - FdtFallback which uses the fdtget command-line utility
> 
> The latter is not a great solution: it is fairly slow since the DT is
> re-read for every access and it cannot provide DT offsets or packing of
> the DT.
> 
> In addition, U-Boot now builds the libfdt module if swig is available,
> meaning that the fallback module is not used in that case.
> 
> Finally, at some point in the future distributions may start packaging the
> libfdt Python module and it will be available without U-Boot needing to
> build it itself.
> 
> Therefore it seems like a good idea to take this opportunity to drop the
> fallback module and just require that the Python libfdt bindings be
> present (at least if need by the build).
> 
> The bindings are needed in two situations:
> - When dtoc is used to convert a device tree into C code. This is enabled
>     by CONFIG_SPL_OF_PLATDATA
> - When binman is used to produce a firmware image. This is used on all x86
>     and sunxi boards at present
> 
> This series:
> - Plumbs in building the Python libfdt module to the U-Boot build system
> - Ensures that the module is always built if needed, print an error if
>     swig is not available (and thus the module cannot be built)
> - Allows use of a libfdt.py module already installed on the machine
> - Drops the FdtFallback support
> - Moves fdt.h and libfdt.h into lib/libfdt to aid with syncing with
>     upstream, building the Python bindings and to keep the code together
> - Merges Fdt and FdtNormal to simplify the code
> - Adjusts the Fdt library to work with the new libfdt module
> - Adds a few more tests to check access to properties in the DT
> - Adjusts binman and dtoc to work with the new approach
> 
> It should be possible to easily sync libfdt's Python bindings with U-Boot
> in the future, as development there proceeds.

While this came in late, my gut feeling is that it would be best to have
this change in the next release (so that various upstreams can get used
to the idea of basically always needing python installed to build).

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170418/7a189fc0/attachment.sig>


More information about the U-Boot mailing list