One database, one door

8 September 2026 · Notes

The question a device tree editor has to answer is small and constant: this node says compatible = "cdns,i2c-r1p14" — what is it allowed to carry, and what must it carry? The answer exists, in the kernel's own binding schemas. It is just not in a shape you can ask.

Block diagram: ingestion builds bindings.db from kernel sources; a service layer is the only thing that opens it; the desktop application talks only to that layer.
Ingestion runs once, offline. Everything above the database goes through one layer.

Ingestion

The bindings are around 5,600 YAML files spread across Documentation/devicetree/bindings/, and most of what a device requires is not written in its own file — it is inherited through $ref from a class schema like i2c-controller.yaml. Reading that at edit time would mean resolving a graph per keystroke, so it happens once instead: the schemas are processed with dt-schema, the device trees are parsed, the dt-bindings headers are expanded with the preprocessor, and the result is written to SQLite.

One column comes from somewhere else entirely. Which kernel release does this binding first appear in is written in no file — it lives in the repository's history, and it is read by walking release tags rather than commits.

The index

What comes out is self-contained, and that matters more than its size: a user's machine has no kernel checkout. So the sources go in too — every .dts, .dtsi and header, compressed — which is what lets an #include resolve on a laptop that has never cloned Linux.

One door

Above the database there is exactly one layer that opens it. Nothing above that layer writes SQL, knows a table name, or holds a connection. That is a boring constraint and it pays for itself twice: the semantic engine can be handed a lookup in a test without a database existing at all, and the day the storage changes there is one file to change rather than a search across the interface.

The rule it enforces is stricter than it looks — resolution is exact, with no fuzzy fallback anywhere. A near match invents requirements, and an invented requirement is worse than silence: it sends someone looking for a property their hardware does not have.

What it buys

The editor answers offline, on the line you are editing, in the time it takes to type the next character. No network, no kernel tree, no make dtbs_check round trip.

← Back to documentation