How to program Linux .dts device tree files?

Ezio picture Ezio · Jul 5, 2013 · Viewed 35.1k times · Source

I'm going to launch a Linux on my development board, and i need a dts file (device tree file) to describe the whole hardware. But I only know very little about the syntax of this file which is not enough to run Linux properly on the board.

What i know now are only how to describe a unit's interrupt number, frequency, address, parent-unit and its compatible driver type (as described below):

ps7_scuwdt_0: ps7-scuwdt@f8f00620 {
                        compatible = "xlnx,ps7-scuwdt-1.00.a";
                        device_type = "watchdog";
                        interrupt-parent = <&ps7_scugic_0>;
                        interrupts = < 1 14 769 >;
                        reg = < 0xf8f00620 0xe0 >;
                } ;

Other advanced usage or grammar is unfamiliar to me.

Answer

TheCodeArtist picture TheCodeArtist · Jul 22, 2013

Take a look at the dts of the board which most closely resembles your dev-board. Use that as a reference and make changes to the dts according to the differences between the reference board and your dev-board.

Also checkout the following :
- Device-tree Documentation project at eLinux (has a vast collection of links to start reading).
- Series of articles on the basics of device tree.
- Walkthrough of migrating to device-tree.