Skip to content

Commit 87143fc

Browse files
frowandrobherring
authored andcommitted
of: add dtc annotations functionality to dtx_diff
Add -T and --annotations command line arguments to dtx_diff. These arguments will be passed through to dtc. dtc will then add source location annotations to its output. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 89716dc commit 87143fc

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎scripts/dtc/dtx_diff‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ Usage:
2121
diff DTx_1 and DTx_2
2222
2323
24+
--annotate synonym for -T
2425
-f print full dts in diff (--unified=99999)
2526
-h synonym for --help
2627
-help synonym for --help
2728
--help print this message and exit
2829
-s SRCTREE linux kernel source tree is at path SRCTREE
2930
(default is current directory)
3031
-S linux kernel source tree is at root of current git repo
32+
-T Annotate output .dts with input source file and line (-T -T for more details)
3133
-u unsorted, do not sort DTx
3234
3335
@@ -174,6 +176,7 @@ compile_to_dts() {
174176

175177
# ----- start of script
176178

179+
annotate=""
177180
cmd_diff=0
178181
diff_flags="-u"
179182
dtx_file_1=""
@@ -208,6 +211,14 @@ while [ $# -gt 0 ] ; do
208211
shift
209212
;;
210213

214+
-T | --annotate )
215+
if [ "${annotate}" = "" ] ; then
216+
annotate="-T"
217+
elif [ "${annotate}" = "-T" ] ; then
218+
annotate="-T -T"
219+
fi
220+
shift
221+
;;
211222
-u )
212223
dtc_sort=""
213224
shift
@@ -327,7 +338,7 @@ cpp_flags="\
327338
DTC="\
328339
${DTC} \
329340
-i ${srctree}/scripts/dtc/include-prefixes \
330-
-O dts -qq -f ${dtc_sort} -o -"
341+
-O dts -qq -f ${dtc_sort} ${annotate} -o -"
331342

332343

333344
# ----- do the diff or decompile

0 commit comments

Comments
 (0)