具有 GPIO 控制器和连接器的硬件配置的备树(Device Tree)代码讲解
背景
-学习Linux设备树
代码
soc {
soc_gpio1: gpio-controller1 {
#gpio-cells = <2>;
};
soc_gpio2: gpio-controller2 {
#gpio-cells = <2>;
};
};
connector: connector {
#gpio-cells = <2>;
gpio-map = <0 0 &soc_gpio1 1 0>,
<1 0 &soc_gpio2 4 0>,
<2 0 &soc_gpio1 3 0>,
<3 0 &soc_gpio2 2 0>;
gpio-map-mask = <0xf 0x0>;
gpio-map-pass-thru = <0x0 0x1>;
};
expansion_device {
reset-gpios = <&connector 2 GPIO_ACTIVE_LOW>;
};
代码讲解
- soc 节点
这个节点定义了两个 GPIO 控制器,soc_gpio1 和 soc_gpio2,每个控制器都有一个 #gpio-cells 属性:</
标签:map,soc,备树,cells,Tree,控制器,连接器,GPIO,gpio From: https://blog.csdn.net/a72944392/article/details/140698192