fdtdump outputs wrong values

Bug #1617186 reported by Jorik Jonker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
device-tree-compiler (Ubuntu)
New
Undecided
Unassigned

Bug Description

In an attempt to debug a (unrelated!) FDT/kernel issue, I was fdtdump-ing my device tree. The values in dumped phandle's seemed wrong, and upon closer inspection, it turned out a bug in util.c, which was fixed in commit 883238dc508e721db694277c5273a4c3e9a7132f. This bug seems only to affect fdtdump and not fdtget.

To reproduce / see for yourself:

1) download (for instance) my DTB (attached)
2) fdtdump it, search for "serial@01c28400" (node /soc/serial@01c28400)
3) watch the line saying "clocks = <0x00000002 0x000001a2>;" (or something similar)
4) fdtget /tmp/test.dtb /soc/serial@01c28400 clocks
5) see it say "2 63"

To test if 3 or 5 outputs the actual values in the FDT, I verified the value on my SoC having booted this exact DTB:

 jorik@oxygen:~$ hexdump /sys/firmware/devicetree/base/soc/serial@01c28400/clocks
 0000000 0000 0200 0000 3f00
 0000008

Which translates to "2 63".

I've backported 883238dc508e721db694277c5273a4c3e9a7132f to xenial's device-tree-compiler (see my PPA, jorik-kippendief/dtc, but it contains a different unrelated patch as well), and it applies without trouble and fixes this issue.

I would suggest to adopt 883238dc508e721db694277c5273a4c3e9a7132f into the package, or better, update to 1.4.1.

Revision history for this message
Jorik Jonker (jorik-kippendief) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.