
Understanding compatible Strings and How Drivers Match Them
How a device tree compatible list is written, why the most specific name comes first, and how the kernel scores matches. Covers fallback strings and modaliases.
Tag
7 posts

How a device tree compatible list is written, why the most specific name comes first, and how the kernel scores matches. Covers fallback strings and modaliases.

Add an SPI peripheral to a device tree with reg as the chip select, spi-max-frequency and the mode flags, using an MCP3008 ADC as the worked example.

Select a pin's function with pinctrl-names and pinctrl-0, define groups in the SoC's pin controller node and check the result in debugfs.

Add a TMP102 temperature sensor to an I2C bus in a device tree with compatible, reg and status, then check that Linux bound the driver and exposes a reading.

Use dtc to compile a .dts into a .dtb, turn a .dtb back into readable source and read the warnings it prints. The flags that matter, with exact commands.

A device tree is a data file that tells the Linux kernel what hardware a board has, because ARM chips cannot be probed. Learn what is in it and why it exists.

Learn the device tree language, how Linux uses it, and how to write, build, layer, validate and debug a board description from a blank file to a bound driver.