devicetree-spec.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Next steps for schema language
@ 2017-11-02 16:44 Grant Likely
  2017-11-02 18:13 ` Pantelis Antoniou
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Grant Likely @ 2017-11-02 16:44 UTC (permalink / raw)
  To: Pantelis Antoniou, Rob Herring,
	devicetree-spec-u79uwXL29TY76Z2rM5mHXA

Hi Pantelis and Rob,

After the workshop next week, I'm trying to capture the direction
we're going for the schema format. Roughly I think we're aiming
towards:

- Schema files to be written in YAML
- DT files shall remain written in DTS for the foreseeable future.
YAML will be treated as an intermediary format
  - That said, we'll try to make design decisions that allow YAML to
be used as a source format.
- All schema files and yaml-encoded-dt files must be parsable by stock
YAML parsers
- Schema files to use the jsonschema vocabulary
  - (jsonschema assumes json files, but YAML is a superset so this will be okay)
  - Extended to add vocabulary for DT concepts (ignored by stock validators)
    - C-like expressions as used in Pantelis' yamldt could be added in this way
  - Need to write a jsonschema "metaschema" do define DT specific extensions
    - metaschema will be used to validate format of schema files
    - Existing tools can confirm is schema files are in the right format.
    - will make review a lot easier.

The yaml encoding produced by yamldt is a good start, but some changes
need to be made from the current code to be workable:
- The redefinition of the anchor/alias syntax needs to be dropped.
  - We need a labels/reference syntax instead.
  - I'm using a $labels property to contain a list of labels which is
working for me, but I'm open to other suggestions
  - A YAML style !phandle or !path type definition would work for
parsing references.
- At the top level, the yaml-encoded-dt needs to be structured as a
list, not a map.
  - Using a list will properly accounts for how multiple top level
trees are overlayed to create the final tree.
  - I'm using a $path property to encode the path of each top level
node. Again, I'm open to suggestions for a different approach

Pantelis, do you think you can rework yamldt to use that encoding?

I'm currently working on what is needed for a metaschema, and an
engine for validating device-specific schema files using a standard
jsonschema validation library. I'll post a git tree once I've got
something worth looking at.

Cheers,
g.

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

end of thread, other threads:[~2017-12-19  4:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 16:44 Next steps for schema language Grant Likely
2017-11-02 18:13 ` Pantelis Antoniou
2017-11-07 14:14   ` Grant Likely
     [not found]     ` <CACxGe6vRSGbXAVo2TDvX0t+CiZFYcLfWTQsHt5LD3oaKL=4qew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-09  6:48       ` David Gibson
     [not found]         ` <20171109064850.GE7732-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-11-09 10:27           ` Pantelis Antoniou
2017-11-28 13:58           ` Grant Likely
2017-11-09 10:16       ` Pantelis Antoniou
2017-11-28 15:45         ` Grant Likely
2017-11-03 13:59 ` Rob Herring
     [not found]   ` <CAL_JsqK1rtc81+=vzc36w4MRmQGYXBeib+QCj0TxtxEMVN2bKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-03 14:11     ` Pantelis Antoniou
     [not found]       ` <8DE272D8-6004-4A47-B49C-D3DFB7D9E23C-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2017-11-03 14:31         ` Rob Herring
     [not found]           ` <CAL_JsqLx7fDZGNnxc-DXTajvDWGojNFDEUZeBG3A8LMduDNLtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-03 14:41             ` Pantelis Antoniou
     [not found]               ` <E863FAFC-7613-4262-9C9D-0D2A4EF5F880-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2017-11-06 16:12                 ` Rob Herring
     [not found]                   ` <CAL_Jsq+zkKA-78WH0fPTstCfPZhvxdcOCd74uqwu=xNvr++1aA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-06 21:22                     ` Grant Likely
2017-11-07 13:46                     ` Grant Likely
     [not found]                       ` <CACxGe6t7CebKJqq+-nOa_adYJM2QL9hn74k5HhseTPR5G1hHRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-07 15:34                         ` Rob Herring
     [not found]                           ` <CAL_Jsq+t=bk+W5uekojsX9KzLUp6MGqgVeR5gC-H5L-hnm6SAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-28 13:34                             ` Grant Likely
2017-12-19  4:57                         ` David Gibson
2017-11-14  0:11         ` David Gibson
     [not found]           ` <20171114001114.GC32308-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-11-14  8:48             ` Grant Likely
2017-11-03 20:02 ` Frank Rowand
2017-11-28 17:10 ` Grant Likely

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