All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] dtc: dts source location annotation
@ 2015-09-16  4:08 Frank Rowand
       [not found] ` <55F8EB35.5010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Rowand @ 2015-09-16  4:08 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

A common dts source file convention is for a system .dts file
to include default SOC and/or device .dtsi files and then add
additional system specific properties or over-ride property values
from the .dtsi files.  It can be a time consuming and error prone
exercise to determine exactly what nodes, properties, and property
values are in the final .dtb binary blob and where they originated.

The purpose of this proof of concept patch series is to modify
the dtc compiler to be able to create an output .dts with
annotations describing the source location of each node and
property that would exist in the .dtb if the .dts was compiled.

I am looking for feedback first on the concept, and secondly on
the implementation.  I am totally bison ignorant and will not
be offended if told that I took an entirely wrong approach to
implement the concept (although in that case pointers to a
more correct approach would be appreciated).

As an example, one device tree node for the dragonboard is:

 sdhci@f9824900 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:14 */
                        compatible = "qcom,sdhci-msm-v4"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:240 */
                        reg = <0xf9824900 0x11c 0xf9824000 0x800>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:241 */
                        reg-names = "hc_mem", "core_mem"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:242 */
                        interrupts = <0x0 0x7b 0x0 0x0 0x8a 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:243 */
                        interrupt-names = "hc_irq", "pwr_irq"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:244 */
                        clocks = <0xd 0xd8 0xd 0xd7>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:245 */
                        clock-names = "core", "iface"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:246 */
                        status = "ok"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:17 */
                        bus-width = <0x8>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:15 */
                        non-removable; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:16 */
                }; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:18 */


qcom-apq8074-dragonboard.dts:
   - last referenced the sdhci node
   - changed the value of the "status" property from "disabled" to "ok"
   - added two properties, "bus-width" and "non-removable"

qcom-msm8974.dtsi:
   - initially set the value the "status" property to "disabled"
     (not visible in the annotated .dts)
   - provided all of the other property values

I will provide the entire annotated .dts file that I extracted the
example node from as a reply to this email.

When the dtc compiler is run within the Linux kernel build system,
the path of the source files will be the full absolute path, just
as seen for gcc warnings and errors.  I always trim away the path
leading up to the Linux kernel source tree by passing the kernel
build output through a sed pipe.  I have done the same to the
annotated .dts file to remove the excessive verbosity in the
source paths.

The annotated .dts file can be created automatically in the Linux
kernel build directory as file .XXX.dtb.annotate.dts.tmp as a
by-product of building the dtb binary blob file XXX.dtb.  The patch
to the Linux kernel build system to enable this is the final patch
in the series.  That patch is not intended to be submitted to the
Linux kernel yet, but is included here to allow easier testing of
the other patches.  If you want to use that patch to build an
annotated .dts file then you will have to copy the updated version
of the dtc compiler into the kernel build directory at
scripts/dtc/dtc first.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-21 17:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16  4:08 [RFC PATCH 0/3] dtc: dts source location annotation Frank Rowand
     [not found] ` <55F8EB35.5010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-16  4:19   ` Frank Rowand
2015-09-16  4:22   ` [RFC PATCH 1/3] " Frank Rowand
     [not found]     ` <55F8EE7A.7080301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-21  6:31       ` David Gibson
     [not found]         ` <20150921063119.GL20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2015-09-21 17:55           ` Frank Rowand
2015-09-16  4:24   ` [RFC PATCH 2/3] dtc: make check test for dtc --annotate Frank Rowand
     [not found]     ` <55F8EF1B.1040003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-09-21  6:33       ` David Gibson
     [not found]         ` <20150921063336.GM20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2015-09-21 17:55           ` Frank Rowand
2015-09-16  4:29   ` [RFC PATCH 3/3] dtc: linux kernel build process to create annotated .dts Frank Rowand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.