Viewing the Flattened Device Tree from Qemu

The Qemu implementation uses a Flattened Device Tree (FTD) to manage the virtual implementation of the physical devices in a machine. I need to create a FTD entry for the MCTP-PCC implementation I am writing in Qemu. Since this is new to me, and I am working (as I most often do) via Ttrial and error, I want to see the FTD entry after I write it. Here is how I am dumping it.

In my script to run the virtual machine, I modify the machine entry from:

-machine virt \

to

-machine virt,dumpdtb=/tmp/qemu_virt.dtb \

And run the VM. It does not run for very long, and I get this output instead:

[2026-01-22T18:40:07Z INFO virtiofsd] Client disconnected, shutting down

However, I have now created a file at /tmp/qemu_virt.dtb. In order to view the contents of this file, I use the Device Tree Compiler (DTC) like this:

dtc -I dtb -O dts -o /tmp/qemu_dtb.txt /tmp/qemu_virt.dtb

The -I option says the input format is device tree binary, the -O says that the output format is human readable domain-specific-language, and the -o option says where to put the output file. The final parameter is the input file, which has no flag.

If I then look at the txt file I can see the following block:

        mctp_pcc@a008000 {
                interrupts = <0x00 0x50 0x04 0x00 0x51 0x04>;
                reg = <0x00 0xa008000 0x00 0x8000>;
                compatible = "mctp-pcc";
        };

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.