devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] libfdt: Add support for device tree overlays
@ 2016-07-11 19:56 Maxime Ripard
       [not found] ` <20160711195623.12840-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 30+ messages in thread
From: Maxime Ripard @ 2016-07-11 19:56 UTC (permalink / raw)
  To: David Gibson
  Cc: Pantelis Antoniou, Simon Glass, Boris Brezillon, Alexander Kaplan,
	Thomas Petazzoni, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA,
	Antoine Ténart, Stefan Agner,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Maxime Ripard

Hi,

The device tree overlays are a great solution to the issue raised by
the bunch expandable boards we find everywhere these days, like the
Beaglebone, Raspberry Pi or CHIP.

Although for now Linux is the only available tool that can deal with
overlays, some other components like bootloaders or user-space tools
might need to apply these overlays on top of a base device tree.

To address these use cases, we introduce a new function to the libfdt,
fdt_overlay_apply, that does just that.

You can find a test program here: http://code.bulix.org/792zum-99476?raw

This is the last patches sent to U-boot, with the modifications
suggested by David, and the additional test cases.

Let me know what you think!
Maxime

Changes from U-Boot v4:
  - Added test cases for the functions
  - Changed the fdt_for_each_subnode argument order
  - Don't error out if -1 phandle is found in fdt_get_max_phandle
  - Used libfdt's fdt_path_offset_namelen

Changes from U-Boot v3:
  - Moved the patch to introduce fdt_getprop_namelen_w earlier to keep
    bisectability
  - Renamed fdt_setprop_inplace_namelen_by_index in
    fdt_setprop_inplace_namelen_partial
  - Reintroduced the check on the property length in fdt_setprop_inplace
  - Made sure the code was taking the non 32bits-aligned phandles
  - Used memchr instead of strchr in the fixup parsing code, and made
    sure the cases where the fixup format was wrong was reported as an
    error.
  - Fixed a bug where a property in a overlay having multiple phandles
    local to that overlay would only resolve the first one. Also added
    a test case for this
  - Added kerneldocs for all the overlay functions
  - Added a patch to fix a typo in separator
  - A few fixes, function renamings, error checking changes here and there

Changes from U-boot v2 / libfdt v1
  - Reworked the code to deal with Pantelis and David numerous
    comments, among which:
    * Remove the need for malloc in the overlay code, and added some
      libfdt functions to do that
    * Remove the DT magic in case of an error to not be able to use it
      anymore
    * Removed the fdt_ and _ function prefix for the static functions
    * Plus the usual bunch of rework, error checking and optimizations.				    


Maxime Ripard (5):
  libfdt: Add iterator over properties
  libfdt: Add max phandle retrieval function
  libfdt: Add fdt_getprop_namelen_w
  libfdt: Add fdt_setprop_inplace_namelen_partial
  libfdt: Add overlay application function

Thierry Reding (1):
  libfdt: Add a subnodes iterator macro

 libfdt/Makefile.libfdt     |   2 +-
 libfdt/fdt_overlay.c       | 618 +++++++++++++++++++++++++++++++++++++++++++++
 libfdt/fdt_ro.c            |  26 ++
 libfdt/fdt_wip.c           |  29 ++-
 libfdt/libfdt.h            | 121 +++++++++
 libfdt/libfdt_env.h        |   1 +
 tests/.gitignore           |   2 +
 tests/Makefile.tests       |   4 +-
 tests/get_phandle.c        |   6 +
 tests/overlay.c            | 228 +++++++++++++++++
 tests/overlay_base.dts     |  21 ++
 tests/overlay_overlay.dts  |  96 +++++++
 tests/property_iterate.c   |  97 +++++++
 tests/property_iterate.dts |  24 ++
 tests/run_tests.sh         |  11 +
 tests/subnode_iterate.c    |   8 +-
 16 files changed, 1282 insertions(+), 12 deletions(-)
 create mode 100644 libfdt/fdt_overlay.c
 create mode 100644 tests/overlay.c
 create mode 100644 tests/overlay_base.dts
 create mode 100644 tests/overlay_overlay.dts
 create mode 100644 tests/property_iterate.c
 create mode 100644 tests/property_iterate.dts

-- 
2.9.0

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-07-21 13:04 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 19:56 [PATCH v2 0/6] libfdt: Add support for device tree overlays Maxime Ripard
     [not found] ` <20160711195623.12840-1-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-11 19:56   ` [PATCH v2 1/6] libfdt: Add a subnodes iterator macro Maxime Ripard
     [not found]     ` <20160711195623.12840-2-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-12  1:52       ` David Gibson
2016-07-11 19:56   ` [PATCH v2 2/6] libfdt: Add iterator over properties Maxime Ripard
     [not found]     ` <20160711195623.12840-3-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-12  1:53       ` David Gibson
     [not found]         ` <20160712015335.GO16355-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-12  1:57           ` Robert P. J. Day
     [not found]             ` <alpine.LFD.2.20.1607111856210.14522-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-07-12  2:29               ` David Gibson
2016-07-11 19:56   ` [PATCH v2 3/6] libfdt: Add max phandle retrieval function Maxime Ripard
     [not found]     ` <20160711195623.12840-4-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-12  2:02       ` David Gibson
2016-07-11 19:56   ` [PATCH v2 4/6] libfdt: Add fdt_getprop_namelen_w Maxime Ripard
     [not found]     ` <20160711195623.12840-5-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-12  2:03       ` David Gibson
2016-07-11 19:56   ` [PATCH v2 5/6] libfdt: Add fdt_setprop_inplace_namelen_partial Maxime Ripard
     [not found]     ` <20160711195623.12840-6-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-12 11:45       ` David Gibson
     [not found]         ` <20160712114520.GB16355-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-18 13:45           ` Maxime Ripard
2016-07-21 13:04             ` David Gibson
2016-07-11 19:56   ` [PATCH v2 6/6] libfdt: Add overlay application function Maxime Ripard
     [not found]     ` <20160711195623.12840-7-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-07-11 20:20       ` Phil Elwell
     [not found]         ` <ed025e59-ddb3-0309-b2da-f6c2d1fa95d0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-07-12 14:34           ` David Gibson
     [not found]             ` <20160712143404.GD16355-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-12 15:07               ` Phil Elwell
     [not found]                 ` <CAPhXvM5nCbP81ujx3dhy9GvibdoBDy+N8EuArJj2-RFKO3ixfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-13  4:45                   ` David Gibson
2016-07-13  8:38               ` Maxime Ripard
2016-07-13 15:07                 ` David Gibson
     [not found]                   ` <20160713150745.GG14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-13 19:37                     ` Maxime Ripard
2016-07-14  8:30                       ` David Gibson
     [not found]                         ` <20160714083058.GN14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-15  9:18                           ` Phil Elwell
     [not found]                             ` <CAPhXvM53bMUypbUYSgC6BbAar2=dD8Y=Ktpu3LQzRTGx=yJesQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-18  4:39                               ` David Gibson
2016-07-18 13:07                               ` Maxime Ripard
2016-07-12 14:31       ` David Gibson
     [not found]         ` <20160712143120.GC16355-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-13 20:12           ` Maxime Ripard
2016-07-14  9:02             ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).