Skip to content

Implement a new DTS Source Language

Jon Loeliger linux-devicetree 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest9 patches 69 repliesIn review
  2. v18 patches 16 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Remove support for the legacy DTS source file format.dtc-lexer.l dtc-parser.y tests/base01.dts +7 more+77 -1703 replies
2/9Add conditionalized debug() print macro.dtc.h+8 -00 replies
3/9Enhance source position implementation.srcpos.c srcpos.h+107 -71 reply
4/9Add header files for new Internal Representation form.ir.h ir_builtin.h ir_scope.h+321 -01 reply
5/9Add most of the new IR implementation files.ir.c ir_builtin.c ir_dump.c +2 more+1400 -00 replies
6/9Add the main IR evaluation implementationir_eval.c+1504 -00 replies
7/9Introduce new DTS language.Makefile Makefile.dtc dtc-lexer.l +14 more+1068 -2701 reply
8/9Add documentation for the new DTS language.Documentation/manual.txt+463 -3761 replies
9/9Test constant expressions in cell contexts.tests/Makefile.tests tests/cell-expressions.c tests/run_tests.sh+122 -02 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH 0/9 V3] Implement a new DTS Source Language

This series of patches enhances the DTS source language to support a fullly interpreted language for generating nodes and properties. It is backward compatible with V1 sources.

The main features implemented by this patch set support function definitions, 'if', 'for', 'return' and assignment statements. Local variables, global constants and almost complete C-like expressions are also supported.

Enhancements to the source position and error/warning reporting now support source column positions too.

Version 1 was the original posting.
Version 2 only fixed one patch in the series

This is Version 3 and it includes fixes and suggestions due to community review and feedback, and includes a new patch that provides some testing. Git bisectability has been ensured as well.

Jon Loeliger (9):
Remove support for the legacy DTS source file format. Add conditionalized debug() print macro. Enhance source position implementation.
Add header files for new Internal Representation form. Add most of the new IR implementation files. Add the main IR evaluation implementation Introduce new DTS language.
Add documentation for the new DTS language. Test constant expressions in cell contexts.

 Documentation/manual.txt  |  500 ++++++++++++++--
 Makefile                  |    2 +-
 Makefile.dtc              |   18 +-
 dtc-lexer.l               |  311 +++++++---
 dtc-parser.y              |  721 ++++++++++++++++------
 dtc.c                     |    7 +-
 dtc.h                     |    9 +
 ir.c                      |  190 ++++++
 ir.h                      |  175 ++++++
 ir_builtin.c              |  180 ++++++
 ir_builtin.h              |   31 +
 ir_dump.c                 |  211 +++++++
 ir_emit.c                 |  490 +++++++++++++++
 ir_eval.c                 | 1502 +++++++++++++++++++++++++++++++++++++++++++++
 ir_scope.c                |  318 ++++++++++
 ir_scope.h                |  114 ++++
 livetree.c                |   16 +
 nv.c                      |  108 ++++
 nv.h                      |   34 +
 srcpos.c                  |  142 ++++-
 srcpos.h                  |   23 +-
 tests/Makefile.tests      |    1 +
 tests/base01.dts          |   24 +-
 tests/cell-expressions.c  |  116 ++++
 tests/empty.dts           |    2 +
 tests/escapes.dts         |    2 +
 tests/label01.dts         |   38 +-
 tests/references_dts0.dts |   12 +-
 tests/run_tests.sh        |   32 +-
 tests/test01.dts          |   38 +-
 tests/test_tree1_dts0.dts |   18 +-
 treesource.c              |    3 +
 32 files changed, 4987 insertions(+), 401 deletions(-)
 create mode 100644 ir.c
 create mode 100644 ir.h
 create mode 100644 ir_builtin.c
 create mode 100644 ir_builtin.h
 create mode 100644 ir_dump.c
 create mode 100644 ir_emit.c
 create mode 100644 ir_eval.c
 create mode 100644 ir_scope.c
 create mode 100644 ir_scope.h
 create mode 100644 nv.c
 create mode 100644 nv.h
 create mode 100644 tests/cell-expressions.c