[U-Boot] [PATCH 00/11] dtoc: Tidy up and add tests

Simon Glass sjg at chromium.org
Mon Jun 19 04:08:55 UTC 2017


When dtoc was originally written it was an idea without much expectation
(on my part at least) that it would be widely used. However there have
been several features requests and it is being relied on for several
rockchip boards.

At present dtoc has no tests of its own. It relies on sandbox_spl which
uses CONFIG_SPL_OF_PLATDATA to read the resulting C structures and output
their contents. This is a rather round-about way to test the tool. It is
better to have tests which specifically test dtoc's functionality.

In addition, before expanding the code it would be best to refactor it a
bit to make it easier to maintain.

This series:
- Tidies up and refactors dtoc (pylint, static functions, splitting code)
- Adds test for the main features it supports


Simon Glass (11):
  dtoc: Use self._options instead of the global options
  dtoc: Add a comment at the top
  dtoc: Split out the main class into its own file
  dtoc: Fix pylint warnings
  dtoc: Don't handle properties with / in them
  dtoc: Pass include_disabled explicitly
  dtoc: Move static functions out of the class
  dtoc: Move the main logic into the dtb_platdata file
  dtoc: Add a comment about string replace in conv_name_to_c()
  sandbox: Stop printing platdata at the start of SPL
  dtoc: Add tests

 arch/sandbox/cpu/spl.c           |  11 -
 test/py/tests/test_ofplatdata.py |  30 +--
 tools/dtoc/dtb_platdata.py       | 456 ++++++++++++++++++++++++++++++++++++++
 tools/dtoc/dtoc.py               | 466 ++++-----------------------------------
 tools/dtoc/dtoc_test.dts         |  12 +
 tools/dtoc/dtoc_test_aliases.dts |  18 ++
 tools/dtoc/dtoc_test_empty.dts   |  12 +
 tools/dtoc/dtoc_test_phandle.dts |  23 ++
 tools/dtoc/dtoc_test_simple.dts  |  48 ++++
 tools/dtoc/test_dtoc.py          | 271 +++++++++++++++++++++++
 10 files changed, 887 insertions(+), 460 deletions(-)
 create mode 100644 tools/dtoc/dtb_platdata.py
 create mode 100644 tools/dtoc/dtoc_test.dts
 create mode 100644 tools/dtoc/dtoc_test_aliases.dts
 create mode 100644 tools/dtoc/dtoc_test_empty.dts
 create mode 100644 tools/dtoc/dtoc_test_phandle.dts
 create mode 100644 tools/dtoc/dtoc_test_simple.dts
 create mode 100644 tools/dtoc/test_dtoc.py

-- 
2.13.1.518.g3df882009-goog



More information about the U-Boot mailing list