使用DTC命令转储设备树信息

主要步骤

  1. 执行sudo apt-get update,获取的最新的软件包列表。
geduer@gdk8:~$ sudo apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu-ports bionic InRelease
Hit:2 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu-ports bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu-ports bionic-backports InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu-ports bionic-security InRelease
Reading package lists... Done
  1. 执行sudo apt install device-tree-compiler,安装dtc命令。
geduer@gdk8:~$ sudo apt install device-tree-compiler
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  device-tree-compiler
0 upgraded, 1 newly installed, 0 to remove and 334 not upgraded.
Need to get 230 kB of archives.
After this operation, 427 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu-ports bionic/main arm64 device-tree-compiler arm64 1.4.5-3 [230 kB]
Fetched 230 kB in 1s (408 kB/s)
Selecting previously unselected package device-tree-compiler.
dpkg: warning: files list file for package 'firefly-multi-rtsp' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'firefly-3399pronpu-driver' missing; assuming package has no files currently installed
(Reading database ... 94668 files and directories currently installed.)
Preparing to unpack .../device-tree-compiler_1.4.5-3_arm64.deb ...
Unpacking device-tree-compiler (1.4.5-3) ...
Setting up device-tree-compiler (1.4.5-3) ...
  1. 执行sudo dtc -I fs -O dts -o dts.txt /proc/device-tree,转储设备树信息。
    dtc [-I 输入格式] [-O 输出格式] [-o 输出的文件名] [-V 输出的版本] [输入的文件名]
    输入格式:dtb \ dts \ fs
    输出格式:dtb \ dts \ asm
geduer@gdk8:~$ sudo dtc -I fs -O dts -o dts.txt /proc/device-tree
dts.txt: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name
dts.txt: Warning (unit_address_vs_reg): Node /regulators/regulator@0 has a unit name, but no reg property
dts.txt: Warning (unit_address_vs_reg): Node /regulators/regulator@1 has a unit name, but no reg property
dts.txt: Warning (unit_address_vs_reg): Node /usb@ff600000 has a unit name, but no reg property
dts.txt: Warning (unit_address_format): Node /reserved-memory/drm-logo@00000000 unit name should not have leading 0s
dts.txt: Warning (simple_bus_reg): Node /regulators/regulator@0 missing or empty reg/ranges property
dts.txt: Warning (simple_bus_reg): Node /regulators/regulator@1 missing or empty reg/ranges property
  1. 查看dts.txt文件内的设备树信息。
geduer@gdk8:~$ cat dts.txt | more
/dts-v1/;

/ {
        model = "Rockchip RK3328 box GDK8";
        compatible = "rockchip,rk3328-box-liantong", "rockchip,rk3328";
        serial-number = "JPX53POBYZ";
        #address-cells = <0x2>;
        #size-cells = <0x2>;
        interrupt-parent = <0x1>;

        dmc {
                ddr_timing = <0x7e>;
                upthreshold = <0x28>;
                compatible = "rockchip,rk3328-dmc";
                clock-names = "dmc_clk";
                operating-points-v2 = <0x7d>;
                clocks = <0x2 0x40>;
                devfreq-events = <0x7c>;
                #cooling-cells = <0x2>;
                system-status-freq = <0x1 0xbfe50 0x8 0xbfe50 0x2 0xbfe50 0x20 0xbfe50 0x10 0xbfe50 0x10000 0xbfe
50 0x2000 0xbfe50 0x1000 0xbfe50>;
                downdifferential = <0x14>;
                auto-freq-en = <0x0>;
                status = "okay";
                center-supply = <0x48>;
                phandle = <0x32>;
                auto-min-freq = <0xbfe50>;

                ddr_power_model {
                        ts = <0x7d00 0x125c 0xffffffb0 0x2>;
                        compatible = "ddr_power_model";
                        thermal-zone = "soc-thermal";
                        phandle = <0xcf>;
                        dynamic-power-coefficient = <0x78>;
                        static-power-coefficient = <0xc8>;
                };
        };

        amba {
                compatible = "simple-bus";
作者:admin  创建时间:2021-12-27 10:30
最后编辑:admin  更新时间:2024-06-05 18:18