硬件环境:创龙tl-3568开发板
bsp: rk356x_linux_release_v1.3.1_20221120
1、全编译
根据 3-1 Linux 系统使用手册全编译后在/路径下存在
tl3568-evm.dtb,这个就是开发板的设备树,将他拷出来
2、反编译
之所以需要反编译,是因为开发板dts包含了多个dts和dtsi,什么增加属性,删除节点,难以看出全部属性。所以需要编译后反编译生成一个文件,使用指令
dtc -I dtb -O dts -o pl.dts tl3568-evm.dtb
有一堆警告,不用管,至此,得到 pl.dts,如图:
cpus {
#address-cells = <0x2>;
#size-cells = <0x0>;
cpu@0 {
device_type = "cpu";
compatible = "arm,cortex-a55";
reg = <0x0 0x0>;
enable-method = "psci";
clocks = <0x2 0x0>;
operating-points-v2 = <0x3>;
cpu-idle-states = <0x4>;
#cooling-cells = <0x2>;
dynamic-power-coefficient = <0xbb>;
cpu-supply = <0x5>;
phandle = <0x9>;
};
cpu@100 {
device_type = "cpu";
compatible = "arm,cortex-a55";
reg = <0x0 0x100>;
enable-method = "psci";
clocks = <0x2 0x0>;
operating-points-v2 = <0x3>;
cpu-idle-states = <0x4>;
phandle = <0xa>;
};
cpu@200 {
device_type = "cpu";
compatible = "arm,cortex-a55";
reg = <0x0 0x200>;
enable-method = "psci";
clocks = <0x2 0x0>;
operating-points-v2 = <0x3>;
cpu-idle-states = <0x4>;
phandle = <0xb>;
};
cpu@300 {
device_type = "cpu";
compatible = "arm,cortex-a55";
reg = <0x0 0x300>;
enable-method = "psci";
clocks = <0x2 0x0>;
operating-points-v2 = <0x3>;
cpu-idle-states = <0x4>;
phandle = <0xc>;
};
一共7000多行,我需要配置设备树包含I2C1:
先找到I2C1的地址,然后搜索地址
找到status属性,改成:“okay”:
3、修改其他节点的status属性,使其能够正常使用外设,其中RK809是电源管理芯片,在核心板上,不能disabled,不然会无法启动。
4、再次全编译烧到开发板上,登陆后可以看在原来没有的i2c1出现了: