FDT (Flattened Device-Tree): Property name (strings): Comma terminated string instead of NUL character

1

I have started to write a library for reading FDT (DTB) format files, but run into a problem with a test DTB file. The DTB file is form a board (Digilent ZYBO-Z7) which I own. I compiled the source device-trees from the actual Linux Kernel.

There are two property names ('linux' and 'phandle') which are concatenated with a comma character instead of a NUL character.

The property structure (Blue and Red) points (Red) to the string after the comma:

enter image description here

Blue: 0x00000004 (Property value size)
Red: 0x00000105 (Property string offset)
Green: 0x00000007 (Property value)

The strings block starts at offset 0x1D4C.

Here is a shortened hexdump output of the strings section in the DTB file:

enter image description here

The two with comma concatenated strings starts at offset 0x1E4B and ends at offset 0x1E57. At offset 0x1E50 is the comma.

Is this a correct behavior?

UPDATE:

I found this quote:

Property "linux,phandle" is obsolete. If it exists, its value should be equivalent to the value of property "phandle".

Source

I my test file there is only one property name "linux,phandle". No "normal" property names "phandle". Also tried another DTB file with the same result.

Is this for Backward compatibility? Because linux,phandle and the sub string phandle (starts at offset 0x1E51) have the same property value (0x00000007) in the first screenshot.

linux-kernel
reverse-engineering
device-tree
bsp
asked on Stack Overflow Dec 6, 2019 by krjdev • edited Dec 11, 2019 by krjdev

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0