Lines Matching +full:- +full:- +full:print +full:- +full:architecture
2 # SPDX-License-Identifier: GPL-2.0-only
22 --annotate synonym for -T
23 --color synonym for -c (requires diff with --color support)
24 -c enable colored output
25 -f print full dts in diff (--unified=99999)
26 -h synonym for --help
27 -help synonym for --help
28 --help print this message and exit
29 -s SRCTREE linux kernel source tree is at path SRCTREE
31 -S linux kernel source tree is at root of current git repo
32 -T annotate output .dts with input source file and line
33 (-T -T for more details)
34 -u unsorted, do not sort DTx
38 file. If DTx is a dts source file then it is pre-processed in the same
45 /proc/device-tree.
54 linux source tree can be provided by '-s SRCTREE' or '-S' so that
57 The shell variable \${ARCH} must provide the architecture containing
90 if [ -d "${dtx}" ] ; then
92 # ----- input is file tree
94 if ( ! ${DTC} -I fs ${dtx} ) ; then
98 elif [ -f "${dtx}" ] && [ -r "${dtx}" ] ; then
100 magic=`hexdump -n 4 -e '/1 "%02x"' ${dtx}`
103 # ----- input is FDT (binary blob)
105 if ( ! ${DTC} -I dtb ${dtx} ) ; then
113 # ----- input is DTS (source)
115 if ( cpp ${cpp_flags} -x assembler-with-cpp ${dtx} \
116 | ${DTC} ${dtc_include} -I dts ) ; then
132 dtx_arch=`echo "/${dtx}" | sed -e 's|.*/arch/||' -e 's|/.*||'`
134 if [ "${dtx_arch}" != "" -a "${dtx_arch}" != "${ARCH}" ] ; then
137 echo " architecture ${dtx_arch} is in file path," >&2
142 if [ ! -d ${srctree}/arch/${ARCH} ] ; then
147 echo " Possible fix: use '-s' option" >&2
149 git_root=`git rev-parse --show-toplevel 2>/dev/null`
150 if [ -d ${git_root}/arch/ ] ; then
151 echo " Possible fix: use '-S' option" >&2
174 # ----- start of script
178 diff_flags="-u"
182 dtc_sort="-s"
187 while [ $# -gt 0 ] ; do
191 -c | --color )
192 if diff --color /dev/null /dev/null 2>/dev/null ; then
193 diff_color="--color=always"
198 -f )
199 diff_flags="--unified=999999"
203 -h | -help | --help )
208 -s )
213 -S )
214 git_root=`git rev-parse --show-toplevel 2>/dev/null`
219 -T | --annotate )
221 annotate="-T"
222 elif [ "${annotate}" = "-T" ] ; then
223 annotate="-T -T"
227 -u )
272 # ----- prefer dtc from linux kernel, allow fallback to dtc in $PATH
284 if [ ! -x ${DTC} ] ; then
286 if grep -q "^CONFIG_DTC=y" ${__KBUILD_OUTPUT}/.config 2>/dev/null; then
309 If not at the root of the Linux kernel source tree -s SRCTREE or -S
316 If \${KBUILD_OUTPUT} is a relative path, then '-s SRCDIR', -S, or run
328 # ----- cpp and dtc flags same as for linux source tree build of .dtb files,
331 dtx_path_1_dtc_include="-i `dirname ${dtx_file_1}`"
335 dtx_path_2_dtc_include="-i `dirname ${dtx_file_2}`"
339 -nostdinc \
340 -I${srctree}/scripts/dtc/include-prefixes \
341 -undef -D__DTS__"
345 -i ${srctree}/scripts/dtc/include-prefixes \
346 -O dts -qq -f ${dtc_sort} ${annotate} -o -"
349 # ----- do the diff or decompile
353 diff ${diff_flags} ${diff_color} --label "${dtx_file_1}" --label "${dtx_file_2}" \