A40id的设备树文件最近在学习设备树,尝试着在A40i中添加设备树信息,还算比较顺利。
1、linux系统下的设备树文件:
/root/workspace/allwinner/A40i/bsp/lichee/linux-3.10/arch/arm/boot/dts
sun8iw11p1.dtsi
sun8iw11p1-clk.dtsi
sun8iw11p1-OKA40i_C.dts
sun8iw11p1-OKT3_C.dts
sun8iw11p1-pinctrl.dtsi
2、在sun8iw11p1-OKA40i_C.dts文件中添加设备树细节代码如下:
#include "sun8iw11p1_pwm1.dtsi"
/{
巴拉巴拉;
gps:gps {
compatible = "allwinner,sunxi-gps";
clocks = <&clk_outb>;
status = "disabled";
};
mytest:mytest{
#address-cells=<1>;
#size-cells=<1>;
compatible = "mytest";
reg = <0x01C20800 0x00000004>;
status = "okay";
};
}
3、设备树写入后节点状态查询
需要在系统启动uboot时打断启动。
结果如下:
sunxi#fdt list /mytest
mytest {
#address-cells = <0x00000001>;
#size-cells = <0x00000001>;
compatible = "mytest";
reg = <0x01c20800 0x00000004>;
status = "okay";
};
A40id的设备树文件最近在学习设备树,尝试着在A40i中添加设备树信息,还算比较顺利。
1、linux系统下的设备树文件:
/root/workspace/allwinner/A40i/bsp/lichee/linux-3.10/arch/arm/boot/dts
sun8iw11p1.dtsi
sun8iw11p1-clk.dtsi
sun8iw11p1-OKA40i_C.dts
sun8iw11p1-OKT3_C.dts
sun8iw11p1-pinctrl.dtsi
2、在sun8iw11p1-OKA40i_C.dts文件中添加设备树细节代码如下:
#include "sun8iw11p1_pwm1.dtsi"
/{
巴拉巴拉;
gps:gps {
compatible = "allwinner,sunxi-gps";
clocks = <&clk_outb>;
status = "disabled";
};
mytest:mytest{
#address-cells=<1>;
#size-cells=<1>;
compatible = "mytest";
reg = <0x01C20800 0x00000004>;
status = "okay";
};
}
3、设备树写入后节点状态查询
需要在系统启动uboot时打断启动。
结果如下:
sunxi#fdt list /mytest
mytest {
#address-cells = <0x00000001>;
#size-cells = <0x00000001>;
compatible = "mytest";
reg = <0x01c20800 0x00000004>;
status = "okay";
};
举报