Platform devices and device trees
Posted Jun 23, 2011 20:53 UTC (Thu) by glikely
In reply to: Platform devices and device trees
Parent article: Platform devices and device trees
- there does not seem to be any "device trees" checker, so that errors are found at execution time and not compilation/link time.
The device tree compiler (dtc) does some semantic checking. It is limited, but adding more semantic checking is definitely welcome and encouraged.
- the kernel, at the time it is analysing the "device trees", is still looking for its serial port or permanent storage, so it cannot display or store any kind of error/warning message.
At least on ARM, if you're debugging, the low level debug code can select an output device at kernel build time and get output even in the startup assembly code. Well before even looking at the DT data.
- in an area where kernels are often seriously patched (embedded), a construct may be valid for a stock kernel but not parse-able by a modified kernel.
Not sure what the argument is here. Yes, out of tree code is often filled with unconventional hacks that don't survive by the time they hit mainline. However, once DT bindings are mainlined, we try *really hard* not to break them. On of the requirements for merging DT parsing code is that it must also document any new bindings in the Documentation directory.
Moreover, boards with system-on-chip processor have a constant part due to the system-on-chip used, and it would probably be better to keep the system-on-chip description (big but limited number) separate of the one of the board (unlimited).
The device tree compiler has an include mechanism so that multiple board .dts files can include a single SoC .dts description. The SoC description is indeed static, and any number of boards can be build off of it. I did consider a scheme of passing multiple dtbs to the kernel, one for configuration, one for board layout, one for SoC layout, etc, but figuring out how to get the kernel to manage the separated blobs was worse overall. Instead, it is handled in the dts source form and merged into a single dtb by dtc.
to post comments)