在嵌入式Linux中,你会常见这些缩写:
DT | device tree |
FDT | flattened device tree |
OF | open firmware |
DTS | device tree source |
DTSI | device tree source include |
DTB | device tree blob |
DTC | device tree compiler |
设备树属性获取函数头文件:
源码目录include/linux/of.h
struct device_node {
.....
.....
}
获取属性参数的函数:
struct property *of_find_property( .... )
linux的GPIO系统参考文档:
源码目录
Documentation/devicetree/bindings/gpio/gpio.txt
参考内容
example
node{
enable-gpios=<&qe_pio_e 18 GPIO_ACTIVE_HIGH>
};
设备树节点,可以互相包含,互相也可以引用----"&" 引用符号 表示引用。
pinctrl文档:
源码目录Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
关于Image,zImage:
内核编译(make)之后会生成两个文件,一个Image,一个zImage,其中Image为内 核映像文件,而zImage为内核的一种映像压缩文件,Image大约为4M,而zImage不到2M。 那么uImage又是什么的?它是uboot专用的映像文件,它是在zImage之前加上一个长度为64字节的“头”,说明这个内核的版本、加载位置、生成时间、大小等信息。
编译:
- 内部编译:将内核模块文件放在内核中进行编译
- 静态编译:将内核模块编译进uImage中
- 外部编译:将内核模块编译源文件放在内核源码外进行编译
- 动态编译:编译生成动态模块xxx.ko