On 9/12/24 16:36, CVS wrote:
Hmmm... in the above examples, using --annotate on a single source file,
it is not immediately evident whether the existing annotation logic within dtc
handles "append-property" across multiple dts(i) files properly.
As you can see, the -T (annotate) and -T -T (detailed annotate)
options will add inline comments in the final unified device-tree with
the actual source file:line.
This is a critical feature in managing complex hierarchies of dtsi
files being included in a dts.
Until now (without the append-property keyword), IIUC, there can be
ONLY one source file/line responsible for a line in the final unified
device-tree. The latest line specifying a property overwrites all
other specifications of a property before it.
With the introduction of this append-property keyword, now more than
one file:line can be a source of a line in the final unified
device-tree. So, i wonder how the annotations will look like in the
scenario in which more than one source file:line is responsible for
the content of a single line in the final unified device-tree.
If by any chance there is insufficient annotation containing of all
the lines responsible for the final "appended list", i worry it will
be a nightmare to identify the source of the resulting "appended list"
of values being assigned to a property.
regards
CVS
So I tried it with 3 files:
base.dtsi
```
/dts-v1/;
/ {
prop = "0";
propa = <0>;
};
```
app1.dtsi
```
/dts-v1/;
/include/ "base.dtsi"
/ {
/append-property/ prop = "1";
};
```
app2.dts
```
/dts-v1/;
/include/ "app1.dtsi"
/ {
/append-property/ prop = "2";
/append-property/ propa = <2>;
};
```
Output:
❯ ../dtc -T -T -o temp.dts app2.dts
❯ cat temp.dts
/dts-v1/;
/ { /* base.dtsi:3:3-7:3, app1.dtsi:5:3-7:3, app2.dts:5:3-8:3 */
prop = "0", "1", "2"; /* app2.dts:6:2-6:31 */
propa = <0x00>, <0x02>; /* app2.dts:7:2-7:32 */
}; /* base.dtsi:3:3-7:3, app1.dtsi:5:3-7:3, app2.dts:5:3-8:3 */
So it seems to only contain info about the last append file. I will fix
it in the next patch. It just needs to have info regarding all files
that appended to it right? We already seem to be doing that for nodes so
I can probably use similar strategy for properties.
Ayush Singh