User Tools

Site Tools


gsoc:2024-gsoc-device-tree-bindings

This is an old revision of the document!


GSoC 2024: Device tree bindings

Device tree

Device tree is a tree structured data describes devices on a board. This is used by operating system's kernel in order to manage a computer hardware components including cpus, buses and external peripherals.

Device tree bindings

A device tree bindings file offers information about the properties supported by Linux kernel device tree blob.

Location for this documents is under Documentation/devicetree/bindings/ d `

To be updated

Proposal 1: Convert device tree bindings to DT schema

1 contributor medium-size (175hours) Level of difficulty: Intermediate

Historically device tree bindings were written in plain .txt files. These files serve only as documentation but they cannot really be used to validate the syntax used in device tree files.

In order to improve validation of dts files, Linux kernel switched to writing device tree bindings using json-schema.

The goal of the project is to convert as much .txt files into .yaml json-schema files.

$ linux/Documentation/devicetree/bindings$ find . -name '*.txt' | wc -l 1795

You can have a look at this example .

Tips for writing a good proposal:

  • understand basic concepts about writing a device tree binding file. Look here and here .
  • demonstrate the knowledge about device tree bindings by writing a small patch to convert a .txt file to yaml.
    • look inside Documentation/devicetree/bindings
    • start with small and simple .txt file and convert it to yaml
    • create a a small patch and review it with the mentor
    • verify the patch:
      • make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
      • make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml
      • make DT_CHECKER_FLAGS=-m dt_binding_check
    • send the patch to Linux kernel mailing list and work with the community to get it merged
  • before submitting the proposal discuss with the mentor about a plan and a set of .txt files to work on

How to find ideas of patches to create:

1) Look for small txt files that might be easier to convert.

  • Suggestion is for files to have in mind Documentation/devicetree/bindings/{sound|iio|hwmon,regulator, rtc, watchdog}.
  • Use git log and look into history to see how similar patches where done.
    • For example git log 715f45854f559f361d2c222a0353a3a1818875ed

2) Cleanup all easy dtbs_check warnings for the platforms, like node names, unused/not allowed properties. Run make dtbs_check.

Desired knowledge: C, shell scripting, make, git Code license: GPL-2.0 OR BSD-3-Clause

The project is considered successful if the code is accepted into mainline Linux kernel tree.

Mentor: Daniel Baluta daniel.baluta@nxp.com

How do I get started?

gsoc/2024-gsoc-device-tree-bindings.1707394537.txt.gz · Last modified: 2024/02/08 12:15 by dbaluta