devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] cmd: fdt: Add device tree overlays support
@ 2016-05-27  9:13 Maxime Ripard
       [not found] ` <1464340402-2249-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Maxime Ripard @ 2016-05-27  9:13 UTC (permalink / raw)
  To: Pantelis Antoniou, Simon Glass
  Cc: Boris Brezillon, Alexander Kaplan, Thomas Petazzoni,
	devicetree-compiler-u79uwXL29TY76Z2rM5mHXA, Antoine Ténart,
	Hans de Goede, Tom Rini, u-boot-0aAXYlwwYIKGBzrmiIFOJg,
	Stefan Agner, 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.

However, most of the time, the overlays are applied through a
mechanism involving the firmware request interface in Linux, that is
only fully functional once the userspace has been mounted and is
running.

Some expansion boards might need to be enabled before that, because
they simply need to patch the DT early on, or need to be initialized
early in order to be fully functional, or because they provide access
to the root filesystem.

In these cases, having the bootloader applying the overlay before
Linux starts seems like the easiest solution.

This implementation doesn't provide all the Linux fancyness though,
there's no transactional application, which means that if the overlay
cannot be applied for a reason while you're still halfway through the
application, you're probably screwed. It also cannot remove an
overlay, but I don't think that it is currently a use-case.

The libfdt patches has been sent upstream earlier today for review.

Let me know what you think,
Maxime

Changes from v1:
  - Moved the overlay code to libfdt
  - Added unit tests
  - Refactored the code to reduce the amount of memory allocation
  - No longer modify the overlay itself, but create a copy to operate
    on instead.
  - Removed the limitations on the fixups path, names and properties
    length
  - Fixed a few things here and there according to comments

Maxime Ripard (9):
  cmd: fdt: Narrow the check for fdt addr
  scripts: Makefile.lib: Sanitize DTB names
  vsprintf: Include stdarg for va_list
  libfdt: Add new headers and defines
  libfdt: Add iterator over properties
  libfdt: Add max phandle retrieval function
  libfdt: Add overlay application function
  cmd: fdt: add fdt overlay application subcommand
  tests: Introduce DT overlay tests

 Makefile                          |   1 +
 cmd/fdt.c                         |  22 +-
 include/libfdt.h                  |  67 ++++++
 include/libfdt_env.h              |   7 +
 include/test/overlay.h            |  16 ++
 include/test/suites.h             |   1 +
 include/vsprintf.h                |   2 +
 lib/libfdt/Makefile               |   2 +-
 lib/libfdt/fdt_overlay.c          | 414 ++++++++++++++++++++++++++++++++++++++
 lib/libfdt/fdt_ro.c               |  15 ++
 scripts/Makefile.lib              |   8 +-
 test/Kconfig                      |   1 +
 test/cmd_ut.c                     |   6 +
 test/overlay/Kconfig              |  10 +
 test/overlay/Makefile             |  15 ++
 test/overlay/cmd_ut_overlay.c     | 176 ++++++++++++++++
 test/overlay/test-fdt-base.dts    |  17 ++
 test/overlay/test-fdt-overlay.dts |  60 ++++++
 18 files changed, 834 insertions(+), 6 deletions(-)
 create mode 100644 include/test/overlay.h
 create mode 100644 lib/libfdt/fdt_overlay.c
 create mode 100644 test/overlay/Kconfig
 create mode 100644 test/overlay/Makefile
 create mode 100644 test/overlay/cmd_ut_overlay.c
 create mode 100644 test/overlay/test-fdt-base.dts
 create mode 100644 test/overlay/test-fdt-overlay.dts

-- 
2.8.2

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

end of thread, other threads:[~2016-06-16  0:39 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27  9:13 [PATCH v2 0/9] cmd: fdt: Add device tree overlays support Maxime Ripard
     [not found] ` <1464340402-2249-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-05-27  9:13   ` [PATCH v2 1/9] cmd: fdt: Narrow the check for fdt addr Maxime Ripard
     [not found]     ` <1464340402-2249-2-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10 13:55         ` Pantelis Antoniou
2016-05-27  9:13   ` [PATCH v2 2/9] scripts: Makefile.lib: Sanitize DTB names Maxime Ripard
     [not found]     ` <1464340402-2249-3-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10 13:59       ` Pantelis Antoniou
2016-05-27  9:13   ` [PATCH v2 3/9] vsprintf: Include stdarg for va_list Maxime Ripard
     [not found]     ` <1464340402-2249-4-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10 14:00     ` Pantelis Antoniou
2016-05-27  9:13   ` [PATCH v2 4/9] libfdt: Add new headers and defines Maxime Ripard
     [not found]     ` <1464340402-2249-5-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10 14:03       ` Pantelis Antoniou
     [not found]         ` <D44ABB0F-69B9-4DA6-8F8B-6F74A5B4BFE1-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-11 10:30           ` David Gibson
     [not found]             ` <20160611103035.GW9226-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-06-13  9:28               ` Maxime Ripard
2016-06-16  0:39                 ` Simon Glass
2016-05-27  9:13   ` [PATCH v2 5/9] libfdt: Add iterator over properties Maxime Ripard
2016-06-10  2:51     ` Stefan Agner
2016-06-10 14:04     ` Pantelis Antoniou
     [not found]       ` <73A48AF0-F702-4C43-80A4-A18AC4AD59C6-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-13  9:35         ` Maxime Ripard
2016-05-27  9:13   ` [PATCH v2 6/9] libfdt: Add max phandle retrieval function Maxime Ripard
2016-06-10  2:55     ` Stefan Agner
     [not found]     ` <1464340402-2249-7-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10 15:13       ` Pantelis Antoniou
2016-05-27  9:13   ` [PATCH v2 7/9] libfdt: Add overlay application function Maxime Ripard
2016-06-10  3:38     ` Stefan Agner
     [not found]     ` <1464340402-2249-8-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10 14:28       ` Pantelis Antoniou
     [not found]         ` <34997AD3-B621-4823-920E-22E4A6F0E0D1-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-13  9:51           ` Maxime Ripard
2016-06-14  0:25           ` David Gibson
     [not found]             ` <20160614002550.GA4882-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-06-14  9:22               ` Pantelis Antoniou
     [not found]                 ` <F0B62E6A-D5CE-4505-BC19-5EAB72A33ADE-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-15  3:14                   ` David Gibson
2016-06-15  9:34                     ` Pantelis Antoniou
     [not found]                       ` <7E8A7CBD-D682-45E5-AD2C-19F137E5ED38-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-15 10:19                         ` David Gibson
2016-06-15 10:23                           ` Pantelis Antoniou
     [not found]                             ` <F67FB562-88F6-4B3A-8952-ACA38AAC9256-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-06-15 14:49                               ` Warner Losh
2016-05-27  9:13   ` [PATCH v2 8/9] cmd: fdt: add fdt overlay application subcommand Maxime Ripard
     [not found]     ` <1464340402-2249-9-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10  3:45       ` Stefan Agner
2016-06-10 13:56       ` Pantelis Antoniou
2016-05-27  9:13   ` [PATCH v2 9/9] tests: Introduce DT overlay tests Maxime Ripard
     [not found]     ` <1464340402-2249-10-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2016-06-10  0:34       ` Simon Glass
2016-06-10 15:20       ` Pantelis Antoniou

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).