Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In linux, what is difference between Open firmware device tree and flattened device tree

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.

like image 641
Spyder Avatar asked Nov 02 '15 04:11

Spyder


People also ask

What is a flattened device tree?

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.

What is device tree in Linux?

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.

What is the difference between DTS and Dtsi?

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”.

What is DTS and DTB?

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.


1 Answers

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:

  • Open Firmware
  • Device Tree
like image 63
Sam Protsenko Avatar answered Oct 16 '22 14:10

Sam Protsenko