In linux, what is difference between Open firmware device tree and flattened device tree. How to identify the linux kernel is using which Device tree OF DT or FDT.
The Flattened Device Tree (FDT) is a data structure. Nothing more. It describes a machine hardware configuration. It is derived from the device tree format used by Open Firmware.
A device tree is a tree-structured data format that represents information about the devices on a board. Using device trees provides: • Fewer “machine code” and “board” files. • A single unmodified kernel used for many platforms.
dtsi files are included files, containing definitions of SoC-level information, while . dts files are final device trees containing board-level information. The . dtsi extension denotes “device tree source include”.
Device Tree Source (DTS) files are simple text files that can be compiled into a binary Device Tree Blob (DTB) format using the Device Tree Compiler (DTC) tool.
From here:
Open Firmware is a firmware interface specification designed by Sun in the late 1980's, and ported to many architectures. It specifies a runtime OS client interface, an cross platform device interface (FCode), a user interface, and the Device Tree layout for describing the machine.
FDT is to Open Firmware what DSDT is to ACPI. The FDT reuses Open Firmware's established device tree layout. In fact, Linux PowerPC support uses the same codebase to support both Open Firmware and FDT platforms.
As you can see, Flattened Device Tree (FDT) is a part of Open Firmware. So basically "Open Firmware Device Tree" and "Flattened Device Tree" is the same thing.
Take a look at drivers/of/base.c. It was added back in 1996, but functions from it are used for nowadays ARM device tree. So FDT is just a part of OF. That's why all functions for device tree begin with of_
prefix.
If you need more details, next articles may be useful:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With