Skip to content

RFC dtc: Add a plugin interface

Andrei Ziureaev devicetree-compiler 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest3 patches 0 repliesNew
  2. v1 RFC4 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- improved documentation
- plugins must register with the build system
- the "validate_fn_t" hook can return a status
- define "struct reserve_info" in "dtc-plugin.h"
- specify that minor versions are compatible
- check if plugin_dir is NULL, just in case
- better variable names in register_plugin_info

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dtc: Add plugin documentation and examplesDocumentation/manual.txt plugins/example/Makefile.example plugins/example/example.c+142 -00 replies
2/3dtc: Move some definitions into dtc-plugin.hdtc-plugin.h dtc.h treesource.c+183 -1730 replies
3/3dtc: Add a plugin interfaceMakefile dtc-plugin.h dtc.c +1 more+266 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/3] dtc: Add a plugin interface

v2 includes data flow information in "Documentation/manual.txt" under "5.2) Exporting Functionality". The full changelog is below.
===========

This is one possible implementation of a plugin interface for dtc.

A plugin interface would allow us to add checks in languages other than C. Specifically, it would allow dtc and DT Schema (which is written in Python) to be integrated.

It would also allow for better debugging of dts files. For example, DT Schema would be able to print dts source line information, without us having to add source line annotations to yaml files.

The plugin interface exports the live tree, making it an ABI. Plugins are allowed to modify the live tree and pass it back for further processing.

There is a possibility of improving "dtc-plugin.h" by making a standard library for live trees.

There's also a question of whether we should relicense dtc-plugin.h to dual BSD to be able call Python code.

Any thoughts would be much appreciated.

Thanks,
Andrei.

Changes in v2:
- improved documentation
- plugins must register with the build system
- the "validate_fn_t" hook can return a status
- define "struct reserve_info" in "dtc-plugin.h"
- specify that minor versions are compatible
- check if plugin_dir is NULL, just in case
- better variable names in register_plugin_info

Andrei Ziureaev (3):
dtc: Add plugin documentation and examples
dtc: Move some definitions into dtc-plugin.h
dtc: Add a plugin interface

 Documentation/manual.txt         |  93 +++++++++++++
 Makefile                         |  29 +++-
 dtc-plugin.h                     | 232 +++++++++++++++++++++++++++++++
 dtc.c                            | 142 ++++++++++++++++++-
 dtc.h                            | 200 +++++++-------------------
 plugins/example/Makefile.example |  20 +++
 plugins/example/example.c        |  29 ++++
 treesource.c                     |  21 ---
 8 files changed, 591 insertions(+), 175 deletions(-)
 create mode 100644 dtc-plugin.h
 create mode 100644 plugins/example/Makefile.example
 create mode 100644 plugins/example/example.c
Signature · 1 line
2.17.1