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

* Re: [RFC PATCH 0/3] dtc: dts source location annotation
       [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
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Frank Rowand @ 2015-09-16  4:19 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

On 9/15/2015 9:08 PM, Frank Rowand wrote:

< snip >

> 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.

< snip >

Here is the entire annotated .dts file:


/dts-v1/;

/ { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:5 */
	#address-cells = <0x1>; /* arch/arm/boot/dts/skeleton.dtsi:8 */
	#size-cells = <0x1>; /* arch/arm/boot/dts/skeleton.dtsi:9 */
	model = "Qualcomm APQ8074 Dragonboard"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:6 */
	compatible = "qcom,apq8074-dragonboard", "qcom,apq8074"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:7 */
	interrupt-parent = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:10 */

	chosen { /* arch/arm/boot/dts/skeleton.dtsi:10 */
	}; /* arch/arm/boot/dts/skeleton.dtsi:10 */

	aliases { /* arch/arm/boot/dts/skeleton.dtsi:11 */
	}; /* arch/arm/boot/dts/skeleton.dtsi:11 */

	memory { /* arch/arm/boot/dts/skeleton.dtsi:12 */
		device_type = "memory"; /* arch/arm/boot/dts/skeleton.dtsi:12 */
		reg = <0x0 0x0>; /* arch/arm/boot/dts/skeleton.dtsi:12 */
	}; /* arch/arm/boot/dts/skeleton.dtsi:12 */

	cpus { /* arch/arm/boot/dts/qcom-msm8974.dtsi:12 */
		#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:13 */
		#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:14 */
		interrupts = <0x1 0x9 0xf04>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:15 */

		cpu@0 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:17 */
			compatible = "qcom,krait"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:18 */
			enable-method = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:19 */
			device_type = "cpu"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:20 */
			reg = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:21 */
			next-level-cache = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:22 */
			qcom,acc = <0x3>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:23 */
			qcom,saw = <0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:24 */
			cpu-idle-states = <0x5>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:25 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:26 */

		cpu@1 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:28 */
			compatible = "qcom,krait"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:29 */
			enable-method = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:30 */
			device_type = "cpu"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:31 */
			reg = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:32 */
			next-level-cache = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:33 */
			qcom,acc = <0x6>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:34 */
			qcom,saw = <0x7>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:35 */
			cpu-idle-states = <0x5>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:36 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:37 */

		cpu@2 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:39 */
			compatible = "qcom,krait"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:40 */
			enable-method = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:41 */
			device_type = "cpu"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:42 */
			reg = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:43 */
			next-level-cache = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:44 */
			qcom,acc = <0x8>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:45 */
			qcom,saw = <0x9>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:46 */
			cpu-idle-states = <0x5>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:47 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:48 */

		cpu@3 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:50 */
			compatible = "qcom,krait"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:51 */
			enable-method = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:52 */
			device_type = "cpu"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:53 */
			reg = <0x3>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:54 */
			next-level-cache = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:55 */
			qcom,acc = <0xa>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:56 */
			qcom,saw = <0xb>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:57 */
			cpu-idle-states = <0x5>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:58 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:59 */

		L2: l2-cache { /* arch/arm/boot/dts/qcom-msm8974.dtsi:61 */
			compatible = "cache"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:62 */
			cache-level = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:63 */
			qcom,saw = <0xc>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:64 */
			linux,phandle = <0x2>; /* __builtin__:0 */
			phandle = <0x2>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:65 */

		idle-states { /* arch/arm/boot/dts/qcom-msm8974.dtsi:67 */

			CPU_SPC: spc { /* arch/arm/boot/dts/qcom-msm8974.dtsi:68 */
				compatible = "qcom,idle-state-spc", "arm,idle-state"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:70 */
				entry-latency-us = <0x96>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:71 */
				exit-latency-us = <0xc8>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:72 */
				min-residency-us = <0x7d0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:73 */
				linux,phandle = <0x5>; /* __builtin__:0 */
				phandle = <0x5>; /* __builtin__:0 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:74 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:75 */
	}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:76 */

	cpu-pmu { /* arch/arm/boot/dts/qcom-msm8974.dtsi:78 */
		compatible = "qcom,krait-pmu"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:79 */
		interrupts = <0x1 0x7 0xf04>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:80 */
	}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:81 */

	timer { /* arch/arm/boot/dts/qcom-msm8974.dtsi:83 */
		compatible = "arm,armv7-timer"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:84 */
		interrupts = <0x1 0x2 0xf08 0x1 0x3 0xf08 0x1 0x4 0xf08 0x1 0x1 0xf08>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:88 */
		clock-frequency = <0x124f800>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:89 */
	}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:90 */

	soc: soc { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:9 */
		#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:93 */
		#size-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:94 */
		ranges; /* arch/arm/boot/dts/qcom-msm8974.dtsi:95 */
		compatible = "simple-bus"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:96 */

		intc: interrupt-controller@f9000000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:98 */
			compatible = "qcom,msm-qgic2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:99 */
			interrupt-controller; /* arch/arm/boot/dts/qcom-msm8974.dtsi:100 */
			#interrupt-cells = <0x3>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:101 */
			reg = <0xf9000000 0x1000 0xf9002000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:103 */
			linux,phandle = <0x1>; /* __builtin__:0 */
			phandle = <0x1>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:104 */

		timer@f9020000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:106 */
			#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:107 */
			#size-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:108 */
			ranges; /* arch/arm/boot/dts/qcom-msm8974.dtsi:109 */
			compatible = "arm,armv7-timer-mem"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:110 */
			reg = <0xf9020000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:111 */
			clock-frequency = <0x124f800>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:112 */

			frame@f9021000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:114 */
				frame-number = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:115 */
				interrupts = <0x0 0x8 0x4 0x0 0x7 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:117 */
				reg = <0xf9021000 0x1000 0xf9022000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:119 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:120 */

			frame@f9023000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:122 */
				frame-number = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:123 */
				interrupts = <0x0 0x9 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:124 */
				reg = <0xf9023000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:125 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:126 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:127 */

			frame@f9024000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:129 */
				frame-number = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:130 */
				interrupts = <0x0 0xa 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:131 */
				reg = <0xf9024000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:132 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:133 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:134 */

			frame@f9025000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:136 */
				frame-number = <0x3>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:137 */
				interrupts = <0x0 0xb 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:138 */
				reg = <0xf9025000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:139 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:140 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:141 */

			frame@f9026000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:143 */
				frame-number = <0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:144 */
				interrupts = <0x0 0xc 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:145 */
				reg = <0xf9026000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:146 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:147 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:148 */

			frame@f9027000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:150 */
				frame-number = <0x5>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:151 */
				interrupts = <0x0 0xd 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:152 */
				reg = <0xf9027000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:153 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:154 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:155 */

			frame@f9028000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:157 */
				frame-number = <0x6>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:158 */
				interrupts = <0x0 0xe 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:159 */
				reg = <0xf9028000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:160 */
				status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:161 */
			}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:162 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:163 */

		saw0: power-controller@f9089000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:165 */
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:166 */
			reg = <0xf9089000 0x1000 0xf9009000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:167 */
			linux,phandle = <0x4>; /* __builtin__:0 */
			phandle = <0x4>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:168 */

		saw1: power-controller@f9099000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:170 */
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:171 */
			reg = <0xf9099000 0x1000 0xf9009000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:172 */
			linux,phandle = <0x7>; /* __builtin__:0 */
			phandle = <0x7>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:173 */

		saw2: power-controller@f90a9000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:175 */
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:176 */
			reg = <0xf90a9000 0x1000 0xf9009000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:177 */
			linux,phandle = <0x9>; /* __builtin__:0 */
			phandle = <0x9>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:178 */

		saw3: power-controller@f90b9000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:180 */
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:181 */
			reg = <0xf90b9000 0x1000 0xf9009000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:182 */
			linux,phandle = <0xb>; /* __builtin__:0 */
			phandle = <0xb>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:183 */

		saw_l2: power-controller@f9012000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:185 */
			compatible = "qcom,saw2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:186 */
			reg = <0xf9012000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:187 */
			regulator; /* arch/arm/boot/dts/qcom-msm8974.dtsi:188 */
			linux,phandle = <0xc>; /* __builtin__:0 */
			phandle = <0xc>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:189 */

		acc0: clock-controller@f9088000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:191 */
			compatible = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:192 */
			reg = <0xf9088000 0x1000 0xf9008000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:193 */
			linux,phandle = <0x3>; /* __builtin__:0 */
			phandle = <0x3>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:194 */

		acc1: clock-controller@f9098000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:196 */
			compatible = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:197 */
			reg = <0xf9098000 0x1000 0xf9008000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:198 */
			linux,phandle = <0x6>; /* __builtin__:0 */
			phandle = <0x6>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:199 */

		acc2: clock-controller@f90a8000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:201 */
			compatible = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:202 */
			reg = <0xf90a8000 0x1000 0xf9008000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:203 */
			linux,phandle = <0x8>; /* __builtin__:0 */
			phandle = <0x8>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:204 */

		acc3: clock-controller@f90b8000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:206 */
			compatible = "qcom,kpss-acc-v2"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:207 */
			reg = <0xf90b8000 0x1000 0xf9008000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:208 */
			linux,phandle = <0xa>; /* __builtin__:0 */
			phandle = <0xa>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:209 */

		restart@fc4ab000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:211 */
			compatible = "qcom,pshold"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:212 */
			reg = <0xfc4ab000 0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:213 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:214 */

		gcc: clock-controller@fc400000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:216 */
			compatible = "qcom,gcc-msm8974"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:217 */
			#clock-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:218 */
			#reset-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:219 */
			reg = <0xfc400000 0x4000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:220 */
			linux,phandle = <0xd>; /* __builtin__:0 */
			phandle = <0xd>; /* __builtin__:0 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:221 */

		mmcc: clock-controller@fd8c0000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:223 */
			compatible = "qcom,mmcc-msm8974"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:224 */
			#clock-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:225 */
			#reset-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:226 */
			reg = <0xfd8c0000 0x6000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:227 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:228 */

		serial@f991e000 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:10 */
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:231 */
			reg = <0xf991e000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:232 */
			interrupts = <0x0 0x6c 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:233 */
			clocks = <0xd 0x67 0xd 0x57>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:234 */
			clock-names = "core", "iface"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:235 */
			status = "ok"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:11 */
		}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:12 */

		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 */

		sdhci@f98a4900 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:20 */
			compatible = "qcom,sdhci-msm-v4"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:251 */
			reg = <0xf98a4900 0x11c 0xf98a4000 0x800>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:252 */
			reg-names = "hc_mem", "core_mem"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:253 */
			interrupts = <0x0 0x7d 0x0 0x0 0xdd 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:254 */
			interrupt-names = "hc_irq", "pwr_irq"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:255 */
			clocks = <0xd 0xdb 0xd 0xda>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:256 */
			clock-names = "core", "iface"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:257 */
			status = "disabled"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:258 */
			cd-gpios = <0xe 0x3e 0x1>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:21 */
			bus-width = <0x4>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:22 */
		}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:23 */

		rng@f9bff000 { /* arch/arm/boot/dts/qcom-msm8974.dtsi:261 */
			compatible = "qcom,prng"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:262 */
			reg = <0xf9bff000 0x200>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:263 */
			clocks = <0xd 0xc3>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:264 */
			clock-names = "core"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:265 */
		}; /* arch/arm/boot/dts/qcom-msm8974.dtsi:266 */

		msmgpio: pinctrl@fd510000 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:26 */
			compatible = "qcom,msm8974-pinctrl"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:269 */
			reg = <0xfd510000 0x4000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:270 */
			gpio-controller; /* arch/arm/boot/dts/qcom-msm8974.dtsi:271 */
			#gpio-cells = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:272 */
			interrupt-controller; /* arch/arm/boot/dts/qcom-msm8974.dtsi:273 */
			#interrupt-cells = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:274 */
			interrupts = <0x0 0xd0 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:275 */
			linux,phandle = <0xe>; /* __builtin__:0 */
			phandle = <0xe>; /* __builtin__:0 */

			i2c11_pins: i2c11 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:27 */
				linux,phandle = <0xf>; /* __builtin__:0 */
				phandle = <0xf>; /* __builtin__:0 */

				mux { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:28 */
					pins = "gpio83", "gpio84"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:29 */
					function = "blsp_i2c11"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:30 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:31 */
			}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:32 */

			spi8_default: spi8_default { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:34 */

				mosi { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:35 */
					pins = "gpio45"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:36 */
					function = "blsp_spi8"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:37 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:38 */

				miso { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:39 */
					pins = "gpio46"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:40 */
					function = "blsp_spi8"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:41 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:42 */

				cs { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:43 */
					pins = "gpio47"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:44 */
					function = "blsp_spi8"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:45 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:46 */

				clk { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:47 */
					pins = "gpio48"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:48 */
					function = "blsp_spi8"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:49 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:50 */
			}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:51 */
		}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:52 */

		blsp_i2c11: i2c@f9967000 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:54 */
			status = "okay"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:55 */
			compatible = "qcom,i2c-qup-v2.1.1"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:280 */
			reg = <0xf9967000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:281 */
			interrupts = <0x0 0x69 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:282 */
			clocks = <0xd 0x7b 0xd 0x71>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:283 */
			clock-names = "core", "iface"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:284 */
			#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:285 */
			#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:286 */
			clock-frequency = <0x30d40>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:56 */
			pinctrl-0 = <0xf>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:57 */
			pinctrl-names = "default"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:58 */

			eeprom: eeprom@52 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:60 */
				compatible = "atmel,24c128"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:61 */
				reg = <0x52>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:62 */
				pagesize = <0x20>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:63 */
				read-only; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:64 */
			}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:65 */
		}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:66 */

		spmi_bus: spmi@fc4cf000 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:5 */
			compatible = "qcom,spmi-pmic-arb"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:290 */
			reg-names = "core", "intr", "cnfg"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:291 */
			reg = <0xfc4cf000 0x1000 0xfc4cb000 0x1000 0xfc4ca000 0x1000>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:294 */
			interrupt-names = "periph_irq"; /* arch/arm/boot/dts/qcom-msm8974.dtsi:295 */
			interrupts = <0x0 0xbe 0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:296 */
			qcom,ee = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:297 */
			qcom,channel = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:298 */
			#address-cells = <0x2>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:299 */
			#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:300 */
			interrupt-controller; /* arch/arm/boot/dts/qcom-msm8974.dtsi:301 */
			#interrupt-cells = <0x4>; /* arch/arm/boot/dts/qcom-msm8974.dtsi:302 */

			usid4: pm8841@4 { /* arch/arm/boot/dts/qcom-pm8841.dtsi:6 */
				compatible = "qcom,spmi-pmic"; /* arch/arm/boot/dts/qcom-pm8841.dtsi:7 */
				reg = <0x4 0x0>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:8 */
				#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:9 */
				#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:10 */

				pm8841_mpps: mpps@a000 { /* arch/arm/boot/dts/qcom-pm8841.dtsi:12 */
					compatible = "qcom,pm8841-mpp"; /* arch/arm/boot/dts/qcom-pm8841.dtsi:13 */
					reg = <0xa000 0x400>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:14 */
					gpio-controller; /* arch/arm/boot/dts/qcom-pm8841.dtsi:15 */
					#gpio-cells = <0x2>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:16 */
					interrupts = <0x4 0xa0 0x0 0x0 0x4 0xa1 0x0 0x0 0x4 0xa2 0x0 0x0 0x4 0xa3 0x0 0x0>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:20 */
				}; /* arch/arm/boot/dts/qcom-pm8841.dtsi:21 */

				temp-alarm@2400 { /* arch/arm/boot/dts/qcom-pm8841.dtsi:23 */
					compatible = "qcom,spmi-temp-alarm"; /* arch/arm/boot/dts/qcom-pm8841.dtsi:24 */
					reg = <0x2400 0x100>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:25 */
					interrupts = <0x4 0x24 0x0 0x1>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:26 */
				}; /* arch/arm/boot/dts/qcom-pm8841.dtsi:27 */
			}; /* arch/arm/boot/dts/qcom-pm8841.dtsi:28 */

			usid5: pm8841@5 { /* arch/arm/boot/dts/qcom-pm8841.dtsi:30 */
				compatible = "qcom,spmi-pmic"; /* arch/arm/boot/dts/qcom-pm8841.dtsi:31 */
				reg = <0x5 0x0>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:32 */
				#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:33 */
				#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8841.dtsi:34 */
			}; /* arch/arm/boot/dts/qcom-pm8841.dtsi:35 */

			usid0: pm8941@0 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:7 */
				compatible = "qcom,spmi-pmic"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:8 */
				reg = <0x0 0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:9 */
				#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:10 */
				#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:11 */

				pm8941_coincell: qcom,coincell@2800 { /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:70 */
					compatible = "qcom,pm8941-coincell"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:14 */
					reg = <0x2800>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:15 */
					status = "ok"; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:71 */
					qcom,rset-ohms = <0x834>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:72 */
					qcom,vset-millivolts = <0xbb8>; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:73 */
					qcom,charge-enable; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:74 */
				}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:75 */

				rtc@6000 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:19 */
					compatible = "qcom,pm8941-rtc"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:20 */
					reg = <0x6000 0x100 0x6100 0x100>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:22 */
					reg-names = "rtc", "alarm"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:23 */
					interrupts = <0x0 0x61 0x1 0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:24 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:25 */

				pwrkey@800 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:27 */
					compatible = "qcom,pm8941-pwrkey"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:28 */
					reg = <0x800 0x100>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:29 */
					interrupts = <0x0 0x8 0x0 0x3>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:30 */
					debounce = <0x3d09>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:31 */
					bias-pull-up; /* arch/arm/boot/dts/qcom-pm8941.dtsi:32 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:33 */

				pm8941_gpios: gpios@c000 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:35 */
					compatible = "qcom,pm8941-gpio"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:36 */
					reg = <0xc000 0x2400>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:37 */
					gpio-controller; /* arch/arm/boot/dts/qcom-pm8941.dtsi:38 */
					#gpio-cells = <0x2>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:39 */
					interrupts = <0x0 0xc0 0x0 0x0 0x0 0xc1 0x0 0x0 0x0 0xc2 0x0 0x0 0x0 0xc3 0x0 0x0 0x0 0xc4 0x0 0x0 0x0 0xc5 0x0 0x0 0x0 0xc6 0x0 0x0 0x0 0xc7 0x0 0x0 0x0 0xc8 0x0 0x0 0x0 0xc9 0x0 0x0 0x0 0xca 0x0 0x0 0x0 0xcb 0x0 0x0 0x0 0xcc 0x0 0x0 0x0 0xcd 0x0 0x0 0x0 0xce 0x0 0x0 0x0 0xcf 0x0 0x0 0x0 0xd0 0x0 0x0 0x0 0xd1 0x0 0x0 0x0 0xd2 0x0 0x0 0x0 0xd3 0x0 0x0 0x0 0xd4 0x0 0x0 0x0 0xd5 0x0 0x0 0x0 0xd6 0x0 0x0 0x0 0xd7 0x0 0x0 0x0 0xd8 0x0 0x0 0x0 0xd9 0x0 0x0 0x0 0xda 0x0 0x0 0x0 0xdb 0x0 0x0 0x0 0xdc 0x0 0x0 0x0 0xdd 0x0 0x0 0x0 0xde 0x0 0x0 0x0 0xdf 0x0 0x0 0x0 0xe0 0x0 0x0 0x0 0xe1 0x0 0x0 0x0 0xe2 0x0 0x0 0x0 0xe3 0x0 0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:75 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:76 */

				pm8941_mpps: mpps@a000 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:78 */
					compatible = "qcom,pm8941-mpp"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:79 */
					reg = <0xa000 0x800>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:80 */
					gpio-controller; /* arch/arm/boot/dts/qcom-pm8941.dtsi:81 */
					#gpio-cells = <0x2>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:82 */
					interrupts = <0x0 0xa0 0x0 0x0 0x0 0xa1 0x0 0x0 0x0 0xa2 0x0 0x0 0x0 0xa3 0x0 0x0 0x0 0xa4 0x0 0x0 0x0 0xa5 0x0 0x0 0x0 0xa6 0x0 0x0 0x0 0xa7 0x0 0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:90 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:91 */

				pm8941_temp: temp-alarm@2400 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:93 */
					compatible = "qcom,spmi-temp-alarm"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:94 */
					reg = <0x2400 0x100>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:95 */
					interrupts = <0x0 0x24 0x0 0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:96 */
					io-channels = <0x10 0x8>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:97 */
					io-channel-names = "thermal"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:98 */
					#thermal-sensor-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:99 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:100 */

				pm8941_vadc: vadc@3100 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:102 */
					compatible = "qcom,spmi-vadc"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:103 */
					reg = <0x3100 0x100>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:104 */
					interrupts = <0x0 0x31 0x0 0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:105 */
					#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:106 */
					#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:107 */
					#io-channel-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:108 */
					linux,phandle = <0x10>; /* __builtin__:0 */
					phandle = <0x10>; /* __builtin__:0 */

					die_temp { /* arch/arm/boot/dts/qcom-pm8941.dtsi:110 */
						reg = <0x8>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:111 */
					}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:112 */

					ref_625mv { /* arch/arm/boot/dts/qcom-pm8941.dtsi:113 */
						reg = <0x9>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:114 */
					}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:115 */

					ref_1250v { /* arch/arm/boot/dts/qcom-pm8941.dtsi:116 */
						reg = <0xa>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:117 */
					}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:118 */

					ref_gnd { /* arch/arm/boot/dts/qcom-pm8941.dtsi:119 */
						reg = <0xe>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:120 */
					}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:121 */

					ref_vdd { /* arch/arm/boot/dts/qcom-pm8941.dtsi:122 */
						reg = <0xf>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:123 */
					}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:124 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:125 */

				pm8941_iadc: iadc@3600 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:127 */
					compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:128 */
					reg = <0x3600 0x100 0x12f1 0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:130 */
					interrupts = <0x0 0x36 0x0 0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:131 */
					qcom,external-resistor-micro-ohms = <0x2710>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:132 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:133 */
			}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:134 */

			usid1: pm8941@1 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:136 */
				compatible = "qcom,spmi-pmic"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:137 */
				reg = <0x1 0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:138 */
				#address-cells = <0x1>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:139 */
				#size-cells = <0x0>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:140 */

				wled@d800 { /* arch/arm/boot/dts/qcom-pm8941.dtsi:142 */
					compatible = "qcom,pm8941-wled"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:143 */
					reg = <0xd800 0x100>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:144 */
					label = "backlight"; /* arch/arm/boot/dts/qcom-pm8941.dtsi:145 */
					qcom,cs-out; /* arch/arm/boot/dts/qcom-pm8941.dtsi:147 */
					qcom,current-limit = <0x14>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:148 */
					qcom,current-boost-limit = <0x325>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:149 */
					qcom,switching-freq = <0x640>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:150 */
					qcom,ovp = <0x1d>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:151 */
					qcom,num-strings = <0x2>; /* arch/arm/boot/dts/qcom-pm8941.dtsi:152 */
				}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:153 */
			}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:154 */
		}; /* arch/arm/boot/dts/qcom-pm8941.dtsi:155 */
	}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:67 */
}; /* arch/arm/boot/dts/qcom-apq8074-dragonboard.dts:68 */

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

* [RFC PATCH 1/3] dtc: dts source location annotation
       [not found] ` <55F8EB35.5010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-09-16  4:19   ` Frank Rowand
@ 2015-09-16  4:22   ` Frank Rowand
       [not found]     ` <55F8EE7A.7080301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-09-16  4:24   ` [RFC PATCH 2/3] dtc: make check test for dtc --annotate Frank Rowand
  2015-09-16  4:29   ` [RFC PATCH 3/3] dtc: linux kernel build process to create annotated .dts Frank Rowand
  3 siblings, 1 reply; 9+ messages in thread
From: Frank Rowand @ 2015-09-16  4:22 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA


From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>

Proof of concept patch.

Annotates input source file and line number of nodes and properties
as comments in output .dts file when --annotate flag is supplied.

Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
---
 dtc-lexer.l  |    2 +
 dtc.c        |    9 ++++++++
 dtc.h        |   14 +++++++++++++
 livetree.c   |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 srcpos.h     |    6 +++++
 treesource.c |   27 ++++++++++++++++++++-----
 6 files changed, 115 insertions(+), 5 deletions(-)

Index: b/dtc.h
===================================================================
--- a/dtc.h
+++ b/dtc.h
@@ -54,6 +54,7 @@ extern int reservenum;		/* Number of mem
 extern int minsize;		/* Minimum blob size */
 extern int padsize;		/* Additional padding to blob */
 extern int phandle_format;	/* Use linux,phandle or phandle properties */
+extern bool annotate;		/* annotate .dts with input source location */
 
 #define PHANDLE_LEGACY	0x1
 #define PHANDLE_EPAPR	0x2
@@ -126,6 +127,16 @@ bool data_is_one_string(struct data d);
 #define MAX_NODENAME_LEN	31
 
 /* Live trees */
+struct src {
+	char *name;
+	int lineno;
+};
+
+struct prop_src {
+	struct prop_src *prev;
+	struct src src;
+};
+
 struct label {
 	bool deleted;
 	char *label;
@@ -140,6 +151,7 @@ struct property {
 	struct property *next;
 
 	struct label *labels;
+	struct src src;
 };
 
 struct node {
@@ -158,6 +170,8 @@ struct node {
 	int addr_cells, size_cells;
 
 	struct label *labels;
+	struct src begin_src;
+	struct src end_src;
 };
 
 #define for_each_label_withdel(l0, l) \
Index: b/livetree.c
===================================================================
--- a/livetree.c
+++ b/livetree.c
@@ -19,6 +19,9 @@
  */
 
 #include "dtc.h"
+#include "srcpos.h"
+
+struct prop_src *prev_prop_src = NULL;
 
 /*
  * Tree building functions
@@ -58,6 +61,13 @@ struct property *build_property(char *na
 
 	new->name = name;
 	new->val = val;
+	if (current_srcfile) {
+		new->src.name = current_srcfile->name;
+		new->src.lineno = current_srcfile->lineno;
+	} else {
+		new->src.name = "__builtin__";
+		new->src.lineno = 0;
+	}
 
 	return new;
 }
@@ -97,10 +107,40 @@ struct property *reverse_properties(stru
 	return head;
 }
 
+void push_prop_src(void)
+{
+	struct prop_src *new = xmalloc(sizeof(*new));
+
+	memset(new, 0, sizeof(*new));
+
+	if (current_srcfile) {
+		new->src.name = current_srcfile->name;
+		new->src.lineno = current_srcfile->lineno;
+	} else {
+		new->src.name = "__builtin__";
+		new->src.lineno = 0;
+	}
+
+	new->prev = prev_prop_src;
+	prev_prop_src = new;
+}
+
+void pop_prop_src(void)
+{
+	struct prop_src *prev;
+
+	if (prev_prop_src) {
+		prev = prev_prop_src->prev;
+		free(prev_prop_src);
+		prev_prop_src = prev;
+	}
+}
+
 struct node *build_node(struct property *proplist, struct node *children)
 {
 	struct node *new = xmalloc(sizeof(*new));
 	struct node *child;
+	struct prop_src *prev;
 
 	memset(new, 0, sizeof(*new));
 
@@ -111,6 +151,24 @@ struct node *build_node(struct property
 		child->parent = new;
 	}
 
+	prev = prev_prop_src;
+	if (prev) {
+		new->begin_src.name = prev->src.name;
+		new->begin_src.lineno = prev->src.lineno;
+		pop_prop_src();
+	} else {
+		new->begin_src.name = "__builtin__";
+		new->begin_src.lineno = 0;
+	}
+
+	if (current_srcfile) {
+		new->end_src.name = current_srcfile->name;
+		new->end_src.lineno = current_srcfile->lineno;
+	} else {
+		new->end_src.name = "__builtin__";
+		new->end_src.lineno = 0;
+	}
+
 	return new;
 }
 
@@ -169,6 +227,7 @@ struct node *merge_nodes(struct node *ol
 
 				old_prop->val = new_prop->val;
 				old_prop->deleted = 0;
+				old_prop->src = new_prop->src;
 				free(new_prop);
 				new_prop = NULL;
 				break;
@@ -209,6 +268,9 @@ struct node *merge_nodes(struct node *ol
 			add_child(old_node, new_child);
 	}
 
+	old_node->begin_src = new_node->begin_src;
+	old_node->end_src = new_node->end_src;
+
 	/* The new node contents are now merged into the old node.  Free
 	 * the new node. */
 	free(new_node);
Index: b/treesource.c
===================================================================
--- a/treesource.c
+++ b/treesource.c
@@ -202,7 +202,11 @@ static void write_propval(FILE *f, struc
 	int i;
 
 	if (len == 0) {
-		fprintf(f, ";\n");
+		if (annotate)
+			fprintf(f, "; /* %s:%d */\n",
+				prop->src.name, prop->src.lineno);
+		else
+			fprintf(f, ";\n");
 		return;
 	}
 
@@ -230,7 +234,10 @@ static void write_propval(FILE *f, struc
 		write_propval_bytes(f, prop->val);
 	}
 
-	fprintf(f, ";\n");
+	if (annotate)
+		fprintf(f, "; /* %s:%d */\n", prop->src.name, prop->src.lineno);
+	else
+		fprintf(f, ";\n");
 }
 
 static void write_tree_source_node(FILE *f, struct node *tree, int level)
@@ -242,10 +249,16 @@ static void write_tree_source_node(FILE
 	write_prefix(f, level);
 	for_each_label(tree->labels, l)
 		fprintf(f, "%s: ", l->label);
+
 	if (tree->name && (*tree->name))
-		fprintf(f, "%s {\n", tree->name);
+		fprintf(f, "%s {", tree->name);
 	else
-		fprintf(f, "/ {\n");
+		fprintf(f, "/ {");
+	if (annotate) {
+		fprintf(f, " /* %s:%d */\n",
+			tree->begin_src.name, tree->begin_src.lineno);
+	} else
+		fprintf(f, "\n");
 
 	for_each_property(tree, prop) {
 		write_prefix(f, level+1);
@@ -259,7 +272,11 @@ static void write_tree_source_node(FILE
 		write_tree_source_node(f, child, level+1);
 	}
 	write_prefix(f, level);
-	fprintf(f, "};\n");
+	if (annotate)
+		fprintf(f, "}; /* %s:%d */\n",
+			tree->end_src.name, tree->end_src.lineno);
+	else
+		fprintf(f, "};\n");
 }
 
 
Index: b/dtc.c
===================================================================
--- a/dtc.c
+++ b/dtc.c
@@ -29,6 +29,7 @@ int reservenum;		/* Number of memory res
 int minsize;		/* Minimum blob size */
 int padsize;		/* Additional padding to blob */
 int phandle_format = PHANDLE_BOTH;	/* Use linux,phandle or phandle properties */
+bool annotate = false;	/* annotate .dts with input source location */
 
 static void fill_fullpaths(struct node *tree, const char *prefix)
 {
@@ -71,6 +72,7 @@ static struct option const usage_long_op
 	{"error",             a_argument, NULL, 'E'},
 	{"help",             no_argument, NULL, 'h'},
 	{"version",          no_argument, NULL, 'v'},
+	{"annotate",         no_argument, NULL, 'a'},
 	{NULL,               no_argument, NULL, 0x0},
 };
 static const char * const usage_opts_help[] = {
@@ -101,6 +103,7 @@ static const char * const usage_opts_hel
 	"\n\tEnable/disable errors (prefix with \"no-\")",
 	"\n\tPrint this help and exit",
 	"\n\tPrint version and exit",
+	"\n\tAnnotate output .dts with input source file and line",
 	NULL,
 };
 
@@ -125,6 +128,9 @@ int main(int argc, char *argv[])
 
 	while ((opt = util_getopt_long()) != EOF) {
 		switch (opt) {
+		case 'a':
+			annotate = true;
+			break;
 		case 'I':
 			inform = optarg;
 			break;
@@ -213,6 +219,9 @@ int main(int argc, char *argv[])
 		fprintf(depfile, "%s:", outname);
 	}
 
+	if (annotate && (!streq(inform, "dts") || !streq(outform, "dts")))
+		die("--annotate requires -I dts -O dts\n");
+
 	if (streq(inform, "dts"))
 		bi = dt_from_source(arg);
 	else if (streq(inform, "fs"))
Index: b/dtc-lexer.l
===================================================================
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -249,6 +249,8 @@ static void lexical_error(const char *fm
 				DPRINT("<PROPNODENAME>\n");
 				BEGIN(PROPNODENAME);
 			}
+			if (yytext[0] == '{')
+				push_prop_src();
 			return yytext[0];
 		}
 
Index: b/srcpos.h
===================================================================
--- a/srcpos.h
+++ b/srcpos.h
@@ -34,6 +34,8 @@ struct srcfile_state {
 extern FILE *depfile; /* = NULL */
 extern struct srcfile_state *current_srcfile; /* = NULL */
 
+extern struct prop_src *prev_prop_src; /* = NULL */
+
 /**
  * Open a source file.
  *
@@ -58,6 +60,10 @@ FILE *srcfile_relative_open(const char *
 void srcfile_push(const char *fname);
 bool srcfile_pop(void);
 
+void push_prop_src(void);
+void pop_prop_src(void);
+
+
 /**
  * Add a new directory to the search path for input files
  *

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

* [RFC PATCH 2/3] dtc: make check test for dtc --annotate
       [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
@ 2015-09-16  4:24   ` Frank Rowand
       [not found]     ` <55F8EF1B.1040003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-09-16  4:29   ` [RFC PATCH 3/3] dtc: linux kernel build process to create annotated .dts Frank Rowand
  3 siblings, 1 reply; 9+ messages in thread
From: Frank Rowand @ 2015-09-16  4:24 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>

Add dtc tests.

  - dtc --annotate to create a .dts with annotations
  - compile the annotated .dts

Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
---
 tests/run_tests.sh |    3 +++
 1 file changed, 3 insertions(+)

Index: b/tests/run_tests.sh
===================================================================
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -276,6 +276,9 @@ libfdt_tests () {
     run_dtc_test -I dts -O dtb -o sourceoutput.test.dts.test.dtb sourceoutput.test.dts
     run_test dtbs_equal_ordered sourceoutput.test.dtb sourceoutput.test.dts.test.dtb
 
+    run_dtc_test --annotate -o sourceoutput.test.annotate.dts sourceoutput.dts
+    run_dtc_test -o sourceoutput.test.annotate.dts.test.dts sourceoutput.test.annotate.dts
+
     run_dtc_test -I dts -O dtb -o embedded_nul.test.dtb embedded_nul.dts
     run_dtc_test -I dts -O dtb -o embedded_nul_equiv.test.dtb embedded_nul_equiv.dts
     run_test dtbs_equal_ordered embedded_nul.test.dtb embedded_nul_equiv.test.dtb

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

* [RFC PATCH 3/3] dtc: linux kernel build process to create annotated .dts
       [not found] ` <55F8EB35.5010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-09-16  4:24   ` [RFC PATCH 2/3] dtc: make check test for dtc --annotate Frank Rowand
@ 2015-09-16  4:29   ` Frank Rowand
  3 siblings, 0 replies; 9+ messages in thread
From: Frank Rowand @ 2015-09-16  4:29 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>

Add a new temp file in the build directory arch/${arch}/boot/dts/
that contains the expanded device tree source with source file locations.

Requires a new version of the dtc compiler that understands the
--annotate flag.

Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
---
 scripts/Makefile.lib |    3 +++
 1 file changed, 3 insertions(+)

Index: b/scripts/Makefile.lib
===================================================================
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -287,12 +287,15 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
 	$(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \
 		-i $(dir $<) $(DTC_FLAGS) \
 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
+	$(objtree)/scripts/dtc/dtc --annotate -O dts -o $(dtc-annotate-tmp) \
+		 $(dtc-tmp) ; \
 	cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
 
 $(obj)/%.dtb: $(src)/%.dts FORCE
 	$(call if_changed_dep,dtc)
 
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
+dtc-annotate-tmp = $(subst $(comma),_,$(dot-target).annotate.dts.tmp)
 
 # Bzip2
 # ---------------------------------------------------------------------------

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

* Re: [RFC PATCH 1/3] dtc: dts source location annotation
       [not found]     ` <55F8EE7A.7080301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-09-21  6:31       ` David Gibson
       [not found]         ` <20150921063119.GL20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: David Gibson @ 2015-09-21  6:31 UTC (permalink / raw)
  To: Frank Rowand; +Cc: Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 3396 bytes --]

On Tue, Sep 15, 2015 at 09:22:18PM -0700, Frank Rowand wrote:
> 
> From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> 
> Proof of concept patch.
> 
> Annotates input source file and line number of nodes and properties
> as comments in output .dts file when --annotate flag is supplied.
> 
> Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>

A like the concept, but I have some queries about the implementation.

> ---
>  dtc-lexer.l  |    2 +
>  dtc.c        |    9 ++++++++
>  dtc.h        |   14 +++++++++++++
>  livetree.c   |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  srcpos.h     |    6 +++++
>  treesource.c |   27 ++++++++++++++++++++-----
>  6 files changed, 115 insertions(+), 5 deletions(-)
> 
> Index: b/dtc.h
> ===================================================================
> --- a/dtc.h
> +++ b/dtc.h
> @@ -54,6 +54,7 @@ extern int reservenum;		/* Number of mem
>  extern int minsize;		/* Minimum blob size */
>  extern int padsize;		/* Additional padding to blob */
>  extern int phandle_format;	/* Use linux,phandle or phandle properties */
> +extern bool annotate;		/* annotate .dts with input source location */
>  
>  #define PHANDLE_LEGACY	0x1
>  #define PHANDLE_EPAPR	0x2
> @@ -126,6 +127,16 @@ bool data_is_one_string(struct data d);
>  #define MAX_NODENAME_LEN	31
>  
>  /* Live trees */
> +struct src {
> +	char *name;
> +	int lineno;
> +};

I'd prefer to see the existing struct srcpos used, rather than
creating a new structure.

> +struct prop_src {
> +	struct prop_src *prev;
> +	struct src src;
> +};
> +
>  struct label {
>  	bool deleted;
>  	char *label;
> @@ -140,6 +151,7 @@ struct property {
>  	struct property *next;
>  
>  	struct label *labels;
> +	struct src src;
>  };
>  
>  struct node {
> @@ -158,6 +170,8 @@ struct node {
>  	int addr_cells, size_cells;
>  
>  	struct label *labels;
> +	struct src begin_src;
> +	struct src end_src;
>  };
>  
>  #define for_each_label_withdel(l0, l) \
> Index: b/livetree.c
> ===================================================================
> --- a/livetree.c
> +++ b/livetree.c
> @@ -19,6 +19,9 @@
>   */
>  
>  #include "dtc.h"
> +#include "srcpos.h"
> +
> +struct prop_src *prev_prop_src = NULL;

So you've built a new global stack here, and I don't really understand
what it's for.  The parser already tracks source positions for each
construct, so you should be able to just use that.  You'd need to pass
the srcpos from dtc-parser.y into the tree building calls in more
places, but that should be it.

Or have I missed something?

>  /*
>   * Tree building functions
> @@ -58,6 +61,13 @@ struct property *build_property(char *na
>  
>  	new->name = name;
>  	new->val = val;
> +	if (current_srcfile) {
> +		new->src.name = current_srcfile->name;
> +		new->src.lineno = current_srcfile->lineno;
> +	} else {
> +		new->src.name = "__builtin__";
> +		new->src.lineno = 0;

A comment explaining when this will happen in practice would be nice.

Incidentally.. what happens if you use dtb input and try to annotate?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RFC PATCH 2/3] dtc: make check test for dtc --annotate
       [not found]     ` <55F8EF1B.1040003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-09-21  6:33       ` David Gibson
       [not found]         ` <20150921063336.GM20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: David Gibson @ 2015-09-21  6:33 UTC (permalink / raw)
  To: Frank Rowand; +Cc: Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]

On Tue, Sep 15, 2015 at 09:24:59PM -0700, Frank Rowand wrote:
> From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> 
> Add dtc tests.
> 
>   - dtc --annotate to create a .dts with annotations
>   - compile the annotated .dts
> 
> Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>

It'd be nice to make this test a bit less trivial by actually
comparing the output against a sample.  Maybe for tests/include0.dts
to give it a real workout.

> ---
>  tests/run_tests.sh |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: b/tests/run_tests.sh
> ===================================================================
> --- a/tests/run_tests.sh
> +++ b/tests/run_tests.sh
> @@ -276,6 +276,9 @@ libfdt_tests () {
>      run_dtc_test -I dts -O dtb -o sourceoutput.test.dts.test.dtb sourceoutput.test.dts
>      run_test dtbs_equal_ordered sourceoutput.test.dtb sourceoutput.test.dts.test.dtb
>  
> +    run_dtc_test --annotate -o sourceoutput.test.annotate.dts sourceoutput.dts
> +    run_dtc_test -o sourceoutput.test.annotate.dts.test.dts sourceoutput.test.annotate.dts
> +
>      run_dtc_test -I dts -O dtb -o embedded_nul.test.dtb embedded_nul.dts
>      run_dtc_test -I dts -O dtb -o embedded_nul_equiv.test.dtb embedded_nul_equiv.dts
>      run_test dtbs_equal_ordered embedded_nul.test.dtb embedded_nul_equiv.test.dtb

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RFC PATCH 1/3] dtc: dts source location annotation
       [not found]         ` <20150921063119.GL20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
@ 2015-09-21 17:55           ` Frank Rowand
  0 siblings, 0 replies; 9+ messages in thread
From: Frank Rowand @ 2015-09-21 17:55 UTC (permalink / raw)
  To: David Gibson; +Cc: Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

On 9/20/2015 11:31 PM, David Gibson wrote:
> On Tue, Sep 15, 2015 at 09:22:18PM -0700, Frank Rowand wrote:
>>
>> From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
>>
>> Proof of concept patch.
>>
>> Annotates input source file and line number of nodes and properties
>> as comments in output .dts file when --annotate flag is supplied.
>>
>> Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> 
> A like the concept, but I have some queries about the implementation.
> 
>> ---
>>  dtc-lexer.l  |    2 +
>>  dtc.c        |    9 ++++++++
>>  dtc.h        |   14 +++++++++++++
>>  livetree.c   |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  srcpos.h     |    6 +++++
>>  treesource.c |   27 ++++++++++++++++++++-----
>>  6 files changed, 115 insertions(+), 5 deletions(-)
>>
>> Index: b/dtc.h
>> ===================================================================
>> --- a/dtc.h
>> +++ b/dtc.h
>> @@ -54,6 +54,7 @@ extern int reservenum;		/* Number of mem
>>  extern int minsize;		/* Minimum blob size */
>>  extern int padsize;		/* Additional padding to blob */
>>  extern int phandle_format;	/* Use linux,phandle or phandle properties */
>> +extern bool annotate;		/* annotate .dts with input source location */
>>  
>>  #define PHANDLE_LEGACY	0x1
>>  #define PHANDLE_EPAPR	0x2
>> @@ -126,6 +127,16 @@ bool data_is_one_string(struct data d);
>>  #define MAX_NODENAME_LEN	31
>>  
>>  /* Live trees */
>> +struct src {
>> +	char *name;
>> +	int lineno;
>> +};
> 
> I'd prefer to see the existing struct srcpos used, rather than
> creating a new structure.

My next version of the patch will still have struct src, but I
will explain why it exists.  If your comment still stands with
me additional explanation, please repeat it.


> 
>> +struct prop_src {
>> +	struct prop_src *prev;
>> +	struct src src;
>> +};
>> +
>>  struct label {
>>  	bool deleted;
>>  	char *label;
>> @@ -140,6 +151,7 @@ struct property {
>>  	struct property *next;
>>  
>>  	struct label *labels;
>> +	struct src src;
>>  };
>>  
>>  struct node {
>> @@ -158,6 +170,8 @@ struct node {
>>  	int addr_cells, size_cells;
>>  
>>  	struct label *labels;
>> +	struct src begin_src;
>> +	struct src end_src;
>>  };
>>  
>>  #define for_each_label_withdel(l0, l) \
>> Index: b/livetree.c
>> ===================================================================
>> --- a/livetree.c
>> +++ b/livetree.c
>> @@ -19,6 +19,9 @@
>>   */
>>  
>>  #include "dtc.h"
>> +#include "srcpos.h"
>> +
>> +struct prop_src *prev_prop_src = NULL;
> 
> So you've built a new global stack here, and I don't really understand
> what it's for.  The parser already tracks source positions for each
> construct, so you should be able to just use that.  You'd need to pass
> the srcpos from dtc-parser.y into the tree building calls in more
> places, but that should be it.

This is the part that I struggled with most.  You have given me the clue
that I was overlooking.  I'll send out a new version without the global
stack later today.


> 
> Or have I missed something?
> 
>>  /*
>>   * Tree building functions
>> @@ -58,6 +61,13 @@ struct property *build_property(char *na
>>  
>>  	new->name = name;
>>  	new->val = val;
>> +	if (current_srcfile) {
>> +		new->src.name = current_srcfile->name;
>> +		new->src.lineno = current_srcfile->lineno;
>> +	} else {
>> +		new->src.name = "__builtin__";
>> +		new->src.lineno = 0;
> 
> A comment explaining when this will happen in practice would be nice.

I'm not sure what you are asking.  When current_srcfile will be null?
I'll add a comment for that.

> 
> Incidentally.. what happens if you use dtb input and try to annotate?

There is no source information, which means the output would be of no use.
I chose to address this by the check in dtc.c to only allow --annotate
for inform and outform of "dts".

Thanks for the comments.

-Frank

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

* Re: [RFC PATCH 2/3] dtc: make check test for dtc --annotate
       [not found]         ` <20150921063336.GM20331-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
@ 2015-09-21 17:55           ` Frank Rowand
  0 siblings, 0 replies; 9+ messages in thread
From: Frank Rowand @ 2015-09-21 17:55 UTC (permalink / raw)
  To: David Gibson; +Cc: Jon Loeliger, devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

On 9/20/2015 11:33 PM, David Gibson wrote:
> On Tue, Sep 15, 2015 at 09:24:59PM -0700, Frank Rowand wrote:
>> From: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
>>
>> Add dtc tests.
>>
>>   - dtc --annotate to create a .dts with annotations
>>   - compile the annotated .dts
>>
>> Not-signed-off-by: Frank Rowand <frank.rowand-/MT0OVThwyLZJqsBc5GL+g@public.gmane.org>
> 
> It'd be nice to make this test a bit less trivial by actually
> comparing the output against a sample.  Maybe for tests/include0.dts
> to give it a real workout.

I'll add a comparison test.


> 
>> ---
>>  tests/run_tests.sh |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> Index: b/tests/run_tests.sh
>> ===================================================================
>> --- a/tests/run_tests.sh
>> +++ b/tests/run_tests.sh
>> @@ -276,6 +276,9 @@ libfdt_tests () {
>>      run_dtc_test -I dts -O dtb -o sourceoutput.test.dts.test.dtb sourceoutput.test.dts
>>      run_test dtbs_equal_ordered sourceoutput.test.dtb sourceoutput.test.dts.test.dtb
>>  
>> +    run_dtc_test --annotate -o sourceoutput.test.annotate.dts sourceoutput.dts
>> +    run_dtc_test -o sourceoutput.test.annotate.dts.test.dts sourceoutput.test.annotate.dts
>> +
>>      run_dtc_test -I dts -O dtb -o embedded_nul.test.dtb embedded_nul.dts
>>      run_dtc_test -I dts -O dtb -o embedded_nul_equiv.test.dtb embedded_nul_equiv.dts
>>      run_test dtbs_equal_ordered embedded_nul.test.dtb embedded_nul_equiv.test.dtb
> 

^ 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.