From: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Marek Szyprowski
<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org,
jdl-CYoMK+44s/E@public.gmane.org,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Subject: Re: [PATCH RFC 0/5] Hybrid approach for DT schema checking
Date: Tue, 13 May 2014 15:21:52 +0200 [thread overview]
Message-ID: <53721C70.2030106@samsung.com> (raw)
In-Reply-To: <1392919611-10746-1-git-send-email-t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Hi,
Just wanted to add that you can also find the code in my dtc tree on
kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/tfiga/dtc.git
or if you prefer web interface to quickly look through the changes:
https://git.kernel.org/cgit/linux/kernel/git/tfiga/dtc.git/
Best regards,
Tomasz
On 20.02.2014 19:06, Tomasz Figa wrote:
> This series adds a proof of concept framework to implement schema checker
> using a combined C and DTSS based approach. Several example bindings are
> also implemented using C and DTSS[1].
>
> Complex and generic bindings can be implemented directly in C and then
> instantiated from simple device-specific bindings using DTS-like DTSS
> language.
>
> A quick description of C part:
>
> A new check is registered in dtc checks framework to perform schema checking
> of each node. Checking is done by searching specified schema set for matching
> schemas (by compatible, device_type or absolute path) and applying matched
> schemas to the node.
>
> Schemas for complex generic bindings (such as interrupts, gpios, clocks, i2c,
> mmio-bus, etc.) can be implemented directly in C and instantiated from DTSS
> schemas of particular devices. An example C schema may look like:
>
> static void generic_checkfn_xxx_yyy(const struct generic_schema *schema,
> struct node *root, struct node *node,
> struct node *params, bool required)
> {
> /*
> * Get necessary schema arguments from DTSS schema by looking
> * at properties of @params node.
> *
> * Check whether @node node matches the schema.
> *
> * The @required argument may be used to check whether some error
> * conditions should be ignored (e.g. unspecified interrupt).
> */
> }
> GENERIC_SCHEMA("xxx-yyy", xxx_yyy);
>
> A quick description of DTSS part:
>
> * DTSS is a DTS-like language for specification of simple bindings, e.g.
> bindings of particular devices. The basic syntax is very similar to DTS,
> with main elements being nodes and properties. At root level a series of
> nodes should be specified representing particular bindings:
>
> /dtss-v1/;
>
> binding1 {
> /* Definition of binding 1 */
> };
>
> binding2 {
> /* Definition of binding 2 */
> };
>
> * Matching key for each binding can be specified using /match/ keyword:
>
> root-node {
> /match/ path = "/";
> };
>
> wlf,wm8903 {
> /match/ compatible = "wlf,wm8903";
> };
>
> pci-bus {
> /match/ device_type = "memory";
> };
>
> Currently supported matches: path, compatible, device_type.
>
> * Bindings can be specified either by listing properties they require
> (or can use) directly or by instantiating generic C-based bindings.
>
> binding {
> required-property;
>
> /optional/ optional-property;
>
> /require/ required-generic-schema;
>
> /use/ optional-generic-schema {
> schema-argument = <1>;
> };
> };
>
> Generic schemas are implemented in C, as described above, and can use
> arguments specified in DTSS as properties. /require/ calls the schema with
> required=true, while /use/ with required=false.
>
> This is based on Stephen Warren's C based DT schema checker proof of
> concept patch adding C-based validation[2].
>
> TODO:
> - specification of subnodes directly from DTSS,
> - specification of simple property values from DTSS (cells, strings,
> phandles),
> - reporting of unrecognized properties,
> - probably many more...
>
> [1] Device Tree Schema Source
> [2] http://thread.gmane.org/gmane.linux.ports.arm.kernel/275896
>
> Tomasz Figa (5):
> dtc: Add helpers for various message levels
> dtc: livetree: Add more tree parsing helpers
> Another try of DT schema checker using hybrid C and DTSS based
> approach
> Add sample C-based generic bindings
> Add sample DTS and DTSS schema
>
> Makefile | 2 +-
> Makefile.dtc | 10 +-
> checks.c | 15 +
> dtc.c | 17 +-
> dtc.h | 57 ++++
> dtss-lexer.l | 291 +++++++++++++++++++
> dtss-parser.y | 341 ++++++++++++++++++++++
> livetree.c | 230 +++++++++++++++
> sample.dts | 70 +++++
> schema.dtss | 86 ++++++
> schemas/clock/clock.c | 77 +++++
> schemas/gpio/gpio.c | 93 ++++++
> schemas/i2c/i2c.c | 42 +++
> schemas/interrupt-controller/interrupts.c | 452 ++++++++++++++++++++++++++++++
> schemas/mmio-bus.c | 97 +++++++
> schemas/schema.c | 311 ++++++++++++++++++++
> schemas/schema.h | 89 ++++++
> srcpos.h | 2 +
> treesource.c | 22 ++
> 19 files changed, 2300 insertions(+), 4 deletions(-)
> create mode 100644 dtss-lexer.l
> create mode 100644 dtss-parser.y
> create mode 100644 sample.dts
> create mode 100644 schema.dtss
> create mode 100644 schemas/clock/clock.c
> create mode 100644 schemas/gpio/gpio.c
> create mode 100644 schemas/i2c/i2c.c
> create mode 100644 schemas/interrupt-controller/interrupts.c
> create mode 100644 schemas/mmio-bus.c
> create mode 100644 schemas/schema.c
> create mode 100644 schemas/schema.h
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 0/5] Hybrid approach for DT schema checking
Date: Tue, 13 May 2014 15:21:52 +0200 [thread overview]
Message-ID: <53721C70.2030106@samsung.com> (raw)
In-Reply-To: <1392919611-10746-1-git-send-email-t.figa@samsung.com>
Hi,
Just wanted to add that you can also find the code in my dtc tree on
kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/tfiga/dtc.git
or if you prefer web interface to quickly look through the changes:
https://git.kernel.org/cgit/linux/kernel/git/tfiga/dtc.git/
Best regards,
Tomasz
On 20.02.2014 19:06, Tomasz Figa wrote:
> This series adds a proof of concept framework to implement schema checker
> using a combined C and DTSS based approach. Several example bindings are
> also implemented using C and DTSS[1].
>
> Complex and generic bindings can be implemented directly in C and then
> instantiated from simple device-specific bindings using DTS-like DTSS
> language.
>
> A quick description of C part:
>
> A new check is registered in dtc checks framework to perform schema checking
> of each node. Checking is done by searching specified schema set for matching
> schemas (by compatible, device_type or absolute path) and applying matched
> schemas to the node.
>
> Schemas for complex generic bindings (such as interrupts, gpios, clocks, i2c,
> mmio-bus, etc.) can be implemented directly in C and instantiated from DTSS
> schemas of particular devices. An example C schema may look like:
>
> static void generic_checkfn_xxx_yyy(const struct generic_schema *schema,
> struct node *root, struct node *node,
> struct node *params, bool required)
> {
> /*
> * Get necessary schema arguments from DTSS schema by looking
> * at properties of @params node.
> *
> * Check whether @node node matches the schema.
> *
> * The @required argument may be used to check whether some error
> * conditions should be ignored (e.g. unspecified interrupt).
> */
> }
> GENERIC_SCHEMA("xxx-yyy", xxx_yyy);
>
> A quick description of DTSS part:
>
> * DTSS is a DTS-like language for specification of simple bindings, e.g.
> bindings of particular devices. The basic syntax is very similar to DTS,
> with main elements being nodes and properties. At root level a series of
> nodes should be specified representing particular bindings:
>
> /dtss-v1/;
>
> binding1 {
> /* Definition of binding 1 */
> };
>
> binding2 {
> /* Definition of binding 2 */
> };
>
> * Matching key for each binding can be specified using /match/ keyword:
>
> root-node {
> /match/ path = "/";
> };
>
> wlf,wm8903 {
> /match/ compatible = "wlf,wm8903";
> };
>
> pci-bus {
> /match/ device_type = "memory";
> };
>
> Currently supported matches: path, compatible, device_type.
>
> * Bindings can be specified either by listing properties they require
> (or can use) directly or by instantiating generic C-based bindings.
>
> binding {
> required-property;
>
> /optional/ optional-property;
>
> /require/ required-generic-schema;
>
> /use/ optional-generic-schema {
> schema-argument = <1>;
> };
> };
>
> Generic schemas are implemented in C, as described above, and can use
> arguments specified in DTSS as properties. /require/ calls the schema with
> required=true, while /use/ with required=false.
>
> This is based on Stephen Warren's C based DT schema checker proof of
> concept patch adding C-based validation[2].
>
> TODO:
> - specification of subnodes directly from DTSS,
> - specification of simple property values from DTSS (cells, strings,
> phandles),
> - reporting of unrecognized properties,
> - probably many more...
>
> [1] Device Tree Schema Source
> [2] http://thread.gmane.org/gmane.linux.ports.arm.kernel/275896
>
> Tomasz Figa (5):
> dtc: Add helpers for various message levels
> dtc: livetree: Add more tree parsing helpers
> Another try of DT schema checker using hybrid C and DTSS based
> approach
> Add sample C-based generic bindings
> Add sample DTS and DTSS schema
>
> Makefile | 2 +-
> Makefile.dtc | 10 +-
> checks.c | 15 +
> dtc.c | 17 +-
> dtc.h | 57 ++++
> dtss-lexer.l | 291 +++++++++++++++++++
> dtss-parser.y | 341 ++++++++++++++++++++++
> livetree.c | 230 +++++++++++++++
> sample.dts | 70 +++++
> schema.dtss | 86 ++++++
> schemas/clock/clock.c | 77 +++++
> schemas/gpio/gpio.c | 93 ++++++
> schemas/i2c/i2c.c | 42 +++
> schemas/interrupt-controller/interrupts.c | 452 ++++++++++++++++++++++++++++++
> schemas/mmio-bus.c | 97 +++++++
> schemas/schema.c | 311 ++++++++++++++++++++
> schemas/schema.h | 89 ++++++
> srcpos.h | 2 +
> treesource.c | 22 ++
> 19 files changed, 2300 insertions(+), 4 deletions(-)
> create mode 100644 dtss-lexer.l
> create mode 100644 dtss-parser.y
> create mode 100644 sample.dts
> create mode 100644 schema.dtss
> create mode 100644 schemas/clock/clock.c
> create mode 100644 schemas/gpio/gpio.c
> create mode 100644 schemas/i2c/i2c.c
> create mode 100644 schemas/interrupt-controller/interrupts.c
> create mode 100644 schemas/mmio-bus.c
> create mode 100644 schemas/schema.c
> create mode 100644 schemas/schema.h
>
next prev parent reply other threads:[~2014-05-13 13:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 18:06 [PATCH RFC 0/5] Hybrid approach for DT schema checking Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
[not found] ` <1392919611-10746-1-git-send-email-t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-02-20 18:06 ` [PATCH RFC 1/5] dtc: Add helpers for various message levels Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
[not found] ` <1392919611-10746-2-git-send-email-t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-09 11:43 ` David Gibson
2014-03-09 11:43 ` David Gibson
2014-02-20 18:06 ` [PATCH RFC 2/5] dtc: livetree: Add more tree parsing helpers Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
[not found] ` <1392919611-10746-3-git-send-email-t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-09 12:03 ` David Gibson
2014-03-09 12:03 ` David Gibson
2014-02-20 18:06 ` [PATCH RFC 3/5] Implement DT schema checker using hybrid approach Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
[not found] ` <1392919611-10746-4-git-send-email-t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-03-09 12:17 ` David Gibson
2014-03-09 12:17 ` David Gibson
2014-02-20 18:06 ` [PATCH RFC 4/5] Add sample C-based generic bindings Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
2014-02-20 18:06 ` [PATCH RFC 5/5] Add sample DTS and DTSS schema Tomasz Figa
2014-02-20 18:06 ` Tomasz Figa
2014-03-09 12:22 ` [PATCH RFC 0/5] Hybrid approach for DT schema checking David Gibson
2014-03-09 12:22 ` David Gibson
2014-05-13 13:21 ` Tomasz Figa [this message]
2014-05-13 13:21 ` Tomasz Figa
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=53721C70.2030106@samsung.com \
--to=t.figa-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=jdl-CYoMK+44s/E@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.