devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Ziureaev <andreiziureaev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org
Subject: [RFC PATCH v4 0/4] dtc: Add a plugin interface
Date: Tue, 15 Sep 2020 18:07:22 +0100	[thread overview]
Message-ID: <20200915170726.15434-1-andreiziureaev@gmail.com> (raw)

From: Andrei Ziureaev <andrei.ziureaev-5wv7dgnIgG8@public.gmane.org>

I added full documentation to the live tree API and changed the style of
comments in "dtc-plugin.h" to kernel-doc.

The live tree can be kept read-only. So, the input to a plugin is some
information about the tree and its outputs are printed error messages
and an ack/nack return back to DTC.
===========

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.

Plugins are allowed read-only access to the internal unflattened device
tree using the provided API. They can print error messages and return a
boolean status back to DTC.

There's a question of whether we should relicense some headers to
dual BSD to be able call Python code.

Any thoughts would be much appreciated.

Thanks,
Andrei.

Changes in v4:
- full documentation for live tree API
- changed comments to kernel-doc
- simplified "Exporting Functionality" in the manual
- the docs mention that the tree is read-only

Changes in v3:
- live tree API (dt.h and dt.c)
- additional functionality in dtc.h
- plugins have to implement prototypes
- improved documentation

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 (4):
  dtc: Add marker type functionality to dtc.h
  dtc: Add a live tree API
  dtc: Add plugin documentation and examples
  dtc: Add a plugin interface

 Documentation/manual.txt         | 154 ++++++++++++++++
 Makefile                         |  29 ++-
 Makefile.dtc                     |   1 +
 dt.c                             | 158 ++++++++++++++++
 dt.h                             | 299 +++++++++++++++++++++++++++++++
 dtc-plugin.h                     |  90 ++++++++++
 dtc.c                            | 142 ++++++++++++++-
 dtc.h                            |  57 ++++++
 plugins/example/Makefile.example |  27 +++
 plugins/example/example.c        |  33 ++++
 treesource.c                     |   8 +-
 11 files changed, 992 insertions(+), 6 deletions(-)
 create mode 100644 dt.c
 create mode 100644 dt.h
 create mode 100644 dtc-plugin.h
 create mode 100644 plugins/example/Makefile.example
 create mode 100644 plugins/example/example.c

-- 
2.17.1


             reply	other threads:[~2020-09-15 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 17:07 Andrei Ziureaev [this message]
     [not found] ` <20200915170726.15434-1-andreiziureaev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-09-15 17:07   ` [RFC PATCH v4 1/4] dtc: Add marker type functionality to dtc.h Andrei Ziureaev
2020-09-15 17:07   ` [RFC PATCH v4 2/4] dtc: Add a live tree API Andrei Ziureaev
2020-09-15 17:07   ` [RFC PATCH v4 3/4] dtc: Add plugin documentation and examples Andrei Ziureaev
2020-09-15 17:07   ` [RFC PATCH v4 4/4] dtc: Add a plugin interface Andrei Ziureaev
2020-11-19 15:44   ` [RFC PATCH v4 0/4] " Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200915170726.15434-1-andreiziureaev@gmail.com \
    --to=andreiziureaev-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).