Motion to -iMX6 development board - the device tree kernel - a brief analysis of documents related to the device tree

In support equipment kernel source tree, tree equipment to replace the old version of the file to the platform kernel.

    This document describes in iMX6 development board (iMX6Q, iMX6D, iMX6PLUS) device tree of several important documents, these documents in a subsequent analysis of device drivers, are often used.

   Analysis device file tree

    IMX6Q here for an example to analyze, iMX6D PLUS and analysis methods are similar.

    First look compile the script, as shown, "build_android_kernel.sh" below is android kernel compile the script, "build_qt_kernel.sh" script is compiled kernel is t, where Qt to compile the script for example core

    Open "build_qt_kernel.sh", as shown below, it can be seen that the device is a file tree

    , "Imx6q-topeet_10.1inch.dts", "imx6q-topeet_7inch.dts" and "imx6q-topeet_9.7inch.dts" three under "arch / arm / boot / dts" directory.

    Figure above, the three file name of the device tree view, should be configured to support different screen resolutions, in addition to part of the screen, the other part should be identical, so there can be only one analysis (Actual such is the case, interest can be compared under their own).

    Here to analyze to "imx6q-topeet_10.1inch.dts" for example.

    Open the "arch / arm / boot / dts / imx6q-topeet_10.1inch.dts", look at the next call header, as shown below, there are two header files "imx6q.dtsi" and "imx6qdl-sabresd.dtsi". About this device file tree, most of which was all about graphics.

    Here we look called "imx6q.dtsi", open the "arch / arm / boot / dts / imx6q.dtsi", as shown, to see the nod file "imx6q-pinfunc.h" and "imx6qdl.dtsi" in the following figure.

    “imx6q-pinfunc.h”头文件,如果大家以前用过飞思卡尔的 arm 芯片,那么就会知道 这个是 IO 的宏定义头文件,这是很重要的一个文件,这个文件在后面会经常用到---

    “imx6q-pinfunc.h”在“arch/arm/boot/dts/imx6q-pinfunc.h”。

    另外像“dt-bindings”打头的设备树头文件,暂时不用过多关注。

    打开 “arch/arm/boot/dts/imx6qdl-sabresd.dtsi”文件,在其中可以搜到 “&iomuxc”,这个是飞思卡尔设备树文件中,给io初始化的地方。例如你要配置一个IO为输出,那么需要在这里初始化;另外一层意思就是,每一个IO都要初始化,一般我们默认 是在这个位置进行初始化。

    在这个文件下,我们可以找到常规的led,蜂鸣器和rs485的设备树注册,这表明设备树 注册都是在这个文件中,如果我们要新增加设备,需要在这里增加设备树代码,关于设备树代 码,我们后续再介绍。

   总结:

    这里分析出了以下几个重要的文件:

    1 关于屏幕(显卡)配置的设备树文件为以下几个文件(文件都在 arch/arm/boot/dts 目录下):

    mx6q-topeet_10.1inch.dts topeet_10.1inch.dts

    imx6q-topeet_7inch.dts topeet_7inch.dts

    imx6q-topeet_9.7inch.dts topeet_9.7inch.dts

    2 imx6的IO的宏定义在以下文件中:

    arch/arm/boot/dts/imx6q-pinfunc.h

    3 设备树对IO初始化和设备注册在以下文件中:

    arch/arm/boot/dts/imx6qdl-sabresd.dtsi

Guess you like

Origin www.cnblogs.com/mingyue77/p/11236217.html