1, a brief introduction of the device tree

1, dts is converted into dtb

2, dtb is transmitted cores, the core is parsed device_node (each node corresponds to a)

3, device_node platform_device solution is converted into structure (resources)

 

Use the device tree, calling a function to match the match bus, driver not only has a name, and a pointer of_match_table

Structure pointed to members of compatible, and compatible attribute platform_device inside dts obtained from the comparison, as if it matches, call the driver's probe function

 

If platform_device from the device tree structure, the structure inside the containing device structure of_node, which contains some properties, such as compatible, regs, pin, etc.

 

A well-written driver, it will try to determine the resources used,
only the left can not determine the resources the device tree, so that the device tree to specify.

Schematic OK "driver can not determine the hardware resources," according to then fill in the corresponding content in the device tree file
then fill in the content of what is the format?

. a look at the document: Core Documentation / DeviceTree / Bindings /
. b refer to the same type of device tree veneer file
. c online search
. When d is really no recourse but to study driver source code

 

Guess you like

Origin www.cnblogs.com/liusiluandzhangkun/p/11627684.html