Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull Devicetree updates from Rob Herring:
"The biggest highlight here is the start of using json-schema for DT
bindings. Being able to validate bindings has been discussed for years
with little progress.

- Initial support for DT bindings using json-schema language. This is
the start of converting DT bindings from free-form text to a
structured format.

- Reworking of initrd address initialization. This moves to using the
phys address instead of virt addr in the DT parsing code. This
rework was motivated by CONFIG_DEV_BLK_INITRD causing unnecessary
rebuilding of lots of files.

- Fix stale phandle entries in phandle cache

- DT overlay validation improvements. This exposed several memory
leak bugs which have been fixed.

- Use node name and device_type helper functions in DT code

- Last remaining conversions to using %pOFn printk specifier instead
of device_node.name directly

- Create new common RTC binding doc and move all trivial RTC devices
out of trivial-devices.txt.

- New bindings for Freescale MAG3110 magnetometer, Cadence Sierra
PHY, and Xen shared memory

- Update dtc to upstream version v1.4.7-57-gf267e674d145"

* tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (68 commits)
of: __of_detach_node() - remove node from phandle cache
of: of_node_get()/of_node_put() nodes held in phandle cache
gpio-omap.txt: add reg and interrupts properties
dt-bindings: mrvl,intc: fix a trivial typo
dt-bindings: iio: magnetometer: add dt-bindings for freescale mag3110
dt-bindings: Convert trivial-devices.txt to json-schema
dt-bindings: arm: mrvl: amend Browstone compatible string
dt-bindings: arm: Convert Tegra board/soc bindings to json-schema
dt-bindings: arm: Convert ZTE board/soc bindings to json-schema
dt-bindings: arm: Add missing Xilinx boards
dt-bindings: arm: Convert Xilinx board/soc bindings to json-schema
dt-bindings: arm: Convert VIA board/soc bindings to json-schema
dt-bindings: arm: Convert ST STi board/soc bindings to json-schema
dt-bindings: arm: Convert SPEAr board/soc bindings to json-schema
dt-bindings: arm: Convert CSR SiRF board/soc bindings to json-schema
dt-bindings: arm: Convert QCom board/soc bindings to json-schema
dt-bindings: arm: Convert TI nspire board/soc bindings to json-schema
dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema
dt-bindings: arm: Convert Calxeda board/soc bindings to json-schema
dt-bindings: arm: Convert Altera board/soc bindings to json-schema
...

+3460 -1771
+1
.gitignore
··· 15 15 *.bin 16 16 *.bz2 17 17 *.c.[012]*.* 18 + *.dt.yaml 18 19 *.dtb 19 20 *.dtb.S 20 21 *.dwo
+1 -1
Documentation/Makefile
··· 2 2 # Makefile for Sphinx documentation 3 3 # 4 4 5 - subdir-y := 5 + subdir-y := devicetree/bindings/ 6 6 7 7 # You can set these variables from the command line. 8 8 SPHINXBUILD = sphinx-build
+2
Documentation/devicetree/bindings/.gitignore
··· 1 + *.example.dts 2 + processed-schema.yaml
+27
Documentation/devicetree/bindings/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + DT_DOC_CHECKER ?= dt-doc-validate 3 + DT_EXTRACT_EX ?= dt-extract-example 4 + DT_MK_SCHEMA ?= dt-mk-schema 5 + DT_MK_SCHEMA_FLAGS := $(if $(DT_SCHEMA_FILES), -u) 6 + 7 + quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<) 8 + cmd_chk_binding = $(DT_DOC_CHECKER) $< ; \ 9 + $(DT_EXTRACT_EX) $< > $@ 10 + 11 + $(obj)/%.example.dts: $(src)/%.yaml FORCE 12 + $(call if_changed,chk_binding) 13 + 14 + DT_TMP_SCHEMA := processed-schema.yaml 15 + extra-y += $(DT_TMP_SCHEMA) 16 + 17 + quiet_cmd_mk_schema = SCHEMA $@ 18 + cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^) 19 + 20 + DT_DOCS = $(shell cd $(srctree)/$(src) && find * -name '*.yaml') 21 + DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS)) 22 + 23 + extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 24 + extra-y += $(patsubst $(src)/%.yaml,%.example.dtb, $(DT_SCHEMA_FILES)) 25 + 26 + $(obj)/$(DT_TMP_SCHEMA): $(DT_SCHEMA_FILES) FORCE 27 + $(call if_changed,mk_schema)
-14
Documentation/devicetree/bindings/arm/altera.txt
··· 1 - Altera's SoCFPGA platform device tree bindings 2 - --------------------------------------------- 3 - 4 - Boards with Cyclone 5 SoC: 5 - Required root node properties: 6 - compatible = "altr,socfpga-cyclone5", "altr,socfpga"; 7 - 8 - Boards with Arria 5 SoC: 9 - Required root node properties: 10 - compatible = "altr,socfpga-arria5", "altr,socfpga"; 11 - 12 - Boards with Arria 10 SoC: 13 - Required root node properties: 14 - compatible = "altr,socfpga-arria10", "altr,socfpga";
+20
Documentation/devicetree/bindings/arm/altera.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/altera.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Altera's SoCFPGA platform device tree bindings 8 + 9 + maintainers: 10 + - Dinh Nguyen <dinguyen@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - enum: 16 + - altr,socfpga-cyclone5 17 + - altr,socfpga-arria5 18 + - altr,socfpga-arria10 19 + - const: altr,socfpga 20 + ...
-11
Documentation/devicetree/bindings/arm/altera/socfpga-clk-manager.txt
··· 1 - Altera SOCFPGA Clock Manager 2 - 3 - Required properties: 4 - - compatible : "altr,clk-mgr" 5 - - reg : Should contain base address and length for Clock Manager 6 - 7 - Example: 8 - clkmgr@ffd04000 { 9 - compatible = "altr,clk-mgr"; 10 - reg = <0xffd04000 0x1000>; 11 - };
+31
Documentation/devicetree/bindings/arm/altera/socfpga-clk-manager.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/altera/socfpga-clk-manager.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Altera SOCFPGA Clock Manager 8 + 9 + maintainers: 10 + - Dinh Nguyen <dinguyen@kernel.org> 11 + 12 + description: test 13 + 14 + properties: 15 + compatible: 16 + items: 17 + - const: altr,clk-mgr 18 + reg: 19 + maxItems: 1 20 + 21 + required: 22 + - compatible 23 + 24 + examples: 25 + - | 26 + clkmgr@ffd04000 { 27 + compatible = "altr,clk-mgr"; 28 + reg = <0xffd04000 0x1000>; 29 + }; 30 + 31 + ...
-15
Documentation/devicetree/bindings/arm/calxeda.txt
··· 1 - Calxeda Platforms Device Tree Bindings 2 - ----------------------------------------------- 3 - 4 - Boards with Calxeda Cortex-A9 based ECX-1000 (Highbank) SOC shall have the 5 - following properties. 6 - 7 - Required root node properties: 8 - - compatible = "calxeda,highbank"; 9 - 10 - 11 - Boards with Calxeda Cortex-A15 based ECX-2000 SOC shall have the following 12 - properties. 13 - 14 - Required root node properties: 15 - - compatible = "calxeda,ecx-2000";
+22
Documentation/devicetree/bindings/arm/calxeda.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/calxeda.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Calxeda Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Rob Herring <robh@kernel.org> 11 + description: |+ 12 + Bindings for boards with Calxeda Cortex-A9 based ECX-1000 (Highbank) SOC 13 + or Cortex-A15 based ECX-2000 SOCs 14 + 15 + properties: 16 + $nodename: 17 + const: '/' 18 + compatible: 19 + items: 20 + - enum: 21 + - calxeda,highbank 22 + - calxeda,ecx-2000
-490
Documentation/devicetree/bindings/arm/cpus.txt
··· 1 - ================= 2 - ARM CPUs bindings 3 - ================= 4 - 5 - The device tree allows to describe the layout of CPUs in a system through 6 - the "cpus" node, which in turn contains a number of subnodes (ie "cpu") 7 - defining properties for every cpu. 8 - 9 - Bindings for CPU nodes follow the Devicetree Specification, available from: 10 - 11 - https://www.devicetree.org/specifications/ 12 - 13 - with updates for 32-bit and 64-bit ARM systems provided in this document. 14 - 15 - ================================ 16 - Convention used in this document 17 - ================================ 18 - 19 - This document follows the conventions described in the Devicetree 20 - Specification, with the addition: 21 - 22 - - square brackets define bitfields, eg reg[7:0] value of the bitfield in 23 - the reg property contained in bits 7 down to 0 24 - 25 - ===================================== 26 - cpus and cpu node bindings definition 27 - ===================================== 28 - 29 - The ARM architecture, in accordance with the Devicetree Specification, 30 - requires the cpus and cpu nodes to be present and contain the properties 31 - described below. 32 - 33 - - cpus node 34 - 35 - Description: Container of cpu nodes 36 - 37 - The node name must be "cpus". 38 - 39 - A cpus node must define the following properties: 40 - 41 - - #address-cells 42 - Usage: required 43 - Value type: <u32> 44 - 45 - Definition depends on ARM architecture version and 46 - configuration: 47 - 48 - # On uniprocessor ARM architectures previous to v7 49 - value must be 1, to enable a simple enumeration 50 - scheme for processors that do not have a HW CPU 51 - identification register. 52 - # On 32-bit ARM 11 MPcore, ARM v7 or later systems 53 - value must be 1, that corresponds to CPUID/MPIDR 54 - registers sizes. 55 - # On ARM v8 64-bit systems value should be set to 2, 56 - that corresponds to the MPIDR_EL1 register size. 57 - If MPIDR_EL1[63:32] value is equal to 0 on all CPUs 58 - in the system, #address-cells can be set to 1, since 59 - MPIDR_EL1[63:32] bits are not used for CPUs 60 - identification. 61 - - #size-cells 62 - Usage: required 63 - Value type: <u32> 64 - Definition: must be set to 0 65 - 66 - - cpu node 67 - 68 - Description: Describes a CPU in an ARM based system 69 - 70 - PROPERTIES 71 - 72 - - device_type 73 - Usage: required 74 - Value type: <string> 75 - Definition: must be "cpu" 76 - - reg 77 - Usage and definition depend on ARM architecture version and 78 - configuration: 79 - 80 - # On uniprocessor ARM architectures previous to v7 81 - this property is required and must be set to 0. 82 - 83 - # On ARM 11 MPcore based systems this property is 84 - required and matches the CPUID[11:0] register bits. 85 - 86 - Bits [11:0] in the reg cell must be set to 87 - bits [11:0] in CPU ID register. 88 - 89 - All other bits in the reg cell must be set to 0. 90 - 91 - # On 32-bit ARM v7 or later systems this property is 92 - required and matches the CPU MPIDR[23:0] register 93 - bits. 94 - 95 - Bits [23:0] in the reg cell must be set to 96 - bits [23:0] in MPIDR. 97 - 98 - All other bits in the reg cell must be set to 0. 99 - 100 - # On ARM v8 64-bit systems this property is required 101 - and matches the MPIDR_EL1 register affinity bits. 102 - 103 - * If cpus node's #address-cells property is set to 2 104 - 105 - The first reg cell bits [7:0] must be set to 106 - bits [39:32] of MPIDR_EL1. 107 - 108 - The second reg cell bits [23:0] must be set to 109 - bits [23:0] of MPIDR_EL1. 110 - 111 - * If cpus node's #address-cells property is set to 1 112 - 113 - The reg cell bits [23:0] must be set to bits [23:0] 114 - of MPIDR_EL1. 115 - 116 - All other bits in the reg cells must be set to 0. 117 - 118 - - compatible: 119 - Usage: required 120 - Value type: <string> 121 - Definition: should be one of: 122 - "arm,arm710t" 123 - "arm,arm720t" 124 - "arm,arm740t" 125 - "arm,arm7ej-s" 126 - "arm,arm7tdmi" 127 - "arm,arm7tdmi-s" 128 - "arm,arm9es" 129 - "arm,arm9ej-s" 130 - "arm,arm920t" 131 - "arm,arm922t" 132 - "arm,arm925" 133 - "arm,arm926e-s" 134 - "arm,arm926ej-s" 135 - "arm,arm940t" 136 - "arm,arm946e-s" 137 - "arm,arm966e-s" 138 - "arm,arm968e-s" 139 - "arm,arm9tdmi" 140 - "arm,arm1020e" 141 - "arm,arm1020t" 142 - "arm,arm1022e" 143 - "arm,arm1026ej-s" 144 - "arm,arm1136j-s" 145 - "arm,arm1136jf-s" 146 - "arm,arm1156t2-s" 147 - "arm,arm1156t2f-s" 148 - "arm,arm1176jzf" 149 - "arm,arm1176jz-s" 150 - "arm,arm1176jzf-s" 151 - "arm,arm11mpcore" 152 - "arm,cortex-a5" 153 - "arm,cortex-a7" 154 - "arm,cortex-a8" 155 - "arm,cortex-a9" 156 - "arm,cortex-a12" 157 - "arm,cortex-a15" 158 - "arm,cortex-a17" 159 - "arm,cortex-a53" 160 - "arm,cortex-a57" 161 - "arm,cortex-a72" 162 - "arm,cortex-a73" 163 - "arm,cortex-m0" 164 - "arm,cortex-m0+" 165 - "arm,cortex-m1" 166 - "arm,cortex-m3" 167 - "arm,cortex-m4" 168 - "arm,cortex-r4" 169 - "arm,cortex-r5" 170 - "arm,cortex-r7" 171 - "brcm,brahma-b15" 172 - "brcm,brahma-b53" 173 - "brcm,vulcan" 174 - "cavium,thunder" 175 - "cavium,thunder2" 176 - "faraday,fa526" 177 - "intel,sa110" 178 - "intel,sa1100" 179 - "marvell,feroceon" 180 - "marvell,mohawk" 181 - "marvell,pj4a" 182 - "marvell,pj4b" 183 - "marvell,sheeva-v5" 184 - "nvidia,tegra132-denver" 185 - "nvidia,tegra186-denver" 186 - "nvidia,tegra194-carmel" 187 - "qcom,krait" 188 - "qcom,kryo" 189 - "qcom,kryo385" 190 - "qcom,scorpion" 191 - - enable-method 192 - Value type: <stringlist> 193 - Usage and definition depend on ARM architecture version. 194 - # On ARM v8 64-bit this property is required and must 195 - be one of: 196 - "psci" 197 - "spin-table" 198 - # On ARM 32-bit systems this property is optional and 199 - can be one of: 200 - "actions,s500-smp" 201 - "allwinner,sun6i-a31" 202 - "allwinner,sun8i-a23" 203 - "allwinner,sun9i-a80-smp" 204 - "amlogic,meson8-smp" 205 - "amlogic,meson8b-smp" 206 - "arm,realview-smp" 207 - "brcm,bcm11351-cpu-method" 208 - "brcm,bcm23550" 209 - "brcm,bcm2836-smp" 210 - "brcm,bcm-nsp-smp" 211 - "brcm,brahma-b15" 212 - "marvell,armada-375-smp" 213 - "marvell,armada-380-smp" 214 - "marvell,armada-390-smp" 215 - "marvell,armada-xp-smp" 216 - "marvell,98dx3236-smp" 217 - "mediatek,mt6589-smp" 218 - "mediatek,mt81xx-tz-smp" 219 - "qcom,gcc-msm8660" 220 - "qcom,kpss-acc-v1" 221 - "qcom,kpss-acc-v2" 222 - "renesas,apmu" 223 - "renesas,r9a06g032-smp" 224 - "rockchip,rk3036-smp" 225 - "rockchip,rk3066-smp" 226 - "ste,dbx500-smp" 227 - 228 - - cpu-release-addr 229 - Usage: required for systems that have an "enable-method" 230 - property value of "spin-table". 231 - Value type: <prop-encoded-array> 232 - Definition: 233 - # On ARM v8 64-bit systems must be a two cell 234 - property identifying a 64-bit zero-initialised 235 - memory location. 236 - 237 - - qcom,saw 238 - Usage: required for systems that have an "enable-method" 239 - property value of "qcom,kpss-acc-v1" or 240 - "qcom,kpss-acc-v2" 241 - Value type: <phandle> 242 - Definition: Specifies the SAW[1] node associated with this CPU. 243 - 244 - - qcom,acc 245 - Usage: required for systems that have an "enable-method" 246 - property value of "qcom,kpss-acc-v1" or 247 - "qcom,kpss-acc-v2" 248 - Value type: <phandle> 249 - Definition: Specifies the ACC[2] node associated with this CPU. 250 - 251 - - cpu-idle-states 252 - Usage: Optional 253 - Value type: <prop-encoded-array> 254 - Definition: 255 - # List of phandles to idle state nodes supported 256 - by this cpu [3]. 257 - 258 - - capacity-dmips-mhz 259 - Usage: Optional 260 - Value type: <u32> 261 - Definition: 262 - # u32 value representing CPU capacity [4] in 263 - DMIPS/MHz, relative to highest capacity-dmips-mhz 264 - in the system. 265 - 266 - - rockchip,pmu 267 - Usage: optional for systems that have an "enable-method" 268 - property value of "rockchip,rk3066-smp" 269 - While optional, it is the preferred way to get access to 270 - the cpu-core power-domains. 271 - Value type: <phandle> 272 - Definition: Specifies the syscon node controlling the cpu core 273 - power domains. 274 - 275 - - dynamic-power-coefficient 276 - Usage: optional 277 - Value type: <prop-encoded-array> 278 - Definition: A u32 value that represents the running time dynamic 279 - power coefficient in units of uW/MHz/V^2. The 280 - coefficient can either be calculated from power 281 - measurements or derived by analysis. 282 - 283 - The dynamic power consumption of the CPU is 284 - proportional to the square of the Voltage (V) and 285 - the clock frequency (f). The coefficient is used to 286 - calculate the dynamic power as below - 287 - 288 - Pdyn = dynamic-power-coefficient * V^2 * f 289 - 290 - where voltage is in V, frequency is in MHz. 291 - 292 - Example 1 (dual-cluster big.LITTLE system 32-bit): 293 - 294 - cpus { 295 - #size-cells = <0>; 296 - #address-cells = <1>; 297 - 298 - cpu@0 { 299 - device_type = "cpu"; 300 - compatible = "arm,cortex-a15"; 301 - reg = <0x0>; 302 - }; 303 - 304 - cpu@1 { 305 - device_type = "cpu"; 306 - compatible = "arm,cortex-a15"; 307 - reg = <0x1>; 308 - }; 309 - 310 - cpu@100 { 311 - device_type = "cpu"; 312 - compatible = "arm,cortex-a7"; 313 - reg = <0x100>; 314 - }; 315 - 316 - cpu@101 { 317 - device_type = "cpu"; 318 - compatible = "arm,cortex-a7"; 319 - reg = <0x101>; 320 - }; 321 - }; 322 - 323 - Example 2 (Cortex-A8 uniprocessor 32-bit system): 324 - 325 - cpus { 326 - #size-cells = <0>; 327 - #address-cells = <1>; 328 - 329 - cpu@0 { 330 - device_type = "cpu"; 331 - compatible = "arm,cortex-a8"; 332 - reg = <0x0>; 333 - }; 334 - }; 335 - 336 - Example 3 (ARM 926EJ-S uniprocessor 32-bit system): 337 - 338 - cpus { 339 - #size-cells = <0>; 340 - #address-cells = <1>; 341 - 342 - cpu@0 { 343 - device_type = "cpu"; 344 - compatible = "arm,arm926ej-s"; 345 - reg = <0x0>; 346 - }; 347 - }; 348 - 349 - Example 4 (ARM Cortex-A57 64-bit system): 350 - 351 - cpus { 352 - #size-cells = <0>; 353 - #address-cells = <2>; 354 - 355 - cpu@0 { 356 - device_type = "cpu"; 357 - compatible = "arm,cortex-a57"; 358 - reg = <0x0 0x0>; 359 - enable-method = "spin-table"; 360 - cpu-release-addr = <0 0x20000000>; 361 - }; 362 - 363 - cpu@1 { 364 - device_type = "cpu"; 365 - compatible = "arm,cortex-a57"; 366 - reg = <0x0 0x1>; 367 - enable-method = "spin-table"; 368 - cpu-release-addr = <0 0x20000000>; 369 - }; 370 - 371 - cpu@100 { 372 - device_type = "cpu"; 373 - compatible = "arm,cortex-a57"; 374 - reg = <0x0 0x100>; 375 - enable-method = "spin-table"; 376 - cpu-release-addr = <0 0x20000000>; 377 - }; 378 - 379 - cpu@101 { 380 - device_type = "cpu"; 381 - compatible = "arm,cortex-a57"; 382 - reg = <0x0 0x101>; 383 - enable-method = "spin-table"; 384 - cpu-release-addr = <0 0x20000000>; 385 - }; 386 - 387 - cpu@10000 { 388 - device_type = "cpu"; 389 - compatible = "arm,cortex-a57"; 390 - reg = <0x0 0x10000>; 391 - enable-method = "spin-table"; 392 - cpu-release-addr = <0 0x20000000>; 393 - }; 394 - 395 - cpu@10001 { 396 - device_type = "cpu"; 397 - compatible = "arm,cortex-a57"; 398 - reg = <0x0 0x10001>; 399 - enable-method = "spin-table"; 400 - cpu-release-addr = <0 0x20000000>; 401 - }; 402 - 403 - cpu@10100 { 404 - device_type = "cpu"; 405 - compatible = "arm,cortex-a57"; 406 - reg = <0x0 0x10100>; 407 - enable-method = "spin-table"; 408 - cpu-release-addr = <0 0x20000000>; 409 - }; 410 - 411 - cpu@10101 { 412 - device_type = "cpu"; 413 - compatible = "arm,cortex-a57"; 414 - reg = <0x0 0x10101>; 415 - enable-method = "spin-table"; 416 - cpu-release-addr = <0 0x20000000>; 417 - }; 418 - 419 - cpu@100000000 { 420 - device_type = "cpu"; 421 - compatible = "arm,cortex-a57"; 422 - reg = <0x1 0x0>; 423 - enable-method = "spin-table"; 424 - cpu-release-addr = <0 0x20000000>; 425 - }; 426 - 427 - cpu@100000001 { 428 - device_type = "cpu"; 429 - compatible = "arm,cortex-a57"; 430 - reg = <0x1 0x1>; 431 - enable-method = "spin-table"; 432 - cpu-release-addr = <0 0x20000000>; 433 - }; 434 - 435 - cpu@100000100 { 436 - device_type = "cpu"; 437 - compatible = "arm,cortex-a57"; 438 - reg = <0x1 0x100>; 439 - enable-method = "spin-table"; 440 - cpu-release-addr = <0 0x20000000>; 441 - }; 442 - 443 - cpu@100000101 { 444 - device_type = "cpu"; 445 - compatible = "arm,cortex-a57"; 446 - reg = <0x1 0x101>; 447 - enable-method = "spin-table"; 448 - cpu-release-addr = <0 0x20000000>; 449 - }; 450 - 451 - cpu@100010000 { 452 - device_type = "cpu"; 453 - compatible = "arm,cortex-a57"; 454 - reg = <0x1 0x10000>; 455 - enable-method = "spin-table"; 456 - cpu-release-addr = <0 0x20000000>; 457 - }; 458 - 459 - cpu@100010001 { 460 - device_type = "cpu"; 461 - compatible = "arm,cortex-a57"; 462 - reg = <0x1 0x10001>; 463 - enable-method = "spin-table"; 464 - cpu-release-addr = <0 0x20000000>; 465 - }; 466 - 467 - cpu@100010100 { 468 - device_type = "cpu"; 469 - compatible = "arm,cortex-a57"; 470 - reg = <0x1 0x10100>; 471 - enable-method = "spin-table"; 472 - cpu-release-addr = <0 0x20000000>; 473 - }; 474 - 475 - cpu@100010101 { 476 - device_type = "cpu"; 477 - compatible = "arm,cortex-a57"; 478 - reg = <0x1 0x10101>; 479 - enable-method = "spin-table"; 480 - cpu-release-addr = <0 0x20000000>; 481 - }; 482 - }; 483 - 484 - -- 485 - [1] arm/msm/qcom,saw2.txt 486 - [2] arm/msm/qcom,kpss-acc.txt 487 - [3] ARM Linux kernel documentation - idle states bindings 488 - Documentation/devicetree/bindings/arm/idle-states.txt 489 - [4] ARM Linux kernel documentation - cpu capacity bindings 490 - Documentation/devicetree/bindings/arm/cpu-capacity.txt
+507
Documentation/devicetree/bindings/arm/cpus.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/cpus.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ARM CPUs bindings 8 + 9 + maintainers: 10 + - Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 11 + 12 + description: |+ 13 + The device tree allows to describe the layout of CPUs in a system through 14 + the "cpus" node, which in turn contains a number of subnodes (ie "cpu") 15 + defining properties for every cpu. 16 + 17 + Bindings for CPU nodes follow the Devicetree Specification, available from: 18 + 19 + https://www.devicetree.org/specifications/ 20 + 21 + with updates for 32-bit and 64-bit ARM systems provided in this document. 22 + 23 + ================================ 24 + Convention used in this document 25 + ================================ 26 + 27 + This document follows the conventions described in the Devicetree 28 + Specification, with the addition: 29 + 30 + - square brackets define bitfields, eg reg[7:0] value of the bitfield in 31 + the reg property contained in bits 7 down to 0 32 + 33 + ===================================== 34 + cpus and cpu node bindings definition 35 + ===================================== 36 + 37 + The ARM architecture, in accordance with the Devicetree Specification, 38 + requires the cpus and cpu nodes to be present and contain the properties 39 + described below. 40 + 41 + properties: 42 + $nodename: 43 + const: cpus 44 + description: Container of cpu nodes 45 + 46 + '#address-cells': 47 + enum: [1, 2] 48 + description: | 49 + Definition depends on ARM architecture version and configuration: 50 + 51 + On uniprocessor ARM architectures previous to v7 52 + value must be 1, to enable a simple enumeration 53 + scheme for processors that do not have a HW CPU 54 + identification register. 55 + On 32-bit ARM 11 MPcore, ARM v7 or later systems 56 + value must be 1, that corresponds to CPUID/MPIDR 57 + registers sizes. 58 + On ARM v8 64-bit systems value should be set to 2, 59 + that corresponds to the MPIDR_EL1 register size. 60 + If MPIDR_EL1[63:32] value is equal to 0 on all CPUs 61 + in the system, #address-cells can be set to 1, since 62 + MPIDR_EL1[63:32] bits are not used for CPUs 63 + identification. 64 + 65 + '#size-cells': 66 + const: 0 67 + 68 + patternProperties: 69 + '^cpu@[0-9a-f]+$': 70 + properties: 71 + device_type: 72 + const: cpu 73 + 74 + reg: 75 + maxItems: 1 76 + description: | 77 + Usage and definition depend on ARM architecture version and 78 + configuration: 79 + 80 + On uniprocessor ARM architectures previous to v7 81 + this property is required and must be set to 0. 82 + 83 + On ARM 11 MPcore based systems this property is 84 + required and matches the CPUID[11:0] register bits. 85 + 86 + Bits [11:0] in the reg cell must be set to 87 + bits [11:0] in CPU ID register. 88 + 89 + All other bits in the reg cell must be set to 0. 90 + 91 + On 32-bit ARM v7 or later systems this property is 92 + required and matches the CPU MPIDR[23:0] register 93 + bits. 94 + 95 + Bits [23:0] in the reg cell must be set to 96 + bits [23:0] in MPIDR. 97 + 98 + All other bits in the reg cell must be set to 0. 99 + 100 + On ARM v8 64-bit systems this property is required 101 + and matches the MPIDR_EL1 register affinity bits. 102 + 103 + * If cpus node's #address-cells property is set to 2 104 + 105 + The first reg cell bits [7:0] must be set to 106 + bits [39:32] of MPIDR_EL1. 107 + 108 + The second reg cell bits [23:0] must be set to 109 + bits [23:0] of MPIDR_EL1. 110 + 111 + * If cpus node's #address-cells property is set to 1 112 + 113 + The reg cell bits [23:0] must be set to bits [23:0] 114 + of MPIDR_EL1. 115 + 116 + All other bits in the reg cells must be set to 0. 117 + 118 + compatible: 119 + items: 120 + - enum: 121 + - arm,arm710t 122 + - arm,arm720t 123 + - arm,arm740t 124 + - arm,arm7ej-s 125 + - arm,arm7tdmi 126 + - arm,arm7tdmi-s 127 + - arm,arm9es 128 + - arm,arm9ej-s 129 + - arm,arm920t 130 + - arm,arm922t 131 + - arm,arm925 132 + - arm,arm926e-s 133 + - arm,arm926ej-s 134 + - arm,arm940t 135 + - arm,arm946e-s 136 + - arm,arm966e-s 137 + - arm,arm968e-s 138 + - arm,arm9tdmi 139 + - arm,arm1020e 140 + - arm,arm1020t 141 + - arm,arm1022e 142 + - arm,arm1026ej-s 143 + - arm,arm1136j-s 144 + - arm,arm1136jf-s 145 + - arm,arm1156t2-s 146 + - arm,arm1156t2f-s 147 + - arm,arm1176jzf 148 + - arm,arm1176jz-s 149 + - arm,arm1176jzf-s 150 + - arm,arm11mpcore 151 + - arm,armv8 # Only for s/w models 152 + - arm,cortex-a5 153 + - arm,cortex-a7 154 + - arm,cortex-a8 155 + - arm,cortex-a9 156 + - arm,cortex-a12 157 + - arm,cortex-a15 158 + - arm,cortex-a17 159 + - arm,cortex-a53 160 + - arm,cortex-a57 161 + - arm,cortex-a72 162 + - arm,cortex-a73 163 + - arm,cortex-m0 164 + - arm,cortex-m0+ 165 + - arm,cortex-m1 166 + - arm,cortex-m3 167 + - arm,cortex-m4 168 + - arm,cortex-r4 169 + - arm,cortex-r5 170 + - arm,cortex-r7 171 + - brcm,brahma-b15 172 + - brcm,brahma-b53 173 + - brcm,vulcan 174 + - cavium,thunder 175 + - cavium,thunder2 176 + - faraday,fa526 177 + - intel,sa110 178 + - intel,sa1100 179 + - marvell,feroceon 180 + - marvell,mohawk 181 + - marvell,pj4a 182 + - marvell,pj4b 183 + - marvell,sheeva-v5 184 + - marvell,sheeva-v7 185 + - nvidia,tegra132-denver 186 + - nvidia,tegra186-denver 187 + - nvidia,tegra194-carmel 188 + - qcom,krait 189 + - qcom,kryo 190 + - qcom,kryo385 191 + - qcom,scorpion 192 + 193 + enable-method: 194 + allOf: 195 + - $ref: '/schemas/types.yaml#/definitions/string' 196 + - oneOf: 197 + # On ARM v8 64-bit this property is required 198 + - enum: 199 + - psci 200 + - spin-table 201 + # On ARM 32-bit systems this property is optional 202 + - enum: 203 + - actions,s500-smp 204 + - allwinner,sun6i-a31 205 + - allwinner,sun8i-a23 206 + - allwinner,sun9i-a80-smp 207 + - allwinner,sun8i-a83t-smp 208 + - amlogic,meson8-smp 209 + - amlogic,meson8b-smp 210 + - arm,realview-smp 211 + - brcm,bcm11351-cpu-method 212 + - brcm,bcm23550 213 + - brcm,bcm2836-smp 214 + - brcm,bcm63138 215 + - brcm,bcm-nsp-smp 216 + - brcm,brahma-b15 217 + - marvell,armada-375-smp 218 + - marvell,armada-380-smp 219 + - marvell,armada-390-smp 220 + - marvell,armada-xp-smp 221 + - marvell,98dx3236-smp 222 + - mediatek,mt6589-smp 223 + - mediatek,mt81xx-tz-smp 224 + - qcom,gcc-msm8660 225 + - qcom,kpss-acc-v1 226 + - qcom,kpss-acc-v2 227 + - renesas,apmu 228 + - renesas,r9a06g032-smp 229 + - rockchip,rk3036-smp 230 + - rockchip,rk3066-smp 231 + - ste,dbx500-smp 232 + 233 + cpu-release-addr: 234 + $ref: '/schemas/types.yaml#/definitions/uint64' 235 + 236 + description: 237 + Required for systems that have an "enable-method" 238 + property value of "spin-table". 239 + On ARM v8 64-bit systems must be a two cell 240 + property identifying a 64-bit zero-initialised 241 + memory location. 242 + 243 + cpu-idle-states: 244 + $ref: '/schemas/types.yaml#/definitions/phandle-array' 245 + description: | 246 + List of phandles to idle state nodes supported 247 + by this cpu (see ./idle-states.txt). 248 + 249 + capacity-dmips-mhz: 250 + $ref: '/schemas/types.yaml#/definitions/uint32' 251 + description: 252 + u32 value representing CPU capacity (see ./cpu-capacity.txt) in 253 + DMIPS/MHz, relative to highest capacity-dmips-mhz 254 + in the system. 255 + 256 + dynamic-power-coefficient: 257 + $ref: '/schemas/types.yaml#/definitions/uint32' 258 + description: 259 + A u32 value that represents the running time dynamic 260 + power coefficient in units of uW/MHz/V^2. The 261 + coefficient can either be calculated from power 262 + measurements or derived by analysis. 263 + 264 + The dynamic power consumption of the CPU is 265 + proportional to the square of the Voltage (V) and 266 + the clock frequency (f). The coefficient is used to 267 + calculate the dynamic power as below - 268 + 269 + Pdyn = dynamic-power-coefficient * V^2 * f 270 + 271 + where voltage is in V, frequency is in MHz. 272 + 273 + qcom,saw: 274 + $ref: '/schemas/types.yaml#/definitions/phandle' 275 + description: | 276 + Specifies the SAW* node associated with this CPU. 277 + 278 + Required for systems that have an "enable-method" property 279 + value of "qcom,kpss-acc-v1" or "qcom,kpss-acc-v2" 280 + 281 + * arm/msm/qcom,saw2.txt 282 + 283 + qcom,acc: 284 + $ref: '/schemas/types.yaml#/definitions/phandle' 285 + description: | 286 + Specifies the ACC* node associated with this CPU. 287 + 288 + Required for systems that have an "enable-method" property 289 + value of "qcom,kpss-acc-v1" or "qcom,kpss-acc-v2" 290 + 291 + * arm/msm/qcom,kpss-acc.txt 292 + 293 + rockchip,pmu: 294 + $ref: '/schemas/types.yaml#/definitions/phandle' 295 + description: | 296 + Specifies the syscon node controlling the cpu core power domains. 297 + 298 + Optional for systems that have an "enable-method" 299 + property value of "rockchip,rk3066-smp" 300 + While optional, it is the preferred way to get access to 301 + the cpu-core power-domains. 302 + 303 + required: 304 + - device_type 305 + - reg 306 + - compatible 307 + 308 + dependencies: 309 + cpu-release-addr: [enable-method] 310 + rockchip,pmu: [enable-method] 311 + 312 + required: 313 + - '#address-cells' 314 + - '#size-cells' 315 + 316 + examples: 317 + - | 318 + cpus { 319 + #size-cells = <0>; 320 + #address-cells = <1>; 321 + 322 + cpu@0 { 323 + device_type = "cpu"; 324 + compatible = "arm,cortex-a15"; 325 + reg = <0x0>; 326 + }; 327 + 328 + cpu@1 { 329 + device_type = "cpu"; 330 + compatible = "arm,cortex-a15"; 331 + reg = <0x1>; 332 + }; 333 + 334 + cpu@100 { 335 + device_type = "cpu"; 336 + compatible = "arm,cortex-a7"; 337 + reg = <0x100>; 338 + }; 339 + 340 + cpu@101 { 341 + device_type = "cpu"; 342 + compatible = "arm,cortex-a7"; 343 + reg = <0x101>; 344 + }; 345 + }; 346 + 347 + - | 348 + // Example 2 (Cortex-A8 uniprocessor 32-bit system): 349 + cpus { 350 + #size-cells = <0>; 351 + #address-cells = <1>; 352 + 353 + cpu@0 { 354 + device_type = "cpu"; 355 + compatible = "arm,cortex-a8"; 356 + reg = <0x0>; 357 + }; 358 + }; 359 + 360 + - | 361 + // Example 3 (ARM 926EJ-S uniprocessor 32-bit system): 362 + cpus { 363 + #size-cells = <0>; 364 + #address-cells = <1>; 365 + 366 + cpu@0 { 367 + device_type = "cpu"; 368 + compatible = "arm,arm926ej-s"; 369 + reg = <0x0>; 370 + }; 371 + }; 372 + 373 + - | 374 + // Example 4 (ARM Cortex-A57 64-bit system): 375 + cpus { 376 + #size-cells = <0>; 377 + #address-cells = <2>; 378 + 379 + cpu@0 { 380 + device_type = "cpu"; 381 + compatible = "arm,cortex-a57"; 382 + reg = <0x0 0x0>; 383 + enable-method = "spin-table"; 384 + cpu-release-addr = <0 0x20000000>; 385 + }; 386 + 387 + cpu@1 { 388 + device_type = "cpu"; 389 + compatible = "arm,cortex-a57"; 390 + reg = <0x0 0x1>; 391 + enable-method = "spin-table"; 392 + cpu-release-addr = <0 0x20000000>; 393 + }; 394 + 395 + cpu@100 { 396 + device_type = "cpu"; 397 + compatible = "arm,cortex-a57"; 398 + reg = <0x0 0x100>; 399 + enable-method = "spin-table"; 400 + cpu-release-addr = <0 0x20000000>; 401 + }; 402 + 403 + cpu@101 { 404 + device_type = "cpu"; 405 + compatible = "arm,cortex-a57"; 406 + reg = <0x0 0x101>; 407 + enable-method = "spin-table"; 408 + cpu-release-addr = <0 0x20000000>; 409 + }; 410 + 411 + cpu@10000 { 412 + device_type = "cpu"; 413 + compatible = "arm,cortex-a57"; 414 + reg = <0x0 0x10000>; 415 + enable-method = "spin-table"; 416 + cpu-release-addr = <0 0x20000000>; 417 + }; 418 + 419 + cpu@10001 { 420 + device_type = "cpu"; 421 + compatible = "arm,cortex-a57"; 422 + reg = <0x0 0x10001>; 423 + enable-method = "spin-table"; 424 + cpu-release-addr = <0 0x20000000>; 425 + }; 426 + 427 + cpu@10100 { 428 + device_type = "cpu"; 429 + compatible = "arm,cortex-a57"; 430 + reg = <0x0 0x10100>; 431 + enable-method = "spin-table"; 432 + cpu-release-addr = <0 0x20000000>; 433 + }; 434 + 435 + cpu@10101 { 436 + device_type = "cpu"; 437 + compatible = "arm,cortex-a57"; 438 + reg = <0x0 0x10101>; 439 + enable-method = "spin-table"; 440 + cpu-release-addr = <0 0x20000000>; 441 + }; 442 + 443 + cpu@100000000 { 444 + device_type = "cpu"; 445 + compatible = "arm,cortex-a57"; 446 + reg = <0x1 0x0>; 447 + enable-method = "spin-table"; 448 + cpu-release-addr = <0 0x20000000>; 449 + }; 450 + 451 + cpu@100000001 { 452 + device_type = "cpu"; 453 + compatible = "arm,cortex-a57"; 454 + reg = <0x1 0x1>; 455 + enable-method = "spin-table"; 456 + cpu-release-addr = <0 0x20000000>; 457 + }; 458 + 459 + cpu@100000100 { 460 + device_type = "cpu"; 461 + compatible = "arm,cortex-a57"; 462 + reg = <0x1 0x100>; 463 + enable-method = "spin-table"; 464 + cpu-release-addr = <0 0x20000000>; 465 + }; 466 + 467 + cpu@100000101 { 468 + device_type = "cpu"; 469 + compatible = "arm,cortex-a57"; 470 + reg = <0x1 0x101>; 471 + enable-method = "spin-table"; 472 + cpu-release-addr = <0 0x20000000>; 473 + }; 474 + 475 + cpu@100010000 { 476 + device_type = "cpu"; 477 + compatible = "arm,cortex-a57"; 478 + reg = <0x1 0x10000>; 479 + enable-method = "spin-table"; 480 + cpu-release-addr = <0 0x20000000>; 481 + }; 482 + 483 + cpu@100010001 { 484 + device_type = "cpu"; 485 + compatible = "arm,cortex-a57"; 486 + reg = <0x1 0x10001>; 487 + enable-method = "spin-table"; 488 + cpu-release-addr = <0 0x20000000>; 489 + }; 490 + 491 + cpu@100010100 { 492 + device_type = "cpu"; 493 + compatible = "arm,cortex-a57"; 494 + reg = <0x1 0x10100>; 495 + enable-method = "spin-table"; 496 + cpu-release-addr = <0 0x20000000>; 497 + }; 498 + 499 + cpu@100010101 { 500 + device_type = "cpu"; 501 + compatible = "arm,cortex-a57"; 502 + reg = <0x1 0x10101>; 503 + enable-method = "spin-table"; 504 + cpu-release-addr = <0 0x20000000>; 505 + }; 506 + }; 507 + ...
-25
Documentation/devicetree/bindings/arm/davinci.txt
··· 1 - Texas Instruments DaVinci Platforms Device Tree Bindings 2 - -------------------------------------------------------- 3 - 4 - DA850/OMAP-L138/AM18x Evaluation Module (EVM) board 5 - Required root node properties: 6 - - compatible = "ti,da850-evm", "ti,da850"; 7 - 8 - DA850/OMAP-L138/AM18x L138/C6748 Development Kit (LCDK) board 9 - Required root node properties: 10 - - compatible = "ti,da850-lcdk", "ti,da850"; 11 - 12 - EnBW AM1808 based CMC board 13 - Required root node properties: 14 - - compatible = "enbw,cmc", "ti,da850; 15 - 16 - LEGO MINDSTORMS EV3 (AM1808 based) 17 - Required root node properties: 18 - - compatible = "lego,ev3", "ti,da850"; 19 - 20 - Generic DaVinci Boards 21 - ---------------------- 22 - 23 - DA850/OMAP-L138/AM18x generic board 24 - Required root node properties: 25 - - compatible = "ti,da850";
+1 -1
Documentation/devicetree/bindings/arm/mrvl/mrvl.txt
··· 11 11 12 12 MMP2 Brownstone Board 13 13 Required root node properties: 14 - - compatible = "mrvl,mmp2-brownstone"; 14 + - compatible = "mrvl,mmp2-brownstone", "mrvl,mmp2";
-14
Documentation/devicetree/bindings/arm/nspire.txt
··· 1 - TI-NSPIRE calculators 2 - 3 - Required properties: 4 - - compatible: Compatible property value should contain "ti,nspire". 5 - CX models should have "ti,nspire-cx" 6 - Touchpad models should have "ti,nspire-tp" 7 - Clickpad models should have "ti,nspire-clp" 8 - 9 - Example: 10 - 11 - / { 12 - model = "TI-NSPIRE CX"; 13 - compatible = "ti,nspire-cx"; 14 - ...
-46
Documentation/devicetree/bindings/arm/primecell.txt
··· 1 - * ARM Primecell Peripherals 2 - 3 - ARM, Ltd. Primecell peripherals have a standard id register that can be used to 4 - identify the peripheral type, vendor, and revision. This value can be used for 5 - driver matching. 6 - 7 - Required properties: 8 - 9 - - compatible : should be a specific name for the peripheral and 10 - "arm,primecell". The specific name will match the ARM 11 - engineering name for the logic block in the form: "arm,pl???" 12 - 13 - Optional properties: 14 - 15 - - arm,primecell-periphid : Value to override the h/w value with 16 - - clocks : From common clock binding. First clock is phandle to clock for apb 17 - pclk. Additional clocks are optional and specific to those peripherals. 18 - - clock-names : From common clock binding. Shall be "apb_pclk" for first clock. 19 - - dmas : From common DMA binding. If present, refers to one or more dma channels. 20 - - dma-names : From common DMA binding, needs to match the 'dmas' property. 21 - Devices with exactly one receive and transmit channel shall name 22 - these "rx" and "tx", respectively. 23 - - pinctrl-<n> : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt 24 - - pinctrl-names : Names corresponding to the numbered pinctrl states 25 - - interrupts : one or more interrupt specifiers 26 - - interrupt-names : names corresponding to the interrupts properties 27 - 28 - Example: 29 - 30 - serial@fff36000 { 31 - compatible = "arm,pl011", "arm,primecell"; 32 - arm,primecell-periphid = <0x00341011>; 33 - 34 - clocks = <&pclk>; 35 - clock-names = "apb_pclk"; 36 - 37 - dmas = <&dma-controller 4>, <&dma-controller 5>; 38 - dma-names = "rx", "tx"; 39 - 40 - pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>; 41 - pinctrl-1 = <&uart0_sleep_mode>; 42 - pinctrl-names = "default","sleep"; 43 - 44 - interrupts = <0 11 0x4>; 45 - }; 46 -
+36
Documentation/devicetree/bindings/arm/primecell.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/primecell.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ARM Primecell Peripherals 8 + 9 + maintainers: 10 + - Rob Herring <robh@kernel.org> 11 + 12 + description: |+ 13 + ARM, Ltd. Primecell peripherals have a standard id register that can be used to 14 + identify the peripheral type, vendor, and revision. This value can be used for 15 + driver matching. 16 + 17 + properties: 18 + compatible: 19 + contains: 20 + const: arm,primecell 21 + description: 22 + Should be a specific name for the peripheral followed by "arm,primecell". 23 + The specific name will match the ARM engineering name for the logic block 24 + in the form "arm,pl???" 25 + 26 + arm,primecell-periphid: 27 + $ref: /schemas/types.yaml#/definitions/uint32 28 + description: Value to override the h/w ID value 29 + clocks: 30 + minItems: 1 31 + maxItems: 32 32 + clock-names: 33 + contains: 34 + const: apb_pclk 35 + additionalItems: true 36 + ...
-57
Documentation/devicetree/bindings/arm/qcom.txt
··· 1 - QCOM device tree bindings 2 - ------------------------- 3 - 4 - Some qcom based bootloaders identify the dtb blob based on a set of 5 - device properties like SoC and platform and revisions of those components. 6 - To support this scheme, we encode this information into the board compatible 7 - string. 8 - 9 - Each board must specify a top-level board compatible string with the following 10 - format: 11 - 12 - compatible = "qcom,<SoC>[-<soc_version>][-<foundry_id>]-<board>[/<subtype>][-<board_version>]" 13 - 14 - The 'SoC' and 'board' elements are required. All other elements are optional. 15 - 16 - The 'SoC' element must be one of the following strings: 17 - 18 - apq8016 19 - apq8074 20 - apq8084 21 - apq8096 22 - msm8916 23 - msm8974 24 - msm8992 25 - msm8994 26 - msm8996 27 - mdm9615 28 - ipq8074 29 - sdm845 30 - 31 - The 'board' element must be one of the following strings: 32 - 33 - cdp 34 - liquid 35 - dragonboard 36 - mtp 37 - sbc 38 - hk01 39 - 40 - The 'soc_version' and 'board_version' elements take the form of v<Major>.<Minor> 41 - where the minor number may be omitted when it's zero, i.e. v1.0 is the same 42 - as v1. If all versions of the 'board_version' elements match, then a 43 - wildcard '*' should be used, e.g. 'v*'. 44 - 45 - The 'foundry_id' and 'subtype' elements are one or more digits from 0 to 9. 46 - 47 - Examples: 48 - 49 - "qcom,msm8916-v1-cdp-pm8916-v2.1" 50 - 51 - A CDP board with an msm8916 SoC, version 1 paired with a pm8916 PMIC of version 52 - 2.1. 53 - 54 - "qcom,apq8074-v2.0-2-dragonboard/1-v0.1" 55 - 56 - A dragonboard board v0.1 of subtype 1 with an apq8074 SoC version 2, made in 57 - foundry 2.
+125
Documentation/devicetree/bindings/arm/qcom.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/bindings/arm/qcom.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: QCOM device tree bindings 8 + 9 + maintainers: 10 + - Stephen Boyd <sboyd@codeaurora.org> 11 + 12 + description: | 13 + Some qcom based bootloaders identify the dtb blob based on a set of 14 + device properties like SoC and platform and revisions of those components. 15 + To support this scheme, we encode this information into the board compatible 16 + string. 17 + 18 + Each board must specify a top-level board compatible string with the following 19 + format: 20 + 21 + compatible = "qcom,<SoC>[-<soc_version>][-<foundry_id>]-<board>[/<subtype>][-<board_version>]" 22 + 23 + The 'SoC' and 'board' elements are required. All other elements are optional. 24 + 25 + The 'SoC' element must be one of the following strings: 26 + 27 + apq8016 28 + apq8074 29 + apq8084 30 + apq8096 31 + msm8916 32 + msm8974 33 + msm8992 34 + msm8994 35 + msm8996 36 + mdm9615 37 + ipq8074 38 + sdm845 39 + 40 + The 'board' element must be one of the following strings: 41 + 42 + cdp 43 + liquid 44 + dragonboard 45 + mtp 46 + sbc 47 + hk01 48 + 49 + The 'soc_version' and 'board_version' elements take the form of v<Major>.<Minor> 50 + where the minor number may be omitted when it's zero, i.e. v1.0 is the same 51 + as v1. If all versions of the 'board_version' elements match, then a 52 + wildcard '*' should be used, e.g. 'v*'. 53 + 54 + The 'foundry_id' and 'subtype' elements are one or more digits from 0 to 9. 55 + 56 + Examples: 57 + 58 + "qcom,msm8916-v1-cdp-pm8916-v2.1" 59 + 60 + A CDP board with an msm8916 SoC, version 1 paired with a pm8916 PMIC of version 61 + 2.1. 62 + 63 + "qcom,apq8074-v2.0-2-dragonboard/1-v0.1" 64 + 65 + A dragonboard board v0.1 of subtype 1 with an apq8074 SoC version 2, made in 66 + foundry 2. 67 + 68 + properties: 69 + compatible: 70 + oneOf: 71 + - items: 72 + - enum: 73 + - qcom,apq8016-sbc 74 + - const: qcom,apq8016 75 + 76 + - items: 77 + - enum: 78 + - qcom,apq8064-cm-qs600 79 + - qcom,apq8064-ifc6410 80 + - const: qcom,apq8064 81 + 82 + - items: 83 + - enum: 84 + - qcom,apq8074-dragonboard 85 + - const: qcom,apq8074 86 + 87 + - items: 88 + - enum: 89 + - qcom,apq8060-dragonboard 90 + - qcom,msm8660-surf 91 + - const: qcom,msm8660 92 + 93 + - items: 94 + - enum: 95 + - qcom,apq8084-mtp 96 + - qcom,apq8084-sbc 97 + - const: qcom,apq8084 98 + 99 + - items: 100 + - enum: 101 + - qcom,msm8960-cdp 102 + - const: qcom,msm8960 103 + 104 + - items: 105 + - const: qcom,msm8916-mtp/1 106 + - const: qcom,msm8916-mtp 107 + - const: qcom,msm8916 108 + 109 + - items: 110 + - const: qcom,msm8996-mtp 111 + 112 + - items: 113 + - const: qcom,ipq4019 114 + 115 + - items: 116 + - enum: 117 + - qcom,ipq8064-ap148 118 + - const: qcom,ipq8064 119 + 120 + - items: 121 + - enum: 122 + - qcom,ipq8074-hk01 123 + - const: qcom,ipq8074 124 + 125 + ...
-11
Documentation/devicetree/bindings/arm/sirf.txt
··· 1 - CSR SiRFprimaII and SiRFmarco device tree bindings. 2 - ======================================== 3 - 4 - Required root node properties: 5 - - compatible: 6 - - "sirf,atlas6-cb" : atlas6 "cb" evaluation board 7 - - "sirf,atlas6" : atlas6 device based board 8 - - "sirf,atlas7-cb" : atlas7 "cb" evaluation board 9 - - "sirf,atlas7" : atlas7 device based board 10 - - "sirf,prima2-cb" : prima2 "cb" evaluation board 11 - - "sirf,prima2" : prima2 device based board
+27
Documentation/devicetree/bindings/arm/sirf.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/sirf.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: CSR SiRFprimaII and SiRFmarco device tree bindings. 8 + 9 + maintainers: 10 + - Binghua Duan <binghua.duan@csr.com> 11 + - Barry Song <Baohua.Song@csr.com> 12 + 13 + properties: 14 + $nodename: 15 + const: '/' 16 + compatible: 17 + oneOf: 18 + - items: 19 + - const: sirf,atlas6-cb 20 + - const: sirf,atlas6 21 + - items: 22 + - const: sirf,atlas7-cb 23 + - const: sirf,atlas7 24 + - items: 25 + - const: sirf,prima2-cb 26 + - const: sirf,prima2 27 + ...
-26
Documentation/devicetree/bindings/arm/spear.txt
··· 1 - ST SPEAr Platforms Device Tree Bindings 2 - --------------------------------------- 3 - 4 - Boards with the ST SPEAr600 SoC shall have the following properties: 5 - Required root node property: 6 - compatible = "st,spear600"; 7 - 8 - Boards with the ST SPEAr300 SoC shall have the following properties: 9 - Required root node property: 10 - compatible = "st,spear300"; 11 - 12 - Boards with the ST SPEAr310 SoC shall have the following properties: 13 - Required root node property: 14 - compatible = "st,spear310"; 15 - 16 - Boards with the ST SPEAr320 SoC shall have the following properties: 17 - Required root node property: 18 - compatible = "st,spear320"; 19 - 20 - Boards with the ST SPEAr1310 SoC shall have the following properties: 21 - Required root node property: 22 - compatible = "st,spear1310"; 23 - 24 - Boards with the ST SPEAr1340 SoC shall have the following properties: 25 - Required root node property: 26 - compatible = "st,spear1340";
+25
Documentation/devicetree/bindings/arm/spear.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/spear.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ST SPEAr Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Viresh Kumar <vireshk@kernel.org> 11 + - Stefan Roese <sr@denx.de> 12 + 13 + properties: 14 + $nodename: 15 + const: '/' 16 + compatible: 17 + items: 18 + - enum: 19 + - st,spear600 20 + - st,spear300 21 + - st,spear310 22 + - st,spear320 23 + - st,spear1310 24 + - st,spear1340 25 + ...
-23
Documentation/devicetree/bindings/arm/sti.txt
··· 1 - ST STi Platforms Device Tree Bindings 2 - --------------------------------------- 3 - 4 - Boards with the ST STiH415 SoC shall have the following properties: 5 - Required root node property: 6 - compatible = "st,stih415"; 7 - 8 - Boards with the ST STiH416 SoC shall have the following properties: 9 - Required root node property: 10 - compatible = "st,stih416"; 11 - 12 - Boards with the ST STiH407 SoC shall have the following properties: 13 - Required root node property: 14 - compatible = "st,stih407"; 15 - 16 - Boards with the ST STiH410 SoC shall have the following properties: 17 - Required root node property: 18 - compatible = "st,stih410"; 19 - 20 - Boards with the ST STiH418 SoC shall have the following properties: 21 - Required root node property: 22 - compatible = "st,stih418"; 23 -
+23
Documentation/devicetree/bindings/arm/sti.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/sti.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ST STi Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Patrice Chotard <patrice.chotard@st.com> 11 + 12 + properties: 13 + $nodename: 14 + const: '/' 15 + compatible: 16 + items: 17 + - enum: 18 + - st,stih415 19 + - st,stih416 20 + - st,stih407 21 + - st,stih410 22 + - st,stih418 23 + ...
-65
Documentation/devicetree/bindings/arm/tegra.txt
··· 1 - NVIDIA Tegra device tree bindings 2 - ------------------------------------------- 3 - 4 - SoCs 5 - ------------------------------------------- 6 - 7 - Each device tree must specify which Tegra SoC it uses, using one of the 8 - following compatible values: 9 - 10 - nvidia,tegra20 11 - nvidia,tegra30 12 - nvidia,tegra114 13 - nvidia,tegra124 14 - nvidia,tegra132 15 - nvidia,tegra210 16 - nvidia,tegra186 17 - nvidia,tegra194 18 - 19 - Boards 20 - ------------------------------------------- 21 - 22 - Each device tree must specify which one or more of the following 23 - board-specific compatible values: 24 - 25 - ad,medcom-wide 26 - ad,plutux 27 - ad,tamonten 28 - ad,tec 29 - compal,paz00 30 - compulab,trimslice 31 - nvidia,beaver 32 - nvidia,cardhu 33 - nvidia,cardhu-a02 34 - nvidia,cardhu-a04 35 - nvidia,dalmore 36 - nvidia,harmony 37 - nvidia,jetson-tk1 38 - nvidia,norrin 39 - nvidia,p2371-0000 40 - nvidia,p2371-2180 41 - nvidia,p2571 42 - nvidia,p2771-0000 43 - nvidia,p2972-0000 44 - nvidia,roth 45 - nvidia,seaboard 46 - nvidia,tn7 47 - nvidia,ventana 48 - toradex,apalis_t30 49 - toradex,apalis_t30-eval 50 - toradex,apalis_t30-v1.1 51 - toradex,apalis_t30-v1.1-eval 52 - toradex,apalis-tk1 53 - toradex,apalis-tk1-eval 54 - toradex,apalis-tk1-v1.2 55 - toradex,apalis-tk1-v1.2-eval 56 - toradex,colibri_t20 57 - toradex,colibri_t20-eval-v3 58 - toradex,colibri_t20-iris 59 - toradex,colibri_t30 60 - toradex,colibri_t30-eval-v3 61 - 62 - Trusted Foundations 63 - ------------------------------------------- 64 - Tegra supports the Trusted Foundation secure monitor. See the 65 - "tlm,trusted-foundations" binding's documentation for more details.
+101
Documentation/devicetree/bindings/arm/tegra.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/tegra.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVIDIA Tegra device tree bindings 8 + 9 + maintainers: 10 + - Thierry Reding <thierry.reding@gmail.com> 11 + - Jonathan Hunter <jonathanh@nvidia.com> 12 + 13 + properties: 14 + compatible: 15 + oneOf: 16 + - items: 17 + - enum: 18 + - compal,paz00 19 + - compulab,trimslice 20 + - nvidia,harmony 21 + - nvidia,seaboard 22 + - nvidia,ventana 23 + - const: nvidia,tegra20 24 + - items: 25 + - enum: 26 + - ad,medcom-wide 27 + - ad,plutux 28 + - ad,tec 29 + - const: ad,tamonten 30 + - const: nvidia,tegra20 31 + - items: 32 + - enum: 33 + - toradex,colibri_t20-eval-v3 34 + - toradex,colibri_t20-iris 35 + - const: toradex,colibri_t20 36 + - const: nvidia,tegra20 37 + - items: 38 + - enum: 39 + - nvidia,beaver 40 + - const: nvidia,tegra30 41 + - items: 42 + - enum: 43 + - nvidia,cardhu-a02 44 + - nvidia,cardhu-a04 45 + - const: nvidia,cardhu 46 + - const: nvidia,tegra30 47 + - items: 48 + - const: toradex,apalis_t30-eval 49 + - const: toradex,apalis_t30 50 + - const: nvidia,tegra30 51 + - items: 52 + - const: toradex,apalis_t30-eval-v1.1 53 + - const: toradex,apalis_t30-eval 54 + - const: toradex,apalis_t30-v1.1 55 + - const: toradex,apalis_t30 56 + - const: nvidia,tegra30 57 + - items: 58 + - enum: 59 + - toradex,colibri_t30-eval-v3 60 + - const: toradex,colibri_t30 61 + - const: nvidia,tegra30 62 + - items: 63 + - enum: 64 + - nvidia,dalmore 65 + - nvidia,roth 66 + - nvidia,tn7 67 + - const: nvidia,tegra114 68 + - items: 69 + - enum: 70 + - nvidia,jetson-tk1 71 + - nvidia,venice2 72 + - const: nvidia,tegra124 73 + - items: 74 + - const: toradex,apalis-tk1-eval 75 + - const: toradex,apalis-tk1 76 + - const: nvidia,tegra124 77 + - items: 78 + - const: toradex,apalis-tk1-v1.2-eval 79 + - const: toradex,apalis-tk1-eval 80 + - const: toradex,apalis-tk1-v1.2 81 + - const: toradex,apalis-tk1 82 + - const: nvidia,tegra124 83 + - items: 84 + - enum: 85 + - nvidia,norrin 86 + - const: nvidia,tegra132 87 + - const: nvidia,tegra124 88 + - items: 89 + - enum: 90 + - nvidia,p2371-0000 91 + - nvidia,p2371-2180 92 + - nvidia,p2571 93 + - const: nvidia,tegra210 94 + - items: 95 + - enum: 96 + - nvidia,p2771-0000 97 + - const: nvidia,tegra186 98 + - items: 99 + - enum: 100 + - nvidia,p2972-0000 101 + - const: nvidia,tegra194
+24
Documentation/devicetree/bindings/arm/ti/nspire.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/ti/nspire.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI-NSPIRE calculators 8 + 9 + maintainers: 10 + - Daniel Tang <dt.tangr@gmail.com> 11 + 12 + properties: 13 + $nodename: 14 + const: '/' 15 + compatible: 16 + items: 17 + - enum: 18 + # CX models 19 + - ti,nspire-cx 20 + # Touchpad models 21 + - ti,nspire-tp 22 + # Clickpad models 23 + - ti,nspire-clp 24 + ...
+26
Documentation/devicetree/bindings/arm/ti/ti,davinci.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/ti/davinci.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments DaVinci Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Sekhar Nori <nsekhar@ti.com> 11 + 12 + description: 13 + DA850/OMAP-L138/AM18x based boards 14 + 15 + properties: 16 + $nodename: 17 + const: '/' 18 + compatible: 19 + items: 20 + - enum: 21 + - ti,da850-evm # DA850/OMAP-L138/AM18x Evaluation Module (EVM) board 22 + - ti,da850-lcdk # DA850/OMAP-L138/AM18x L138/C6748 Development Kit (LCDK) board 23 + - enbw,cmc # EnBW AM1808 based CMC board 24 + - lego,ev3 # LEGO MINDSTORMS EV3 (AM1808 based) 25 + - const: ti,da850 26 + ...
-22
Documentation/devicetree/bindings/arm/vt8500.txt
··· 1 - VIA/Wondermedia VT8500 Platforms Device Tree Bindings 2 - --------------------------------------- 3 - 4 - Boards with the VIA VT8500 SoC shall have the following properties: 5 - Required root node property: 6 - compatible = "via,vt8500"; 7 - 8 - Boards with the Wondermedia WM8505 SoC shall have the following properties: 9 - Required root node property: 10 - compatible = "wm,wm8505"; 11 - 12 - Boards with the Wondermedia WM8650 SoC shall have the following properties: 13 - Required root node property: 14 - compatible = "wm,wm8650"; 15 - 16 - Boards with the Wondermedia WM8750 SoC shall have the following properties: 17 - Required root node property: 18 - compatible = "wm,wm8750"; 19 - 20 - Boards with the Wondermedia WM8850 SoC shall have the following properties: 21 - Required root node property: 22 - compatible = "wm,wm8850";
+23
Documentation/devicetree/bindings/arm/vt8500.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/vt8500.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: VIA/Wondermedia VT8500 Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Tony Prisk <linux@prisktech.co.nz> 11 + description: test 12 + 13 + properties: 14 + $nodename: 15 + const: '/' 16 + compatible: 17 + items: 18 + - enum: 19 + - via,vt8500 20 + - wm,wm8505 21 + - wm,wm8650 22 + - wm,wm8750 23 + - wm,wm8850
-83
Documentation/devicetree/bindings/arm/xilinx.txt
··· 1 - Xilinx Zynq Platforms Device Tree Bindings 2 - 3 - Boards with Zynq-7000 SOC based on an ARM Cortex A9 processor 4 - shall have the following properties. 5 - 6 - Required root node properties: 7 - - compatible = "xlnx,zynq-7000"; 8 - 9 - Additional compatible strings: 10 - 11 - - Adapteva Parallella board 12 - "adapteva,parallella" 13 - 14 - - Avnet MicroZed board 15 - "avnet,zynq-microzed" 16 - "xlnx,zynq-microzed" 17 - 18 - - Avnet ZedBoard board 19 - "avnet,zynq-zed" 20 - "xlnx,zynq-zed" 21 - 22 - - Digilent Zybo board 23 - "digilent,zynq-zybo" 24 - 25 - - Digilent Zybo Z7 board 26 - "digilent,zynq-zybo-z7" 27 - 28 - - Xilinx CC108 internal board 29 - "xlnx,zynq-cc108" 30 - 31 - - Xilinx ZC702 internal board 32 - "xlnx,zynq-zc702" 33 - 34 - - Xilinx ZC706 internal board 35 - "xlnx,zynq-zc706" 36 - 37 - - Xilinx ZC770 internal board, with different FMC cards 38 - "xlnx,zynq-zc770-xm010" 39 - "xlnx,zynq-zc770-xm011" 40 - "xlnx,zynq-zc770-xm012" 41 - "xlnx,zynq-zc770-xm013" 42 - 43 - --------------------------------------------------------------- 44 - 45 - Xilinx Zynq UltraScale+ MPSoC Platforms Device Tree Bindings 46 - 47 - Boards with ZynqMP SOC based on an ARM Cortex A53 processor 48 - shall have the following properties. 49 - 50 - Required root node properties: 51 - - compatible = "xlnx,zynqmp"; 52 - 53 - 54 - Additional compatible strings: 55 - 56 - - Xilinx internal board zc1232 57 - "xlnx,zynqmp-zc1232-revA", "xlnx,zynqmp-zc1232" 58 - 59 - - Xilinx internal board zc1254 60 - "xlnx,zynqmp-zc1254-revA", "xlnx,zynqmp-zc1254" 61 - 62 - - Xilinx internal board zc1275 63 - "xlnx,zynqmp-zc1275-revA", "xlnx,zynqmp-zc1275" 64 - 65 - - Xilinx internal board zc1751 66 - "xlnx,zynqmp-zc1751" 67 - 68 - - Xilinx 96boards compatible board zcu100 69 - "xlnx,zynqmp-zcu100-revC", "xlnx,zynqmp-zcu100" 70 - 71 - - Xilinx evaluation board zcu102 72 - "xlnx,zynqmp-zcu102-revA", "xlnx,zynqmp-zcu102" 73 - "xlnx,zynqmp-zcu102-revB", "xlnx,zynqmp-zcu102" 74 - "xlnx,zynqmp-zcu102-rev1.0", "xlnx,zynqmp-zcu102" 75 - 76 - - Xilinx evaluation board zcu104 77 - "xlnx,zynqmp-zcu104-revA", "xlnx,zynqmp-zcu104" 78 - 79 - - Xilinx evaluation board zcu106 80 - "xlnx,zynqmp-zcu106-revA", "xlnx,zynqmp-zcu106" 81 - 82 - - Xilinx evaluation board zcu111 83 - "xlnx,zynqmp-zcu111-revA", "xlnx,zynqmp-zcu111"
+114
Documentation/devicetree/bindings/arm/xilinx.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/xilinx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Xilinx Zynq Platforms Device Tree Bindings 8 + 9 + maintainers: 10 + - Michal Simek <michal.simek@xilinx.com> 11 + 12 + description: | 13 + Xilinx boards with Zynq-7000 SOC or Zynq UltraScale+ MPSoC 14 + 15 + properties: 16 + $nodename: 17 + const: '/' 18 + compatible: 19 + oneOf: 20 + - items: 21 + - enum: 22 + - adapteva,parallella 23 + - digilent,zynq-zybo 24 + - digilent,zynq-zybo-z7 25 + - xlnx,zynq-cc108 26 + - xlnx,zynq-zc702 27 + - xlnx,zynq-zc706 28 + - xlnx,zynq-zc770-xm010 29 + - xlnx,zynq-zc770-xm011 30 + - xlnx,zynq-zc770-xm012 31 + - xlnx,zynq-zc770-xm013 32 + - const: xlnx,zynq-7000 33 + 34 + - items: 35 + - const: avnet,zynq-microzed 36 + - const: xlnx,zynq-microzed 37 + - const: xlnx,zynq-7000 38 + 39 + - items: 40 + - const: avnet,zynq-zed 41 + - const: xlnx,zynq-zed 42 + - const: xlnx,zynq-7000 43 + 44 + - items: 45 + - enum: 46 + - xlnx,zynqmp-zc1751 47 + - const: xlnx,zynqmp 48 + 49 + - description: Xilinx internal board zc1232 50 + items: 51 + - const: xlnx,zynqmp-zc1232-revA 52 + - const: xlnx,zynqmp-zc1232 53 + - const: xlnx,zynqmp 54 + 55 + - description: Xilinx internal board zc1254 56 + items: 57 + - const: xlnx,zynqmp-zc1254-revA 58 + - const: xlnx,zynqmp-zc1254 59 + - const: xlnx,zynqmp 60 + 61 + - description: Xilinx internal board zc1275 62 + items: 63 + - const: xlnx,zynqmp-zc1275-revA 64 + - const: xlnx,zynqmp-zc1275 65 + - const: xlnx,zynqmp 66 + 67 + - description: Xilinx 96boards compatible board zcu100 68 + items: 69 + - const: xlnx,zynqmp-zcu100-revC 70 + - const: xlnx,zynqmp-zcu100 71 + - const: xlnx,zynqmp 72 + 73 + - description: Xilinx 96boards compatible board Ultra96 74 + items: 75 + - const: avnet,ultra96-rev1 76 + - const: avnet,ultra96 77 + - const: xlnx,zynqmp-zcu100-revC 78 + - const: xlnx,zynqmp-zcu100 79 + - const: xlnx,zynqmp 80 + 81 + - description: Xilinx evaluation board zcu102 82 + items: 83 + - enum: 84 + - xlnx,zynqmp-zcu102-revA 85 + - xlnx,zynqmp-zcu102-revB 86 + - xlnx,zynqmp-zcu102-rev1.0 87 + - const: xlnx,zynqmp-zcu102 88 + - const: xlnx,zynqmp 89 + 90 + - description: Xilinx evaluation board zcu104 91 + items: 92 + - enum: 93 + - xlnx,zynqmp-zcu104-revA 94 + - xlnx,zynqmp-zcu104-rev1.0 95 + - const: xlnx,zynqmp-zcu104 96 + - const: xlnx,zynqmp 97 + 98 + - description: Xilinx evaluation board zcu106 99 + items: 100 + - enum: 101 + - xlnx,zynqmp-zcu106-revA 102 + - xlnx,zynqmp-zcu106-rev1.0 103 + - const: xlnx,zynqmp-zcu106 104 + - const: xlnx,zynqmp 105 + 106 + - description: Xilinx evaluation board zcu111 107 + items: 108 + - enum: 109 + - xlnx,zynqmp-zcu111-revA 110 + - xlnx,zynqmp-zcu11-rev1.0 111 + - const: xlnx,zynqmp-zcu111 112 + - const: xlnx,zynqmp 113 + 114 + ...
-14
Documentation/devicetree/bindings/arm/zte.txt
··· 1 - ZTE platforms device tree bindings 2 - 3 - --------------------------------------- 4 - - ZX296702 board: 5 - Required root node properties: 6 - - compatible = "zte,zx296702-ad1", "zte,zx296702" 7 - 8 - --------------------------------------- 9 - - ZX296718 SoC: 10 - Required root node properties: 11 - - compatible = "zte,zx296718" 12 - 13 - ZX296718 EVB board: 14 - - "zte,zx296718-evb"
+26
Documentation/devicetree/bindings/arm/zte.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/zte.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ZTE platforms device tree bindings 8 + 9 + maintainers: 10 + - Jun Nie <jun.nie@linaro.org> 11 + 12 + properties: 13 + $nodename: 14 + const: '/' 15 + compatible: 16 + oneOf: 17 + - items: 18 + - enum: 19 + - zte,zx296702-ad1 20 + - const: zte,zx296702 21 + - items: 22 + - enum: 23 + - zte,zx296718-evb 24 + - const: zte,zx296718 25 + 26 + ...
+170
Documentation/devicetree/bindings/example-schema.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + # Copyright 2018 Linaro Ltd. 3 + %YAML 1.2 4 + --- 5 + # All the top-level keys are standard json-schema keywords except for 6 + # 'maintainers' and 'select' 7 + 8 + # $id is a unique idenifier based on the filename. There may or may not be a 9 + # file present at the URL. 10 + $id: "http://devicetree.org/schemas/example-schema.yaml#" 11 + # $schema is the meta-schema this schema should be validated with. 12 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 13 + 14 + title: An example schema annotated with jsonschema details 15 + 16 + maintainers: 17 + - Rob Herring <robh@kernel.org> 18 + 19 + description: | 20 + A more detailed multi-line description of the binding. 21 + 22 + Details about the hardware device and any links to datasheets can go here. 23 + 24 + Literal blocks are marked with the '|' at the beginning. The end is marked by 25 + indentation less than the first line of the literal block. Lines also cannot 26 + begin with a tab character. 27 + 28 + select: false 29 + # 'select' is a schema applied to a DT node to determine if this binding 30 + # schema should be applied to the node. It is optional and by default the 31 + # possible compatible strings are extracted and used to match. 32 + 33 + # In this case, a 'false' schema will never match. 34 + 35 + properties: 36 + # A dictionary of DT properties for this binding schema 37 + compatible: 38 + # More complicated schema can use oneOf (XOR), anyOf (OR), or allOf (AND) 39 + # to handle different conditions. 40 + # In this case, it's needed to handle a variable number of values as there 41 + # isn't another way to express a constraint of the last string value. 42 + # The boolean schema must be a list of schemas. 43 + oneOf: 44 + - items: 45 + # items is a list of possible values for the property. The number of 46 + # values is determined by the number of elements in the list. 47 + # Order in lists is significant, order in dicts is not 48 + # Must be one of the 1st enums followed by the 2nd enum 49 + # 50 + # Each element in items should be 'enum' or 'const' 51 + - enum: 52 + - vendor,soc4-ip 53 + - vendor,soc3-ip 54 + - vendor,soc2-ip 55 + - enum: 56 + - vendor,soc1-ip 57 + # additionalItems being false is implied 58 + # minItems/maxItems equal to 2 is implied 59 + - items: 60 + # 'const' is just a special case of an enum with a single possible value 61 + - const: vendor,soc1-ip 62 + 63 + reg: 64 + # The core schema already checks that reg values are numbers, so device 65 + # specific schema don't need to do those checks. 66 + # The description of each element defines the order and implicitly defines 67 + # the number of reg entries. 68 + items: 69 + - description: core registers 70 + - description: aux registers 71 + # minItems/maxItems equal to 2 is implied 72 + 73 + reg-names: 74 + # The core schema enforces this is a string array 75 + items: 76 + - const: core 77 + - const: aux 78 + 79 + clocks: 80 + # Cases that have only a single entry just need to express that with maxItems 81 + maxItems: 1 82 + description: bus clock 83 + 84 + clock-names: 85 + items: 86 + - const: bus 87 + 88 + interrupts: 89 + # Either 1 or 2 interrupts can be present 90 + minItems: 1 91 + maxItems: 2 92 + items: 93 + - description: tx or combined interrupt 94 + - description: rx interrupt 95 + description: 96 + A variable number of interrupts warrants a description of what conditions 97 + affect the number of interrupts. Otherwise, descriptions on standard 98 + properties are not necessary. 99 + 100 + interrupt-names: 101 + # minItems must be specified here because the default would be 2 102 + minItems: 1 103 + maxItems: 2 104 + items: 105 + - const: tx irq 106 + - const: rx irq 107 + 108 + # Property names starting with '#' must be quoted 109 + '#interrupt-cells': 110 + # A simple case where the value must always be '2'. 111 + # The core schema handles that this must be a single integer. 112 + const: 2 113 + 114 + interrupt-controller: true 115 + # The core checks this is a boolean, so just have to list it here to be 116 + # valid for this binding. 117 + 118 + clock-frequency: 119 + # The type is set in the core schema. Per device schema only need to set 120 + # constraints on the possible values. 121 + minimum: 100 122 + maximum: 400000 123 + # The value that should be used if the property is not present 124 + default: 200 125 + 126 + foo-gpios: 127 + maxItems: 1 128 + description: A connection of the 'foo' gpio line. 129 + 130 + vendor,int-property: 131 + description: Vendor specific properties must have a description 132 + # 'allOf' is the json-schema way of subclassing a schema. Here the base 133 + # type schema is referenced and then additional constraints on the values 134 + # are added. 135 + allOf: 136 + - $ref: /schemas/types.yaml#/definitions/uint32 137 + - enum: [2, 4, 6, 8, 10] 138 + 139 + vendor,bool-property: 140 + description: Vendor specific properties must have a description 141 + # boolean properties is one case where the json-schema 'type' keyword 142 + # can be used directly 143 + type: boolean 144 + 145 + vendor,string-array-property: 146 + description: Vendor specific properties should reference a type in the 147 + core schema. 148 + allOf: 149 + - $ref: /schemas/types.yaml#/definitions/string-array 150 + - items: 151 + - enum: [ foo, bar ] 152 + - enum: [ baz, boo ] 153 + 154 + required: 155 + - compatible 156 + - reg 157 + - interrupts 158 + - interrupt-controller 159 + 160 + examples: 161 + # Examples are now compiled with dtc 162 + - | 163 + node@1000 { 164 + compatible = "vendor,soc4-ip", "vendor,soc1-ip"; 165 + reg = <0x1000 0x80>, 166 + <0x3000 0x80>; 167 + reg-names = "core", "aux"; 168 + interrupts = <10>; 169 + interrupt-controller; 170 + };
+8 -2
Documentation/devicetree/bindings/gpio/gpio-omap.txt
··· 5 5 - "ti,omap2-gpio" for OMAP2 controllers 6 6 - "ti,omap3-gpio" for OMAP3 controllers 7 7 - "ti,omap4-gpio" for OMAP4 controllers 8 + - reg : Physical base address of the controller and length of memory mapped 9 + region. 8 10 - gpio-controller : Marks the device node as a GPIO controller. 9 11 - #gpio-cells : Should be two. 10 12 - first cell is the pin number ··· 20 18 2 = high-to-low edge triggered. 21 19 4 = active high level-sensitive. 22 20 8 = active low level-sensitive. 21 + - interrupts : The interrupt the controller is rising as output when an 22 + interrupt occures 23 23 24 24 OMAP specific properties: 25 25 - ti,hwmods: Name of the hwmod associated to the GPIO: ··· 33 29 34 30 Example: 35 31 36 - gpio4: gpio4 { 32 + gpio0: gpio@44e07000 { 37 33 compatible = "ti,omap4-gpio"; 38 - ti,hwmods = "gpio4"; 34 + reg = <0x44e07000 0x1000>; 35 + ti,hwmods = "gpio1"; 39 36 gpio-controller; 40 37 #gpio-cells = <2>; 41 38 interrupt-controller; 42 39 #interrupt-cells = <2>; 40 + interrupts = <96>; 43 41 };
-46
Documentation/devicetree/bindings/i2c/i2c-gpio.txt
··· 1 - Device-Tree bindings for i2c gpio driver 2 - 3 - Required properties: 4 - - compatible = "i2c-gpio"; 5 - - sda-gpios: gpio used for the sda signal, this should be flagged as 6 - active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) 7 - from <dt-bindings/gpio/gpio.h> since the signal is by definition 8 - open drain. 9 - - scl-gpios: gpio used for the scl signal, this should be flagged as 10 - active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) 11 - from <dt-bindings/gpio/gpio.h> since the signal is by definition 12 - open drain. 13 - 14 - Optional properties: 15 - - i2c-gpio,scl-output-only: scl as output only 16 - - i2c-gpio,delay-us: delay between GPIO operations (may depend on each platform) 17 - - i2c-gpio,timeout-ms: timeout to get data 18 - 19 - Deprecated properties, do not use in new device tree sources: 20 - - gpios: sda and scl gpio, alternative for {sda,scl}-gpios 21 - - i2c-gpio,sda-open-drain: this means that something outside of our 22 - control has put the GPIO line used for SDA into open drain mode, and 23 - that something is not the GPIO chip. It is essentially an 24 - inconsistency flag. 25 - - i2c-gpio,scl-open-drain: this means that something outside of our 26 - control has put the GPIO line used for SCL into open drain mode, and 27 - that something is not the GPIO chip. It is essentially an 28 - inconsistency flag. 29 - 30 - Example nodes: 31 - 32 - #include <dt-bindings/gpio/gpio.h> 33 - 34 - i2c@0 { 35 - compatible = "i2c-gpio"; 36 - sda-gpios = <&pioA 23 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 37 - scl-gpios = <&pioA 24 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; 38 - i2c-gpio,delay-us = <2>; /* ~100 kHz */ 39 - #address-cells = <1>; 40 - #size-cells = <0>; 41 - 42 - rv3029c2@56 { 43 - compatible = "rv3029c2"; 44 - reg = <0x56>; 45 - }; 46 - };
+73
Documentation/devicetree/bindings/i2c/i2c-gpio.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Bindings for GPIO bitbanged I2C 8 + 9 + maintainers: 10 + - Wolfram Sang <wolfram@the-dreams.de> 11 + 12 + allOf: 13 + - $ref: /schemas/i2c/i2c-controller.yaml# 14 + 15 + properties: 16 + compatible: 17 + items: 18 + - const: i2c-gpio 19 + 20 + sda-gpios: 21 + description: 22 + gpio used for the sda signal, this should be flagged as 23 + active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) 24 + from <dt-bindings/gpio/gpio.h> since the signal is by definition 25 + open drain. 26 + maxItems: 1 27 + 28 + scl-gpios: 29 + description: 30 + gpio used for the scl signal, this should be flagged as 31 + active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN) 32 + from <dt-bindings/gpio/gpio.h> since the signal is by definition 33 + open drain. 34 + maxItems: 1 35 + 36 + i2c-gpio,scl-output-only: 37 + description: scl as output only 38 + type: boolean 39 + 40 + i2c-gpio,delay-us: 41 + description: delay between GPIO operations (may depend on each platform) 42 + $ref: /schemas/types.yaml#/definitions/uint32 43 + 44 + i2c-gpio,timeout-ms: 45 + description: timeout to get data 46 + $ref: /schemas/types.yaml#/definitions/uint32 47 + 48 + # Deprecated properties, do not use in new device tree sources: 49 + gpios: 50 + minItems: 2 51 + maxItems: 2 52 + description: sda and scl gpio, alternative for {sda,scl}-gpios 53 + 54 + i2c-gpio,sda-open-drain: 55 + # Generate a warning if present 56 + not: true 57 + description: this means that something outside of our control has put 58 + the GPIO line used for SDA into open drain mode, and that something is 59 + not the GPIO chip. It is essentially an inconsistency flag. 60 + 61 + i2c-gpio,scl-open-drain: 62 + # Generate a warning if present 63 + not: true 64 + description: this means that something outside of our control has put the 65 + GPIO line used for SCL into open drain mode, and that something is not 66 + the GPIO chip. It is essentially an inconsistency flag. 67 + 68 + required: 69 + - compatible 70 + - sda-gpios 71 + - scl-gpios 72 + 73 + ...
+27
Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt
··· 1 + * FREESCALE MAG3110 magnetometer sensor 2 + 3 + Required properties: 4 + 5 + - compatible : should be "fsl,mag3110" 6 + - reg : the I2C address of the magnetometer 7 + 8 + Optional properties: 9 + 10 + - interrupts: the sole interrupt generated by the device 11 + 12 + Refer to interrupt-controller/interrupts.txt for generic interrupt client 13 + node bindings. 14 + 15 + - vdd-supply: phandle to the regulator that provides power to the sensor. 16 + - vddio-supply: phandle to the regulator that provides power to the sensor's IO. 17 + 18 + Example: 19 + 20 + magnetometer@e { 21 + compatible = "fsl,mag3110"; 22 + reg = <0x0e>; 23 + pinctrl-names = "default"; 24 + pinctrl-0 = <&pinctrl_i2c3_mag3110_int>; 25 + interrupt-parent = <&gpio3>; 26 + interrupts = <16 IRQ_TYPE_EDGE_RISING>; 27 + };
+1 -1
Documentation/devicetree/bindings/interrupt-controller/mrvl,intc.txt
··· 5 5 "mrvl,mmp2-mux-intc" 6 6 - reg : Address and length of the register set of the interrupt controller. 7 7 If the interrupt controller is intc, address and length means the range 8 - of the whold interrupt controller. If the interrupt controller is mux-intc, 8 + of the whole interrupt controller. If the interrupt controller is mux-intc, 9 9 address and length means one register. Since address of mux-intc is in the 10 10 range of intc. mux-intc is secondary interrupt controller. 11 11 - reg-names : Name of the register set of the interrupt controller. It's
+67
Documentation/devicetree/bindings/phy/phy-cadence-sierra.txt
··· 1 + Cadence Sierra PHY 2 + ----------------------- 3 + 4 + Required properties: 5 + - compatible: cdns,sierra-phy-t0 6 + - clocks: Must contain an entry in clock-names. 7 + See ../clocks/clock-bindings.txt for details. 8 + - clock-names: Must be "phy_clk" 9 + - resets: Must contain an entry for each in reset-names. 10 + See ../reset/reset.txt for details. 11 + - reset-names: Must include "sierra_reset" and "sierra_apb". 12 + "sierra_reset" must control the reset line to the PHY. 13 + "sierra_apb" must control the reset line to the APB PHY 14 + interface. 15 + - reg: register range for the PHY. 16 + - #address-cells: Must be 1 17 + - #size-cells: Must be 0 18 + 19 + Optional properties: 20 + - cdns,autoconf: A boolean property whose presence indicates that the 21 + PHY registers will be configured by hardware. If not 22 + present, all sub-node optional properties must be 23 + provided. 24 + 25 + Sub-nodes: 26 + Each group of PHY lanes with a single master lane should be represented as 27 + a sub-node. Note that the actual configuration of each lane is determined by 28 + hardware strapping, and must match the configuration specified here. 29 + 30 + Sub-node required properties: 31 + - #phy-cells: Generic PHY binding; must be 0. 32 + - reg: The master lane number. This is the lowest numbered lane 33 + in the lane group. 34 + - resets: Must contain one entry which controls the reset line for the 35 + master lane of the sub-node. 36 + See ../reset/reset.txt for details. 37 + 38 + Sub-node optional properties: 39 + - cdns,num-lanes: Number of lanes in this group. From 1 to 4. The 40 + group is made up of consecutive lanes. 41 + - cdns,phy-type: Can be PHY_TYPE_PCIE or PHY_TYPE_USB3, depending on 42 + configuration of lanes. 43 + 44 + Example: 45 + pcie_phy4: pcie-phy@fd240000 { 46 + compatible = "cdns,sierra-phy-t0"; 47 + reg = <0x0 0xfd240000 0x0 0x40000>; 48 + resets = <&phyrst 0>, <&phyrst 1>; 49 + reset-names = "sierra_reset", "sierra_apb"; 50 + clocks = <&phyclock>; 51 + clock-names = "phy_clk"; 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 + pcie0_phy0: pcie-phy@0 { 55 + reg = <0>; 56 + resets = <&phyrst 2>; 57 + cdns,num-lanes = <2>; 58 + #phy-cells = <0>; 59 + cdns,phy-type = <PHY_TYPE_PCIE>; 60 + }; 61 + pcie0_phy1: pcie-phy@2 { 62 + reg = <2>; 63 + resets = <&phyrst 4>; 64 + cdns,num-lanes = <1>; 65 + #phy-cells = <0>; 66 + cdns,phy-type = <PHY_TYPE_PCIE>; 67 + };
+24
Documentation/devicetree/bindings/reserved-memory/xen,shared-memory.txt
··· 1 + * Xen hypervisor reserved-memory binding 2 + 3 + Expose one or more memory regions as reserved-memory to the guest 4 + virtual machine. Typically, a region is configured at VM creation time 5 + to be a shared memory area across multiple virtual machines for 6 + communication among them. 7 + 8 + For each of these pre-shared memory regions, a range is exposed under 9 + the /reserved-memory node as a child node. Each range sub-node is named 10 + xen-shmem@<address> and has the following properties: 11 + 12 + - compatible: 13 + compatible = "xen,shared-memory-v1" 14 + 15 + - reg: 16 + the base guest physical address and size of the shared memory region 17 + 18 + - xen,offset: (borrower VMs only) 19 + 64 bit integer offset within the owner virtual machine's shared 20 + memory region used for the mapping in the borrower VM. 21 + 22 + - xen,id: 23 + a string that identifies the shared memory region as specified in 24 + the VM config file
+2 -1
Documentation/devicetree/bindings/rng/mtk-rng.txt
··· 1 1 Device-Tree bindings for Mediatek random number generator 2 - found in Mediatek SoC family 2 + found in MediaTek SoC family 3 3 4 4 Required properties: 5 5 - compatible : Should be 6 6 "mediatek,mt7622-rng", "mediatek,mt7623-rng" : for MT7622 7 + "mediatek,mt7629-rng", "mediatek,mt7623-rng" : for MT7629 7 8 "mediatek,mt7623-rng" : for MT7623 8 9 - clocks : list of clock specifiers, corresponding to 9 10 entries in clock-names property;
+64
Documentation/devicetree/bindings/rtc/rtc.txt
··· 1 + Generic device tree bindings for Real Time Clock devices 2 + ======================================================== 3 + 4 + This document describes generic bindings which can be used to describe Real Time 5 + Clock devices in a device tree. 6 + 7 + Required properties 8 + ------------------- 9 + 10 + - compatible : name of RTC device following generic names recommended practice. 11 + 12 + For other required properties e.g. to describe register sets, 13 + clocks, etc. check the binding documentation of the specific driver. 14 + 15 + Optional properties 16 + ------------------- 17 + 18 + - start-year : if provided, the default hardware range supported by the RTC is 19 + shifted so the first usable year is the specified one. 20 + 21 + The following properties may not be supported by all drivers. However, if a 22 + driver wants to support one of the below features, it should adapt the bindings 23 + below. 24 + - trickle-resistor-ohms : Selected resistor for trickle charger. Should be given 25 + if trickle charger should be enabled 26 + - trickle-diode-disable : Do not use internal trickle charger diode Should be 27 + given if internal trickle charger diode should be 28 + disabled 29 + - wakeup-source : Enables wake up of host system on alarm 30 + 31 + Trivial RTCs 32 + ------------ 33 + 34 + This is a list of trivial RTC devices that have simple device tree 35 + bindings, consisting only of a compatible field, an address and 36 + possibly an interrupt line. 37 + 38 + 39 + Compatible Vendor / Chip 40 + ========== ============= 41 + abracon,abb5zes3 AB-RTCMC-32.768kHz-B5ZE-S3: Real Time Clock/Calendar Module with I2C Interface 42 + dallas,ds1374 I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output 43 + dallas,ds1672 Dallas DS1672 Real-time Clock 44 + dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM 45 + epson,rx8010 I2C-BUS INTERFACE REAL TIME CLOCK MODULE 46 + epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE 47 + emmicro,em3027 EM Microelectronic EM3027 Real-time Clock 48 + isil,isl1208 Intersil ISL1208 Low Power RTC with Battery Backed SRAM 49 + isil,isl1218 Intersil ISL1218 Low Power RTC with Battery Backed SRAM 50 + isil,isl12022 Intersil ISL12022 Real-time Clock 51 + microcrystal,rv3029 Real Time Clock Module with I2C-Bus 52 + nxp,pcf2127 Real-time clock 53 + nxp,pcf2129 Real-time clock 54 + nxp,pcf8523 Real-time Clock 55 + nxp,pcf8563 Real-time clock/calendar 56 + nxp,pcf85063 Tiny Real-Time Clock 57 + pericom,pt7c4338 Real-time Clock Module 58 + ricoh,r2025sd I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 59 + ricoh,r2221tl I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 60 + ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 61 + ricoh,rs5c372b I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 62 + ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 63 + ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 64 + sii,s35390a 2-wire CMOS real-time clock
-112
Documentation/devicetree/bindings/timer/arm,arch_timer.txt
··· 1 - * ARM architected timer 2 - 3 - ARM cores may have a per-core architected timer, which provides per-cpu timers, 4 - or a memory mapped architected timer, which provides up to 8 frames with a 5 - physical and optional virtual timer per frame. 6 - 7 - The per-core architected timer is attached to a GIC to deliver its 8 - per-processor interrupts via PPIs. The memory mapped timer is attached to a GIC 9 - to deliver its interrupts via SPIs. 10 - 11 - ** CP15 Timer node properties: 12 - 13 - - compatible : Should at least contain one of 14 - "arm,armv7-timer" 15 - "arm,armv8-timer" 16 - 17 - - interrupts : Interrupt list for secure, non-secure, virtual and 18 - hypervisor timers, in that order. 19 - 20 - - clock-frequency : The frequency of the main counter, in Hz. Should be present 21 - only where necessary to work around broken firmware which does not configure 22 - CNTFRQ on all CPUs to a uniform correct value. Use of this property is 23 - strongly discouraged; fix your firmware unless absolutely impossible. 24 - 25 - - always-on : a boolean property. If present, the timer is powered through an 26 - always-on power domain, therefore it never loses context. 27 - 28 - - fsl,erratum-a008585 : A boolean property. Indicates the presence of 29 - QorIQ erratum A-008585, which says that reading the counter is 30 - unreliable unless the same value is returned by back-to-back reads. 31 - This also affects writes to the tval register, due to the implicit 32 - counter read. 33 - 34 - - hisilicon,erratum-161010101 : A boolean property. Indicates the 35 - presence of Hisilicon erratum 161010101, which says that reading the 36 - counters is unreliable in some cases, and reads may return a value 32 37 - beyond the correct value. This also affects writes to the tval 38 - registers, due to the implicit counter read. 39 - 40 - ** Optional properties: 41 - 42 - - arm,cpu-registers-not-fw-configured : Firmware does not initialize 43 - any of the generic timer CPU registers, which contain their 44 - architecturally-defined reset values. Only supported for 32-bit 45 - systems which follow the ARMv7 architected reset values. 46 - 47 - - arm,no-tick-in-suspend : The main counter does not tick when the system is in 48 - low-power system suspend on some SoCs. This behavior does not match the 49 - Architecture Reference Manual's specification that the system counter "must 50 - be implemented in an always-on power domain." 51 - 52 - 53 - Example: 54 - 55 - timer { 56 - compatible = "arm,cortex-a15-timer", 57 - "arm,armv7-timer"; 58 - interrupts = <1 13 0xf08>, 59 - <1 14 0xf08>, 60 - <1 11 0xf08>, 61 - <1 10 0xf08>; 62 - clock-frequency = <100000000>; 63 - }; 64 - 65 - ** Memory mapped timer node properties: 66 - 67 - - compatible : Should at least contain "arm,armv7-timer-mem". 68 - 69 - - clock-frequency : The frequency of the main counter, in Hz. Should be present 70 - only when firmware has not configured the MMIO CNTFRQ registers. 71 - 72 - - reg : The control frame base address. 73 - 74 - Note that #address-cells, #size-cells, and ranges shall be present to ensure 75 - the CPU can address a frame's registers. 76 - 77 - A timer node has up to 8 frame sub-nodes, each with the following properties: 78 - 79 - - frame-number: 0 to 7. 80 - 81 - - interrupts : Interrupt list for physical and virtual timers in that order. 82 - The virtual timer interrupt is optional. 83 - 84 - - reg : The first and second view base addresses in that order. The second view 85 - base address is optional. 86 - 87 - - status : "disabled" indicates the frame is not available for use. Optional. 88 - 89 - Example: 90 - 91 - timer@f0000000 { 92 - compatible = "arm,armv7-timer-mem"; 93 - #address-cells = <1>; 94 - #size-cells = <1>; 95 - ranges; 96 - reg = <0xf0000000 0x1000>; 97 - clock-frequency = <50000000>; 98 - 99 - frame@f0001000 { 100 - frame-number = <0> 101 - interrupts = <0 13 0x8>, 102 - <0 14 0x8>; 103 - reg = <0xf0001000 0x1000>, 104 - <0xf0002000 0x1000>; 105 - }; 106 - 107 - frame@f0003000 { 108 - frame-number = <1> 109 - interrupts = <0 15 0x8>; 110 - reg = <0xf0003000 0x1000>; 111 - }; 112 - };
+103
Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ARM architected timer 8 + 9 + maintainers: 10 + - Marc Zyngier <marc.zyngier@arm.com> 11 + - Mark Rutland <mark.rutland@arm.com> 12 + description: |+ 13 + ARM cores may have a per-core architected timer, which provides per-cpu timers, 14 + or a memory mapped architected timer, which provides up to 8 frames with a 15 + physical and optional virtual timer per frame. 16 + 17 + The per-core architected timer is attached to a GIC to deliver its 18 + per-processor interrupts via PPIs. The memory mapped timer is attached to a GIC 19 + to deliver its interrupts via SPIs. 20 + 21 + properties: 22 + compatible: 23 + oneOf: 24 + - items: 25 + - enum: 26 + - arm,cortex-a15-timer 27 + - enum: 28 + - arm,armv7-timer 29 + - items: 30 + - enum: 31 + - arm,armv7-timer 32 + - items: 33 + - enum: 34 + - arm,armv8-timer 35 + 36 + interrupts: 37 + items: 38 + - description: secure timer irq 39 + - description: non-secure timer irq 40 + - description: virtual timer irq 41 + - description: hypervisor timer irq 42 + 43 + clock-frequency: 44 + description: The frequency of the main counter, in Hz. Should be present 45 + only where necessary to work around broken firmware which does not configure 46 + CNTFRQ on all CPUs to a uniform correct value. Use of this property is 47 + strongly discouraged; fix your firmware unless absolutely impossible. 48 + 49 + always-on: 50 + type: boolean 51 + description: If present, the timer is powered through an always-on power 52 + domain, therefore it never loses context. 53 + 54 + fsl,erratum-a008585: 55 + type: boolean 56 + description: Indicates the presence of QorIQ erratum A-008585, which says 57 + that reading the counter is unreliable unless the same value is returned 58 + by back-to-back reads. This also affects writes to the tval register, due 59 + to the implicit counter read. 60 + 61 + hisilicon,erratum-161010101: 62 + type: boolean 63 + description: Indicates the presence of Hisilicon erratum 161010101, which 64 + says that reading the counters is unreliable in some cases, and reads may 65 + return a value 32 beyond the correct value. This also affects writes to 66 + the tval registers, due to the implicit counter read. 67 + 68 + arm,cpu-registers-not-fw-configured: 69 + type: boolean 70 + description: Firmware does not initialize any of the generic timer CPU 71 + registers, which contain their architecturally-defined reset values. Only 72 + supported for 32-bit systems which follow the ARMv7 architected reset 73 + values. 74 + 75 + arm,no-tick-in-suspend: 76 + type: boolean 77 + description: The main counter does not tick when the system is in 78 + low-power system suspend on some SoCs. This behavior does not match the 79 + Architecture Reference Manual's specification that the system counter "must 80 + be implemented in an always-on power domain." 81 + 82 + required: 83 + - compatible 84 + 85 + oneOf: 86 + - required: 87 + - interrupts 88 + - required: 89 + - interrupts-extended 90 + 91 + examples: 92 + - | 93 + timer { 94 + compatible = "arm,cortex-a15-timer", 95 + "arm,armv7-timer"; 96 + interrupts = <1 13 0xf08>, 97 + <1 14 0xf08>, 98 + <1 11 0xf08>, 99 + <1 10 0xf08>; 100 + clock-frequency = <100000000>; 101 + }; 102 + 103 + ...
+120
Documentation/devicetree/bindings/timer/arm,arch_timer_mmio.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/timer/arm,arch_timer_mmio.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ARM memory mapped architected timer 8 + 9 + maintainers: 10 + - Marc Zyngier <marc.zyngier@arm.com> 11 + - Mark Rutland <mark.rutland@arm.com> 12 + 13 + description: |+ 14 + ARM cores may have a memory mapped architected timer, which provides up to 8 15 + frames with a physical and optional virtual timer per frame. 16 + 17 + The memory mapped timer is attached to a GIC to deliver its interrupts via SPIs. 18 + 19 + properties: 20 + compatible: 21 + items: 22 + - enum: 23 + - arm,armv7-timer-mem 24 + 25 + reg: 26 + maxItems: 1 27 + description: The control frame base address 28 + 29 + '#address-cells': 30 + enum: [1, 2] 31 + 32 + '#size-cells': 33 + const: 1 34 + 35 + clock-frequency: 36 + description: The frequency of the main counter, in Hz. Should be present 37 + only where necessary to work around broken firmware which does not configure 38 + CNTFRQ on all CPUs to a uniform correct value. Use of this property is 39 + strongly discouraged; fix your firmware unless absolutely impossible. 40 + 41 + always-on: 42 + type: boolean 43 + description: If present, the timer is powered through an always-on power 44 + domain, therefore it never loses context. 45 + 46 + arm,cpu-registers-not-fw-configured: 47 + type: boolean 48 + description: Firmware does not initialize any of the generic timer CPU 49 + registers, which contain their architecturally-defined reset values. Only 50 + supported for 32-bit systems which follow the ARMv7 architected reset 51 + values. 52 + 53 + arm,no-tick-in-suspend: 54 + type: boolean 55 + description: The main counter does not tick when the system is in 56 + low-power system suspend on some SoCs. This behavior does not match the 57 + Architecture Reference Manual's specification that the system counter "must 58 + be implemented in an always-on power domain." 59 + 60 + patternProperties: 61 + '^frame@[0-9a-z]*$': 62 + description: A timer node has up to 8 frame sub-nodes, each with the following properties. 63 + properties: 64 + frame-number: 65 + allOf: 66 + - $ref: "/schemas/types.yaml#/definitions/uint32" 67 + - minimum: 0 68 + maximum: 7 69 + 70 + interrupts: 71 + minItems: 1 72 + maxItems: 2 73 + items: 74 + - description: physical timer irq 75 + - description: virtual timer irq 76 + 77 + reg : 78 + minItems: 1 79 + maxItems: 2 80 + items: 81 + - description: 1st view base address 82 + - description: 2nd optional view base address 83 + 84 + required: 85 + - frame-number 86 + - interrupts 87 + - reg 88 + 89 + required: 90 + - compatible 91 + - reg 92 + - '#address-cells' 93 + - '#size-cells' 94 + 95 + examples: 96 + - | 97 + timer@f0000000 { 98 + compatible = "arm,armv7-timer-mem"; 99 + #address-cells = <1>; 100 + #size-cells = <1>; 101 + ranges; 102 + reg = <0xf0000000 0x1000>; 103 + clock-frequency = <50000000>; 104 + 105 + frame@f0001000 { 106 + frame-number = <0>; 107 + interrupts = <0 13 0x8>, 108 + <0 14 0x8>; 109 + reg = <0xf0001000 0x1000>, 110 + <0xf0002000 0x1000>; 111 + }; 112 + 113 + frame@f0003000 { 114 + frame-number = <1>; 115 + interrupts = <0 15 0x8>; 116 + reg = <0xf0003000 0x1000>; 117 + }; 118 + }; 119 + 120 + ...
-27
Documentation/devicetree/bindings/timer/arm,global_timer.txt
··· 1 - 2 - * ARM Global Timer 3 - Cortex-A9 are often associated with a per-core Global timer. 4 - 5 - ** Timer node required properties: 6 - 7 - - compatible : should contain 8 - * "arm,cortex-a5-global-timer" for Cortex-A5 global timers. 9 - * "arm,cortex-a9-global-timer" for Cortex-A9 global 10 - timers or any compatible implementation. Note: driver 11 - supports versions r2p0 and above. 12 - 13 - - interrupts : One interrupt to each core 14 - 15 - - reg : Specify the base address and the size of the GT timer 16 - register window. 17 - 18 - - clocks : Should be phandle to a clock. 19 - 20 - Example: 21 - 22 - timer@2c000600 { 23 - compatible = "arm,cortex-a9-global-timer"; 24 - reg = <0x2c000600 0x20>; 25 - interrupts = <1 13 0xf01>; 26 - clocks = <&arm_periph_clk>; 27 - };
+46
Documentation/devicetree/bindings/timer/arm,global_timer.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/timer/arm,global_timer.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ARM Global Timer 8 + 9 + maintainers: 10 + - Stuart Menefy <stuart.menefy@st.com> 11 + 12 + description: 13 + Cortex-A9 are often associated with a per-core Global timer. 14 + 15 + properties: 16 + compatible: 17 + items: 18 + - enum: 19 + - arm,cortex-a5-global-timer 20 + - arm,cortex-a9-global-timer 21 + 22 + description: driver supports versions r2p0 and above. 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + interrupts: 28 + maxItems: 1 29 + 30 + clocks: 31 + maxItems: 1 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - clocks 37 + 38 + examples: 39 + - | 40 + timer@2c000600 { 41 + compatible = "arm,cortex-a9-global-timer"; 42 + reg = <0x2c000600 0x20>; 43 + interrupts = <1 13 0xf01>; 44 + clocks = <&arm_periph_clk>; 45 + }; 46 + ...
-190
Documentation/devicetree/bindings/trivial-devices.txt
··· 1 - This is a list of trivial i2c devices that have simple device tree 2 - bindings, consisting only of a compatible field, an address and 3 - possibly an interrupt line. 4 - 5 - If a device needs more specific bindings, such as properties to 6 - describe some aspect of it, there needs to be a specific binding 7 - document for it just like any other devices. 8 - 9 - 10 - Compatible Vendor / Chip 11 - ========== ============= 12 - abracon,abb5zes3 AB-RTCMC-32.768kHz-B5ZE-S3: Real Time Clock/Calendar Module with I2C Interface 13 - ad,ad7414 SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin 14 - ad,adm9240 ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems 15 - adi,adt7461 +/-1C TDM Extended Temp Range I.C 16 - adt7461 +/-1C TDM Extended Temp Range I.C 17 - adi,adt7473 +/-1C TDM Extended Temp Range I.C 18 - adi,adt7475 +/-1C TDM Extended Temp Range I.C 19 - adi,adt7476 +/-1C TDM Extended Temp Range I.C 20 - adi,adt7490 +/-1C TDM Extended Temp Range I.C 21 - adi,adxl345 Three-Axis Digital Accelerometer 22 - adi,adxl346 Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too) 23 - ams,iaq-core AMS iAQ-Core VOC Sensor 24 - at,24c08 i2c serial eeprom (24cxx) 25 - atmel,at97sc3204t i2c trusted platform module (TPM) 26 - capella,cm32181 CM32181: Ambient Light Sensor 27 - capella,cm3232 CM3232: Ambient Light Sensor 28 - dallas,ds1374 I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output 29 - dallas,ds1631 High-Precision Digital Thermometer 30 - dallas,ds1672 Dallas DS1672 Real-time Clock 31 - dallas,ds1682 Total-Elapsed-Time Recorder with Alarm 32 - dallas,ds1775 Tiny Digital Thermometer and Thermostat 33 - dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM 34 - dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O 35 - dallas,ds75 Digital Thermometer and Thermostat 36 - devantech,srf02 Devantech SRF02 ultrasonic ranger in I2C mode 37 - devantech,srf08 Devantech SRF08 ultrasonic ranger 38 - devantech,srf10 Devantech SRF10 ultrasonic ranger 39 - dlg,da9053 DA9053: flexible system level PMIC with multicore support 40 - dlg,da9063 DA9063: system PMIC for quad-core application processors 41 - domintech,dmard09 DMARD09: 3-axis Accelerometer 42 - domintech,dmard10 DMARD10: 3-axis Accelerometer 43 - epson,rx8010 I2C-BUS INTERFACE REAL TIME CLOCK MODULE 44 - epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE 45 - emmicro,em3027 EM Microelectronic EM3027 Real-time Clock 46 - fsl,mag3110 MAG3110: Xtrinsic High Accuracy, 3D Magnetometer 47 - fsl,mma7660 MMA7660FC: 3-Axis Orientation/Motion Detection Sensor 48 - fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer 49 - fsl,mpl3115 MPL3115: Absolute Digital Pressure Sensor 50 - fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller 51 - fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec 52 - gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface 53 - infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 54 - infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) 55 - infineon,tlv493d-a1b6 Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor 56 - isil,isl1208 Intersil ISL1208 Low Power RTC with Battery Backed SRAM 57 - isil,isl1218 Intersil ISL1218 Low Power RTC with Battery Backed SRAM 58 - isil,isl12022 Intersil ISL12022 Real-time Clock 59 - isil,isl29028 Intersil ISL29028 Ambient Light and Proximity Sensor 60 - isil,isl29030 Intersil ISL29030 Ambient Light and Proximity Sensor 61 - maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator 62 - maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs 63 - maxim,max6621 PECI-to-I2C translator for PECI-to-SMBus/I2C protocol conversion 64 - maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface 65 - mcube,mc3230 mCube 3-axis 8-bit digital accelerometer 66 - memsic,mxc6225 MEMSIC 2-axis 8-bit digital accelerometer 67 - microchip,mcp4017-502 Microchip 7-bit Single I2C Digital POT (5k) 68 - microchip,mcp4017-103 Microchip 7-bit Single I2C Digital POT (10k) 69 - microchip,mcp4017-503 Microchip 7-bit Single I2C Digital POT (50k) 70 - microchip,mcp4017-104 Microchip 7-bit Single I2C Digital POT (100k) 71 - microchip,mcp4018-502 Microchip 7-bit Single I2C Digital POT (5k) 72 - microchip,mcp4018-103 Microchip 7-bit Single I2C Digital POT (10k) 73 - microchip,mcp4018-503 Microchip 7-bit Single I2C Digital POT (50k) 74 - microchip,mcp4018-104 Microchip 7-bit Single I2C Digital POT (100k) 75 - microchip,mcp4019-502 Microchip 7-bit Single I2C Digital POT (5k) 76 - microchip,mcp4019-103 Microchip 7-bit Single I2C Digital POT (10k) 77 - microchip,mcp4019-503 Microchip 7-bit Single I2C Digital POT (50k) 78 - microchip,mcp4019-104 Microchip 7-bit Single I2C Digital POT (100k) 79 - microchip,mcp4531-502 Microchip 7-bit Single I2C Digital Potentiometer (5k) 80 - microchip,mcp4531-103 Microchip 7-bit Single I2C Digital Potentiometer (10k) 81 - microchip,mcp4531-503 Microchip 7-bit Single I2C Digital Potentiometer (50k) 82 - microchip,mcp4531-104 Microchip 7-bit Single I2C Digital Potentiometer (100k) 83 - microchip,mcp4532-502 Microchip 7-bit Single I2C Digital Potentiometer (5k) 84 - microchip,mcp4532-103 Microchip 7-bit Single I2C Digital Potentiometer (10k) 85 - microchip,mcp4532-503 Microchip 7-bit Single I2C Digital Potentiometer (50k) 86 - microchip,mcp4532-104 Microchip 7-bit Single I2C Digital Potentiometer (100k) 87 - microchip,mcp4541-502 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) 88 - microchip,mcp4541-103 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) 89 - microchip,mcp4541-503 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) 90 - microchip,mcp4541-104 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) 91 - microchip,mcp4542-502 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) 92 - microchip,mcp4542-103 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) 93 - microchip,mcp4542-503 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) 94 - microchip,mcp4542-104 Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) 95 - microchip,mcp4551-502 Microchip 8-bit Single I2C Digital Potentiometer (5k) 96 - microchip,mcp4551-103 Microchip 8-bit Single I2C Digital Potentiometer (10k) 97 - microchip,mcp4551-503 Microchip 8-bit Single I2C Digital Potentiometer (50k) 98 - microchip,mcp4551-104 Microchip 8-bit Single I2C Digital Potentiometer (100k) 99 - microchip,mcp4552-502 Microchip 8-bit Single I2C Digital Potentiometer (5k) 100 - microchip,mcp4552-103 Microchip 8-bit Single I2C Digital Potentiometer (10k) 101 - microchip,mcp4552-503 Microchip 8-bit Single I2C Digital Potentiometer (50k) 102 - microchip,mcp4552-104 Microchip 8-bit Single I2C Digital Potentiometer (100k) 103 - microchip,mcp4561-502 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) 104 - microchip,mcp4561-103 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) 105 - microchip,mcp4561-503 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) 106 - microchip,mcp4561-104 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) 107 - microchip,mcp4562-502 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) 108 - microchip,mcp4562-103 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) 109 - microchip,mcp4562-503 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) 110 - microchip,mcp4562-104 Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) 111 - microchip,mcp4631-502 Microchip 7-bit Dual I2C Digital Potentiometer (5k) 112 - microchip,mcp4631-103 Microchip 7-bit Dual I2C Digital Potentiometer (10k) 113 - microchip,mcp4631-503 Microchip 7-bit Dual I2C Digital Potentiometer (50k) 114 - microchip,mcp4631-104 Microchip 7-bit Dual I2C Digital Potentiometer (100k) 115 - microchip,mcp4632-502 Microchip 7-bit Dual I2C Digital Potentiometer (5k) 116 - microchip,mcp4632-103 Microchip 7-bit Dual I2C Digital Potentiometer (10k) 117 - microchip,mcp4632-503 Microchip 7-bit Dual I2C Digital Potentiometer (50k) 118 - microchip,mcp4632-104 Microchip 7-bit Dual I2C Digital Potentiometer (100k) 119 - microchip,mcp4641-502 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) 120 - microchip,mcp4641-103 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) 121 - microchip,mcp4641-503 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) 122 - microchip,mcp4641-104 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) 123 - microchip,mcp4642-502 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) 124 - microchip,mcp4642-103 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) 125 - microchip,mcp4642-503 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) 126 - microchip,mcp4642-104 Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) 127 - microchip,mcp4651-502 Microchip 8-bit Dual I2C Digital Potentiometer (5k) 128 - microchip,mcp4651-103 Microchip 8-bit Dual I2C Digital Potentiometer (10k) 129 - microchip,mcp4651-503 Microchip 8-bit Dual I2C Digital Potentiometer (50k) 130 - microchip,mcp4651-104 Microchip 8-bit Dual I2C Digital Potentiometer (100k) 131 - microchip,mcp4652-502 Microchip 8-bit Dual I2C Digital Potentiometer (5k) 132 - microchip,mcp4652-103 Microchip 8-bit Dual I2C Digital Potentiometer (10k) 133 - microchip,mcp4652-503 Microchip 8-bit Dual I2C Digital Potentiometer (50k) 134 - microchip,mcp4652-104 Microchip 8-bit Dual I2C Digital Potentiometer (100k) 135 - microchip,mcp4661-502 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) 136 - microchip,mcp4661-103 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) 137 - microchip,mcp4661-503 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) 138 - microchip,mcp4661-104 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) 139 - microchip,mcp4662-502 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) 140 - microchip,mcp4662-103 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) 141 - microchip,mcp4662-503 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) 142 - microchip,mcp4662-104 Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) 143 - microchip,tc654 PWM Fan Speed Controller With Fan Fault Detection 144 - microchip,tc655 PWM Fan Speed Controller With Fan Fault Detection 145 - microcrystal,rv3029 Real Time Clock Module with I2C-Bus 146 - miramems,da226 MiraMEMS DA226 2-axis 14-bit digital accelerometer 147 - miramems,da280 MiraMEMS DA280 3-axis 14-bit digital accelerometer 148 - miramems,da311 MiraMEMS DA311 3-axis 12-bit digital accelerometer 149 - national,lm63 Temperature sensor with integrated fan control 150 - national,lm75 I2C TEMP SENSOR 151 - national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor 152 - national,lm85 Temperature sensor with integrated fan control 153 - national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface 154 - nuvoton,npct501 i2c trusted platform module (TPM) 155 - nuvoton,npct601 i2c trusted platform module (TPM2) 156 - nuvoton,w83773g Nuvoton Temperature Sensor 157 - nxp,pca9556 Octal SMBus and I2C registered interface 158 - nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset 159 - nxp,pcf2127 Real-time clock 160 - nxp,pcf2129 Real-time clock 161 - nxp,pcf8523 Real-time Clock 162 - nxp,pcf8563 Real-time clock/calendar 163 - nxp,pcf85063 Tiny Real-Time Clock 164 - oki,ml86v7667 OKI ML86V7667 video decoder 165 - ovti,ov5642 OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus 166 - pericom,pt7c4338 Real-time Clock Module 167 - plx,pex8648 48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch 168 - pulsedlight,lidar-lite-v2 Pulsedlight LIDAR range-finding sensor 169 - ricoh,r2025sd I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 170 - ricoh,r2221tl I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 171 - ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 172 - ricoh,rs5c372b I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 173 - ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 174 - ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 175 - samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) 176 - sgx,vz89x SGX Sensortech VZ89X Sensors 177 - sii,s35390a 2-wire CMOS real-time clock 178 - silabs,si7020 Relative Humidity and Temperature Sensors 179 - skyworks,sky81452 Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply 180 - st,24c256 i2c serial eeprom (24cxx) 181 - taos,tsl2550 Ambient Light Sensor with SMBUS/Two Wire Serial Interface 182 - ti,ads7828 8-Channels, 12-bit ADC 183 - ti,ads7830 8-Channels, 8-bit ADC 184 - ti,amc6821 Temperature Monitoring and Fan Control 185 - ti,tsc2003 I2C Touch-Screen Controller 186 - ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface 187 - ti,tmp103 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface 188 - ti,tmp275 Digital Temperature Sensor 189 - winbond,w83793 Winbond/Nuvoton H/W Monitor 190 - winbond,wpct301 i2c trusted platform module (TPM)
+342
Documentation/devicetree/bindings/trivial-devices.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/trivial-devices.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Trivial I2C and SPI devices that have simple device tree bindings 8 + 9 + maintainers: 10 + - Rob Herring <robh@kernel.org> 11 + 12 + description: | 13 + This is a list of trivial I2C and SPI devices that have simple device tree 14 + bindings, consisting only of a compatible field, an address and possibly an 15 + interrupt line. 16 + 17 + If a device needs more specific bindings, such as properties to 18 + describe some aspect of it, there needs to be a specific binding 19 + document for it just like any other devices. 20 + 21 + properties: 22 + reg: 23 + maxItems: 1 24 + interrupts: 25 + maxItems: 1 26 + compatible: 27 + items: 28 + - enum: 29 + # SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin 30 + - ad,ad7414 31 + # ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems 32 + - ad,adm9240 33 + # +/-1C TDM Extended Temp Range I.C 34 + - adi,adt7461 35 + # +/-1C TDM Extended Temp Range I.C 36 + - adt7461 37 + # +/-1C TDM Extended Temp Range I.C 38 + - adi,adt7473 39 + # +/-1C TDM Extended Temp Range I.C 40 + - adi,adt7475 41 + # +/-1C TDM Extended Temp Range I.C 42 + - adi,adt7476 43 + # +/-1C TDM Extended Temp Range I.C 44 + - adi,adt7490 45 + # Three-Axis Digital Accelerometer 46 + - adi,adxl345 47 + # Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too) 48 + - adi,adxl346 49 + # AMS iAQ-Core VOC Sensor 50 + - ams,iaq-core 51 + # i2c serial eeprom (24cxx) 52 + - at,24c08 53 + # i2c trusted platform module (TPM) 54 + - atmel,at97sc3204t 55 + # CM32181: Ambient Light Sensor 56 + - capella,cm32181 57 + # CM3232: Ambient Light Sensor 58 + - capella,cm3232 59 + # High-Precision Digital Thermometer 60 + - dallas,ds1631 61 + # Total-Elapsed-Time Recorder with Alarm 62 + - dallas,ds1682 63 + # Tiny Digital Thermometer and Thermostat 64 + - dallas,ds1775 65 + # CPU Supervisor with Nonvolatile Memory and Programmable I/O 66 + - dallas,ds4510 67 + # Digital Thermometer and Thermostat 68 + - dallas,ds75 69 + # Devantech SRF02 ultrasonic ranger in I2C mode 70 + - devantech,srf02 71 + # Devantech SRF08 ultrasonic ranger 72 + - devantech,srf08 73 + # Devantech SRF10 ultrasonic ranger 74 + - devantech,srf10 75 + # DA9053: flexible system level PMIC with multicore support 76 + - dlg,da9053 77 + # DA9063: system PMIC for quad-core application processors 78 + - dlg,da9063 79 + # DMARD09: 3-axis Accelerometer 80 + - domintech,dmard09 81 + # DMARD10: 3-axis Accelerometer 82 + - domintech,dmard10 83 + # MMA7660FC: 3-Axis Orientation/Motion Detection Sensor 84 + - fsl,mma7660 85 + # MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer 86 + - fsl,mma8450 87 + # MPL3115: Absolute Digital Pressure Sensor 88 + - fsl,mpl3115 89 + # MPR121: Proximity Capacitive Touch Sensor Controller 90 + - fsl,mpr121 91 + # SGTL5000: Ultra Low-Power Audio Codec 92 + - fsl,sgtl5000 93 + # G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface 94 + - gmt,g751 95 + # Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) 96 + - infineon,slb9635tt 97 + # Infineon SLB9645 I2C TPM (new protocol, max 400khz) 98 + - infineon,slb9645tt 99 + # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor 100 + - infineon,tlv493d-a1b6 101 + # Intersil ISL29028 Ambient Light and Proximity Sensor 102 + - isil,isl29028 103 + # Intersil ISL29030 Ambient Light and Proximity Sensor 104 + - isil,isl29030 105 + # 5 Bit Programmable, Pulse-Width Modulator 106 + - maxim,ds1050 107 + # Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs 108 + - maxim,max1237 109 + # PECI-to-I2C translator for PECI-to-SMBus/I2C protocol conversion 110 + - maxim,max6621 111 + # 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface 112 + - maxim,max6625 113 + # mCube 3-axis 8-bit digital accelerometer 114 + - mcube,mc3230 115 + # MEMSIC 2-axis 8-bit digital accelerometer 116 + - memsic,mxc6225 117 + # Microchip 7-bit Single I2C Digital POT (5k) 118 + - microchip,mcp4017-502 119 + # Microchip 7-bit Single I2C Digital POT (10k) 120 + - microchip,mcp4017-103 121 + # Microchip 7-bit Single I2C Digital POT (50k) 122 + - microchip,mcp4017-503 123 + # Microchip 7-bit Single I2C Digital POT (100k) 124 + - microchip,mcp4017-104 125 + # Microchip 7-bit Single I2C Digital POT (5k) 126 + - microchip,mcp4018-502 127 + # Microchip 7-bit Single I2C Digital POT (10k) 128 + - microchip,mcp4018-103 129 + # Microchip 7-bit Single I2C Digital POT (50k) 130 + - microchip,mcp4018-503 131 + # Microchip 7-bit Single I2C Digital POT (100k) 132 + - microchip,mcp4018-104 133 + # Microchip 7-bit Single I2C Digital POT (5k) 134 + - microchip,mcp4019-502 135 + # Microchip 7-bit Single I2C Digital POT (10k) 136 + - microchip,mcp4019-103 137 + # Microchip 7-bit Single I2C Digital POT (50k) 138 + - microchip,mcp4019-503 139 + # Microchip 7-bit Single I2C Digital POT (100k) 140 + - microchip,mcp4019-104 141 + # Microchip 7-bit Single I2C Digital Potentiometer (5k) 142 + - microchip,mcp4531-502 143 + # Microchip 7-bit Single I2C Digital Potentiometer (10k) 144 + - microchip,mcp4531-103 145 + # Microchip 7-bit Single I2C Digital Potentiometer (50k) 146 + - microchip,mcp4531-503 147 + # Microchip 7-bit Single I2C Digital Potentiometer (100k) 148 + - microchip,mcp4531-104 149 + # Microchip 7-bit Single I2C Digital Potentiometer (5k) 150 + - microchip,mcp4532-502 151 + # Microchip 7-bit Single I2C Digital Potentiometer (10k) 152 + - microchip,mcp4532-103 153 + # Microchip 7-bit Single I2C Digital Potentiometer (50k) 154 + - microchip,mcp4532-503 155 + # Microchip 7-bit Single I2C Digital Potentiometer (100k) 156 + - microchip,mcp4532-104 157 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) 158 + - microchip,mcp4541-502 159 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) 160 + - microchip,mcp4541-103 161 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) 162 + - microchip,mcp4541-503 163 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) 164 + - microchip,mcp4541-104 165 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (5k) 166 + - microchip,mcp4542-502 167 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (10k) 168 + - microchip,mcp4542-103 169 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (50k) 170 + - microchip,mcp4542-503 171 + # Microchip 7-bit Single I2C Digital Potentiometer with NV Memory (100k) 172 + - microchip,mcp4542-104 173 + # Microchip 8-bit Single I2C Digital Potentiometer (5k) 174 + - microchip,mcp4551-502 175 + # Microchip 8-bit Single I2C Digital Potentiometer (10k) 176 + - microchip,mcp4551-103 177 + # Microchip 8-bit Single I2C Digital Potentiometer (50k) 178 + - microchip,mcp4551-503 179 + # Microchip 8-bit Single I2C Digital Potentiometer (100k) 180 + - microchip,mcp4551-104 181 + # Microchip 8-bit Single I2C Digital Potentiometer (5k) 182 + - microchip,mcp4552-502 183 + # Microchip 8-bit Single I2C Digital Potentiometer (10k) 184 + - microchip,mcp4552-103 185 + # Microchip 8-bit Single I2C Digital Potentiometer (50k) 186 + - microchip,mcp4552-503 187 + # Microchip 8-bit Single I2C Digital Potentiometer (100k) 188 + - microchip,mcp4552-104 189 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) 190 + - microchip,mcp4561-502 191 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) 192 + - microchip,mcp4561-103 193 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) 194 + - microchip,mcp4561-503 195 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) 196 + - microchip,mcp4561-104 197 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (5k) 198 + - microchip,mcp4562-502 199 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (10k) 200 + - microchip,mcp4562-103 201 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (50k) 202 + - microchip,mcp4562-503 203 + # Microchip 8-bit Single I2C Digital Potentiometer with NV Memory (100k) 204 + - microchip,mcp4562-104 205 + # Microchip 7-bit Dual I2C Digital Potentiometer (5k) 206 + - microchip,mcp4631-502 207 + # Microchip 7-bit Dual I2C Digital Potentiometer (10k) 208 + - microchip,mcp4631-103 209 + # Microchip 7-bit Dual I2C Digital Potentiometer (50k) 210 + - microchip,mcp4631-503 211 + # Microchip 7-bit Dual I2C Digital Potentiometer (100k) 212 + - microchip,mcp4631-104 213 + # Microchip 7-bit Dual I2C Digital Potentiometer (5k) 214 + - microchip,mcp4632-502 215 + # Microchip 7-bit Dual I2C Digital Potentiometer (10k) 216 + - microchip,mcp4632-103 217 + # Microchip 7-bit Dual I2C Digital Potentiometer (50k) 218 + - microchip,mcp4632-503 219 + # Microchip 7-bit Dual I2C Digital Potentiometer (100k) 220 + - microchip,mcp4632-104 221 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) 222 + - microchip,mcp4641-502 223 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) 224 + - microchip,mcp4641-103 225 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) 226 + - microchip,mcp4641-503 227 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) 228 + - microchip,mcp4641-104 229 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (5k) 230 + - microchip,mcp4642-502 231 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (10k) 232 + - microchip,mcp4642-103 233 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (50k) 234 + - microchip,mcp4642-503 235 + # Microchip 7-bit Dual I2C Digital Potentiometer with NV Memory (100k) 236 + - microchip,mcp4642-104 237 + # Microchip 8-bit Dual I2C Digital Potentiometer (5k) 238 + - microchip,mcp4651-502 239 + # Microchip 8-bit Dual I2C Digital Potentiometer (10k) 240 + - microchip,mcp4651-103 241 + # Microchip 8-bit Dual I2C Digital Potentiometer (50k) 242 + - microchip,mcp4651-503 243 + # Microchip 8-bit Dual I2C Digital Potentiometer (100k) 244 + - microchip,mcp4651-104 245 + # Microchip 8-bit Dual I2C Digital Potentiometer (5k) 246 + - microchip,mcp4652-502 247 + # Microchip 8-bit Dual I2C Digital Potentiometer (10k) 248 + - microchip,mcp4652-103 249 + # Microchip 8-bit Dual I2C Digital Potentiometer (50k) 250 + - microchip,mcp4652-503 251 + # Microchip 8-bit Dual I2C Digital Potentiometer (100k) 252 + - microchip,mcp4652-104 253 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) 254 + - microchip,mcp4661-502 255 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) 256 + - microchip,mcp4661-103 257 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) 258 + - microchip,mcp4661-503 259 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) 260 + - microchip,mcp4661-104 261 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (5k) 262 + - microchip,mcp4662-502 263 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (10k) 264 + - microchip,mcp4662-103 265 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (50k) 266 + - microchip,mcp4662-503 267 + # Microchip 8-bit Dual I2C Digital Potentiometer with NV Memory (100k) 268 + - microchip,mcp4662-104 269 + # PWM Fan Speed Controller With Fan Fault Detection 270 + - microchip,tc654 271 + # PWM Fan Speed Controller With Fan Fault Detection 272 + - microchip,tc655 273 + # MiraMEMS DA226 2-axis 14-bit digital accelerometer 274 + - miramems,da226 275 + # MiraMEMS DA280 3-axis 14-bit digital accelerometer 276 + - miramems,da280 277 + # MiraMEMS DA311 3-axis 12-bit digital accelerometer 278 + - miramems,da311 279 + # Temperature sensor with integrated fan control 280 + - national,lm63 281 + # I2C TEMP SENSOR 282 + - national,lm75 283 + # Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor 284 + - national,lm80 285 + # Temperature sensor with integrated fan control 286 + - national,lm85 287 + # ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface 288 + - national,lm92 289 + # i2c trusted platform module (TPM) 290 + - nuvoton,npct501 291 + # i2c trusted platform module (TPM2) 292 + - nuvoton,npct601 293 + # Nuvoton Temperature Sensor 294 + - nuvoton,w83773g 295 + # Octal SMBus and I2C registered interface 296 + - nxp,pca9556 297 + # 8-bit I2C-bus and SMBus I/O port with reset 298 + - nxp,pca9557 299 + # OKI ML86V7667 video decoder 300 + - oki,ml86v7667 301 + # OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus 302 + - ovti,ov5642 303 + # 48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch 304 + - plx,pex8648 305 + # Pulsedlight LIDAR range-finding sensor 306 + - pulsedlight,lidar-lite-v2 307 + # S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) 308 + - samsung,24ad0xd1 309 + # SGX Sensortech VZ89X Sensors 310 + - sgx,vz89x 311 + # Relative Humidity and Temperature Sensors 312 + - silabs,si7020 313 + # Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply 314 + - skyworks,sky81452 315 + # i2c serial eeprom (24cxx) 316 + - st,24c256 317 + # Ambient Light Sensor with SMBUS/Two Wire Serial Interface 318 + - taos,tsl2550 319 + # 8-Channels, 12-bit ADC 320 + - ti,ads7828 321 + # 8-Channels, 8-bit ADC 322 + - ti,ads7830 323 + # Temperature Monitoring and Fan Control 324 + - ti,amc6821 325 + # I2C Touch-Screen Controller 326 + - ti,tsc2003 327 + # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface 328 + - ti,tmp102 329 + # Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface 330 + - ti,tmp103 331 + # Digital Temperature Sensor 332 + - ti,tmp275 333 + # Winbond/Nuvoton H/W Monitor 334 + - winbond,w83793 335 + # i2c trusted platform module (TPM) 336 + - winbond,wpct301 337 + 338 + required: 339 + - compatible 340 + - reg 341 + 342 + ...
-10
Documentation/devicetree/todo.txt
··· 1 - Todo list for devicetree: 2 - 3 - === General structure === 4 - - Switch from custom lists to (h)list_head for nodes and properties structure 5 - 6 - === CONFIG_OF_DYNAMIC === 7 - - Switch to RCU for tree updates and get rid of global spinlock 8 - - Document node lifecycle for CONFIG_OF_DYNAMIC 9 - - Always set ->full_name at of_attach_node() time 10 - - pseries: Get rid of open-coded tree modification from arch/powerpc/platforms/pseries/dlpar.c
+130
Documentation/devicetree/writing-schema.md
··· 1 + # Writing DeviceTree Bindings in json-schema 2 + 3 + Devicetree bindings are written using json-schema vocabulary. Schema files are 4 + written in a JSON compatible subset of YAML. YAML is used instead of JSON as it 5 + considered more human readable and has some advantages such as allowing 6 + comments (Prefixed with '#'). 7 + 8 + ## Schema Contents 9 + 10 + Each schema doc is a structured json-schema which is defined by a set of 11 + top-level properties. Generally, there is one binding defined per file. The 12 + top-level json-schema properties used are: 13 + 14 + - __$id__ - A json-schema unique identifier string. The string must be a valid 15 + URI typically containing the binding's filename and path. For DT schema, it must 16 + begin with "http://devicetree.org/schemas/". The URL is used in constructing 17 + references to other files specified in schema "$ref" properties. A $ref values 18 + with a leading '/' will have the hostname prepended. A $ref value a relative 19 + path or filename only will be prepended with the hostname and path components 20 + of the current schema file's '$id' value. A URL is used even for local files, 21 + but there may not actually be files present at those locations. 22 + 23 + - __$schema__ - Indicates the meta-schema the schema file adheres to. 24 + 25 + - __title__ - A one line description on the contents of the binding schema. 26 + 27 + - __maintainers__ - A DT specific property. Contains a list of email address(es) 28 + for maintainers of this binding. 29 + 30 + - __description__ - Optional. A multi-line text block containing any detailed 31 + information about this binding. It should contain things such as what the block 32 + or device does, standards the device conforms to, and links to datasheets for 33 + more information. 34 + 35 + - __select__ - Optional. A json-schema used to match nodes for applying the 36 + schema. By default without 'select', nodes are matched against their possible 37 + compatible string values or node name. Most bindings should not need select. 38 + 39 + - __allOf__ - Optional. A list of other schemas to include. This is used to 40 + include other schemas the binding conforms to. This may be schemas for a 41 + particular class of devices such as I2C or SPI controllers. 42 + 43 + - __properties__ - A set of sub-schema defining all the DT properties for the 44 + binding. The exact schema syntax depends on whether properties are known, 45 + common properties (e.g. 'interrupts') or are binding/vendor specific properties. 46 + 47 + A property can also define a child DT node with child properties defined 48 + under it. 49 + 50 + For more details on properties sections, see 'Property Schema' section. 51 + 52 + - __patternProperties__ - Optional. Similar to 'properties', but names are regex. 53 + 54 + - __required__ - A list of DT properties from the 'properties' section that 55 + must always be present. 56 + 57 + - __examples__ - Optional. A list of one or more DTS hunks implementing the 58 + binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead. 59 + 60 + Unless noted otherwise, all properties are required. 61 + 62 + ## Property Schema 63 + 64 + The 'properties' section of the schema contains all the DT properties for a 65 + binding. Each property contains a set of constraints using json-schema 66 + vocabulary for that property. The properties schemas are what is used for 67 + validation of DT files. 68 + 69 + For common properties, only additional constraints not covered by the common 70 + binding schema need to be defined such as how many values are valid or what 71 + possible values are valid. 72 + 73 + Vendor specific properties will typically need more detailed schema. With the 74 + exception of boolean properties, they should have a reference to a type in 75 + schemas/types.yaml. A "description" property is always required. 76 + 77 + The Devicetree schemas don't exactly match the YAML encoded DT data produced by 78 + dtc. They are simplified to make them more compact and avoid a bunch of 79 + boilerplate. The tools process the schema files to produce the final schema for 80 + validation. There are currently 2 transformations the tools perform. 81 + 82 + The default for arrays in json-schema is they are variable sized and allow more 83 + entries than explicitly defined. This can be restricted by defining 'minItems', 84 + 'maxItems', and 'additionalItems'. However, for DeviceTree Schemas, a fixed 85 + size is desired in most cases, so these properties are added based on the 86 + number of entries in an 'items' list. 87 + 88 + The YAML Devicetree format also makes all string values an array and scalar 89 + values a matrix (in order to define groupings) even when only a single value 90 + is present. Single entries in schemas are fixed up to match this encoding. 91 + 92 + ## Testing 93 + 94 + ### Dependencies 95 + 96 + The DT schema project must be installed in order to validate the DT schema 97 + binding documents and validate DTS files using the DT schema. The DT schema 98 + project can be installed with pip: 99 + 100 + `pip3 install git+https://github.com/robherring/yaml-bindings.git@master` 101 + 102 + dtc must also be built with YAML output support enabled. This requires that 103 + libyaml and its headers be installed on the host system. 104 + 105 + ### Running checks 106 + 107 + The DT schema binding documents must be validated using the meta-schema (the 108 + schema for the schema) to ensure they are both valid json-schema and valid 109 + binding schema. All of the DT binding documents can be validated using the 110 + `dt_binding_check` target: 111 + 112 + `make dt_binding_check` 113 + 114 + In order to perform validation of DT source files, use the `dtbs_check` target: 115 + 116 + `make dtbs_check` 117 + 118 + This will first run the `dt_binding_check` which generates the processed schema. 119 + 120 + It is also possible to run checks with a single schema file by setting the 121 + 'DT_SCHEMA_FILES' variable to a specific schema file. 122 + 123 + `make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/trivial-devices.yaml` 124 + 125 + 126 + ## json-schema Resources 127 + 128 + [JSON-Schema Specifications](http://json-schema.org/) 129 + 130 + [Using JSON Schema Book](http://usingjsonschema.com/)
+1 -1
MAINTAINERS
··· 2353 2353 F: drivers/soc/zte/ 2354 2354 F: drivers/thermal/zx2967_thermal.c 2355 2355 F: drivers/watchdog/zx2967_wdt.c 2356 - F: Documentation/devicetree/bindings/arm/zte.txt 2356 + F: Documentation/devicetree/bindings/arm/zte.yaml 2357 2357 F: Documentation/devicetree/bindings/clock/zx2967*.txt 2358 2358 F: Documentation/devicetree/bindings/dma/zxdma.txt 2359 2359 F: Documentation/devicetree/bindings/gpio/zx296702-gpio.txt
+10 -3
Makefile
··· 1230 1230 %.dtb: prepare3 scripts_dtc 1231 1231 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ 1232 1232 1233 - PHONY += dtbs dtbs_install 1234 - dtbs: prepare3 scripts_dtc 1233 + PHONY += dtbs dtbs_install dt_binding_check 1234 + dtbs dtbs_check: prepare3 scripts_dtc 1235 1235 $(Q)$(MAKE) $(build)=$(dtstree) 1236 + 1237 + dtbs_check: export CHECK_DTBS=1 1238 + dtbs_check: dt_binding_check 1236 1239 1237 1240 dtbs_install: 1238 1241 $(Q)$(MAKE) $(dtbinst)=$(dtstree) ··· 1249 1246 PHONY += scripts_dtc 1250 1247 scripts_dtc: scripts_basic 1251 1248 $(Q)$(MAKE) $(build)=scripts/dtc 1249 + 1250 + dt_binding_check: scripts_dtc 1251 + $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings 1252 1252 1253 1253 # --------------------------------------------------------------------------- 1254 1254 # Modules ··· 1615 1609 $(call cmd,rmfiles) 1616 1610 @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ 1617 1611 \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ 1618 - -o -name '*.ko.*' -o -name '*.dtb' -o -name '*.dtb.S' \ 1612 + -o -name '*.ko.*' \ 1613 + -o -name '*.dtb' -o -name '*.dtb.S' -o -name '*.dt.yaml' \ 1619 1614 -o -name '*.dwo' -o -name '*.lst' \ 1620 1615 -o -name '*.su' \ 1621 1616 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
+5 -20
arch/arc/mm/init.c
··· 78 78 base, TO_MB(size), !in_use ? "Not used":""); 79 79 } 80 80 81 - #ifdef CONFIG_BLK_DEV_INITRD 82 - static int __init early_initrd(char *p) 83 - { 84 - unsigned long start, size; 85 - char *endp; 86 - 87 - start = memparse(p, &endp); 88 - if (*endp == ',') { 89 - size = memparse(endp + 1, NULL); 90 - 91 - initrd_start = (unsigned long)__va(start); 92 - initrd_end = (unsigned long)__va(start + size); 93 - } 94 - return 0; 95 - } 96 - early_param("initrd", early_initrd); 97 - #endif 98 - 99 81 /* 100 82 * First memory setup routine called from setup_arch() 101 83 * 1. setup swapper's mm @init_mm ··· 122 140 memblock_reserve(low_mem_start, __pa(_end) - low_mem_start); 123 141 124 142 #ifdef CONFIG_BLK_DEV_INITRD 125 - if (initrd_start) 126 - memblock_reserve(__pa(initrd_start), initrd_end - initrd_start); 143 + if (phys_initrd_size) { 144 + memblock_reserve(phys_initrd_start, phys_initrd_size); 145 + initrd_start = (unsigned long)__va(phys_initrd_start); 146 + initrd_end = initrd_start + phys_initrd_size; 147 + } 127 148 #endif 128 149 129 150 early_init_fdt_reserve_self();
+2 -26
arch/arm/mm/init.c
··· 50 50 } 51 51 #endif 52 52 53 - static phys_addr_t phys_initrd_start __initdata = 0; 54 - static unsigned long phys_initrd_size __initdata = 0; 55 - 56 - static int __init early_initrd(char *p) 57 - { 58 - phys_addr_t start; 59 - unsigned long size; 60 - char *endp; 61 - 62 - start = memparse(p, &endp); 63 - if (*endp == ',') { 64 - size = memparse(endp + 1, NULL); 65 - 66 - phys_initrd_start = start; 67 - phys_initrd_size = size; 68 - } 69 - return 0; 70 - } 71 - early_param("initrd", early_initrd); 72 - 53 + #ifdef CONFIG_BLK_DEV_INITRD 73 54 static int __init parse_tag_initrd(const struct tag *tag) 74 55 { 75 56 pr_warn("ATAG_INITRD is deprecated; " ··· 70 89 } 71 90 72 91 __tagtable(ATAG_INITRD2, parse_tag_initrd2); 92 + #endif 73 93 74 94 static void __init find_limits(unsigned long *min, unsigned long *max_low, 75 95 unsigned long *max_high) ··· 217 235 #ifdef CONFIG_BLK_DEV_INITRD 218 236 phys_addr_t start; 219 237 unsigned long size; 220 - 221 - /* FDT scan will populate initrd_start */ 222 - if (initrd_start && !phys_initrd_size) { 223 - phys_initrd_start = __virt_to_phys(initrd_start); 224 - phys_initrd_size = initrd_end - initrd_start; 225 - } 226 238 227 239 initrd_start = initrd_end = 0; 228 240
-8
arch/arm64/include/asm/memory.h
··· 171 171 #define IOREMAP_MAX_ORDER (PMD_SHIFT) 172 172 #endif 173 173 174 - #ifdef CONFIG_BLK_DEV_INITRD 175 - #define __early_init_dt_declare_initrd(__start, __end) \ 176 - do { \ 177 - initrd_start = (__start); \ 178 - initrd_end = (__end); \ 179 - } while (0) 180 - #endif 181 - 182 174 #ifndef __ASSEMBLY__ 183 175 184 176 #include <linux/bitops.h>
+6 -28
arch/arm64/mm/init.c
··· 63 63 64 64 phys_addr_t arm64_dma_phys_limit __ro_after_init; 65 65 66 - #ifdef CONFIG_BLK_DEV_INITRD 67 - static int __init early_initrd(char *p) 68 - { 69 - unsigned long start, size; 70 - char *endp; 71 - 72 - start = memparse(p, &endp); 73 - if (*endp == ',') { 74 - size = memparse(endp + 1, NULL); 75 - 76 - initrd_start = start; 77 - initrd_end = start + size; 78 - } 79 - return 0; 80 - } 81 - early_param("initrd", early_initrd); 82 - #endif 83 - 84 66 #ifdef CONFIG_KEXEC_CORE 85 67 /* 86 68 * reserve_crashkernel() - reserves memory for crash kernel ··· 399 417 memblock_add(__pa_symbol(_text), (u64)(_end - _text)); 400 418 } 401 419 402 - if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_start) { 420 + if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) { 403 421 /* 404 422 * Add back the memory we just removed if it results in the 405 423 * initrd to become inaccessible via the linear mapping. 406 424 * Otherwise, this is a no-op 407 425 */ 408 - u64 base = initrd_start & PAGE_MASK; 409 - u64 size = PAGE_ALIGN(initrd_end) - base; 426 + u64 base = phys_initrd_start & PAGE_MASK; 427 + u64 size = PAGE_ALIGN(phys_initrd_size); 410 428 411 429 /* 412 430 * We can only add back the initrd memory if we don't end up ··· 450 468 * pagetables with memblock. 451 469 */ 452 470 memblock_reserve(__pa_symbol(_text), _end - _text); 453 - #ifdef CONFIG_BLK_DEV_INITRD 454 - if (initrd_start) { 455 - memblock_reserve(initrd_start, initrd_end - initrd_start); 456 - 471 + if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) { 457 472 /* the generic initrd code expects virtual addresses */ 458 - initrd_start = __phys_to_virt(initrd_start); 459 - initrd_end = __phys_to_virt(initrd_end); 473 + initrd_start = __phys_to_virt(phys_initrd_start); 474 + initrd_end = initrd_start + phys_initrd_size; 460 475 } 461 - #endif 462 476 463 477 early_init_fdt_scan_reserved_mem(); 464 478
-2
arch/nds32/mm/init.c
··· 21 21 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 22 22 DEFINE_SPINLOCK(anon_alias_lock); 23 23 extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 24 - extern unsigned long phys_initrd_start; 25 - extern unsigned long phys_initrd_size; 26 24 27 25 /* 28 26 * empty_zero_page is a special page that is used for
+2
arch/powerpc/platforms/pseries/dlpar.c
··· 270 270 if (rc) 271 271 return rc; 272 272 273 + of_node_put(dn); 274 + 273 275 return 0; 274 276 } 275 277
+5 -19
arch/unicore32/mm/init.c
··· 30 30 31 31 #include "mm.h" 32 32 33 - static unsigned long phys_initrd_start __initdata = 0x01000000; 34 - static unsigned long phys_initrd_size __initdata = SZ_8M; 35 - 36 - static int __init early_initrd(char *p) 37 - { 38 - unsigned long start, size; 39 - char *endp; 40 - 41 - start = memparse(p, &endp); 42 - if (*endp == ',') { 43 - size = memparse(endp + 1, NULL); 44 - 45 - phys_initrd_start = start; 46 - phys_initrd_size = size; 47 - } 48 - return 0; 49 - } 50 - early_param("initrd", early_initrd); 51 - 52 33 /* 53 34 * This keeps memory configuration data used by a couple memory 54 35 * initialization functions, as well as show_mem() for the skipping ··· 137 156 memblock_reserve(__pa(_text), _end - _text); 138 157 139 158 #ifdef CONFIG_BLK_DEV_INITRD 159 + if (!phys_initrd_size) { 160 + phys_initrd_start = 0x01000000; 161 + phys_initrd_size = SZ_8M; 162 + } 163 + 140 164 if (phys_initrd_size) { 141 165 memblock_reserve(phys_initrd_start, phys_initrd_size); 142 166
+2 -2
drivers/irqchip/irq-gic-v3.c
··· 1199 1199 1200 1200 part->partition_id = of_node_to_fwnode(child_part); 1201 1201 1202 - pr_info("GIC: PPI partition %s[%d] { ", 1203 - child_part->name, part_idx); 1202 + pr_info("GIC: PPI partition %pOFn[%d] { ", 1203 + child_part, part_idx); 1204 1204 1205 1205 n = of_property_count_elems_of_size(child_part, "affinity", 1206 1206 sizeof(u32));
+11 -11
drivers/irqchip/irq-orion.c
··· 64 64 num_chips * ORION_IRQS_PER_CHIP, 65 65 &irq_generic_chip_ops, NULL); 66 66 if (!orion_irq_domain) 67 - panic("%s: unable to add irq domain\n", np->name); 67 + panic("%pOFn: unable to add irq domain\n", np); 68 68 69 69 ret = irq_alloc_domain_generic_chips(orion_irq_domain, 70 - ORION_IRQS_PER_CHIP, 1, np->name, 70 + ORION_IRQS_PER_CHIP, 1, np->full_name, 71 71 handle_level_irq, clr, 0, 72 72 IRQ_GC_INIT_MASK_CACHE); 73 73 if (ret) 74 - panic("%s: unable to alloc irq domain gc\n", np->name); 74 + panic("%pOFn: unable to alloc irq domain gc\n", np); 75 75 76 76 for (n = 0, base = 0; n < num_chips; n++, base += ORION_IRQS_PER_CHIP) { 77 77 struct irq_chip_generic *gc = ··· 80 80 of_address_to_resource(np, n, &r); 81 81 82 82 if (!request_mem_region(r.start, resource_size(&r), np->name)) 83 - panic("%s: unable to request mem region %d", 84 - np->name, n); 83 + panic("%pOFn: unable to request mem region %d", 84 + np, n); 85 85 86 86 gc->reg_base = ioremap(r.start, resource_size(&r)); 87 87 if (!gc->reg_base) 88 - panic("%s: unable to map resource %d", np->name, n); 88 + panic("%pOFn: unable to map resource %d", np, n); 89 89 90 90 gc->chip_types[0].regs.mask = ORION_IRQ_MASK; 91 91 gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; ··· 150 150 domain = irq_domain_add_linear(np, nrirqs, 151 151 &irq_generic_chip_ops, NULL); 152 152 if (!domain) { 153 - pr_err("%s: unable to add irq domain\n", np->name); 153 + pr_err("%pOFn: unable to add irq domain\n", np); 154 154 return -ENOMEM; 155 155 } 156 156 157 157 ret = irq_alloc_domain_generic_chips(domain, nrirqs, 1, np->name, 158 158 handle_edge_irq, clr, 0, IRQ_GC_INIT_MASK_CACHE); 159 159 if (ret) { 160 - pr_err("%s: unable to alloc irq domain gc\n", np->name); 160 + pr_err("%pOFn: unable to alloc irq domain gc\n", np); 161 161 return ret; 162 162 } 163 163 164 164 ret = of_address_to_resource(np, 0, &r); 165 165 if (ret) { 166 - pr_err("%s: unable to get resource\n", np->name); 166 + pr_err("%pOFn: unable to get resource\n", np); 167 167 return ret; 168 168 } 169 169 ··· 175 175 /* Map the parent interrupt for the chained handler */ 176 176 irq = irq_of_parse_and_map(np, 0); 177 177 if (irq <= 0) { 178 - pr_err("%s: unable to parse irq\n", np->name); 178 + pr_err("%pOFn: unable to parse irq\n", np); 179 179 return -EINVAL; 180 180 } 181 181 182 182 gc = irq_get_domain_generic_chip(domain, 0); 183 183 gc->reg_base = ioremap(r.start, resource_size(&r)); 184 184 if (!gc->reg_base) { 185 - pr_err("%s: unable to map resource\n", np->name); 185 + pr_err("%pOFn: unable to map resource\n", np); 186 186 return -ENOMEM; 187 187 } 188 188
+9 -9
drivers/irqchip/irq-tb10x.c
··· 115 115 void __iomem *reg_base; 116 116 117 117 if (of_address_to_resource(ictl, 0, &mem)) { 118 - pr_err("%s: No registers declared in DeviceTree.\n", 119 - ictl->name); 118 + pr_err("%pOFn: No registers declared in DeviceTree.\n", 119 + ictl); 120 120 return -EINVAL; 121 121 } 122 122 123 123 if (!request_mem_region(mem.start, resource_size(&mem), 124 - ictl->name)) { 125 - pr_err("%s: Request mem region failed.\n", ictl->name); 124 + ictl->full_name)) { 125 + pr_err("%pOFn: Request mem region failed.\n", ictl); 126 126 return -EBUSY; 127 127 } 128 128 129 129 reg_base = ioremap(mem.start, resource_size(&mem)); 130 130 if (!reg_base) { 131 131 ret = -EBUSY; 132 - pr_err("%s: ioremap failed.\n", ictl->name); 132 + pr_err("%pOFn: ioremap failed.\n", ictl); 133 133 goto ioremap_fail; 134 134 } 135 135 ··· 137 137 &irq_generic_chip_ops, NULL); 138 138 if (!domain) { 139 139 ret = -ENOMEM; 140 - pr_err("%s: Could not register interrupt domain.\n", 141 - ictl->name); 140 + pr_err("%pOFn: Could not register interrupt domain.\n", 141 + ictl); 142 142 goto irq_domain_add_fail; 143 143 } 144 144 ··· 147 147 IRQ_NOREQUEST, IRQ_NOPROBE, 148 148 IRQ_GC_INIT_MASK_CACHE); 149 149 if (ret) { 150 - pr_err("%s: Could not allocate generic interrupt chip.\n", 151 - ictl->name); 150 + pr_err("%pOFn: Could not allocate generic interrupt chip.\n", 151 + ictl); 152 152 goto gc_alloc_fail; 153 153 } 154 154
+7 -11
drivers/memory/omap-gpmc.c
··· 2146 2146 gpmc_s.device_width = GPMC_DEVWIDTH_16BIT; 2147 2147 break; 2148 2148 default: 2149 - dev_err(&pdev->dev, "%s: invalid 'nand-bus-width'\n", 2150 - child->name); 2149 + dev_err(&pdev->dev, "%pOFn: invalid 'nand-bus-width'\n", 2150 + child); 2151 2151 ret = -EINVAL; 2152 2152 goto err; 2153 2153 } ··· 2188 2188 2189 2189 ret = gpmc_cs_set_timings(cs, &gpmc_t, &gpmc_s); 2190 2190 if (ret) { 2191 - dev_err(&pdev->dev, "failed to set gpmc timings for: %s\n", 2192 - child->name); 2191 + dev_err(&pdev->dev, "failed to set gpmc timings for: %pOFn\n", 2192 + child); 2193 2193 goto err_cs; 2194 2194 } 2195 2195 ··· 2217 2217 2218 2218 err_child_fail: 2219 2219 2220 - dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name); 2220 + dev_err(&pdev->dev, "failed to create gpmc child %pOFn\n", child); 2221 2221 ret = -ENODEV; 2222 2222 2223 2223 err_cs: ··· 2267 2267 struct device_node *child; 2268 2268 2269 2269 for_each_available_child_of_node(pdev->dev.of_node, child) { 2270 - 2271 - if (!child->name) 2272 - continue; 2273 - 2274 2270 ret = gpmc_probe_generic_child(pdev, child); 2275 2271 if (ret) { 2276 - dev_err(&pdev->dev, "failed to probe DT child '%s': %d\n", 2277 - child->name, ret); 2272 + dev_err(&pdev->dev, "failed to probe DT child '%pOFn': %d\n", 2273 + child, ret); 2278 2274 } 2279 2275 } 2280 2276 }
+2 -2
drivers/memory/samsung/exynos-srom.c
··· 139 139 for_each_child_of_node(np, child) { 140 140 if (exynos_srom_configure_bank(srom, child)) { 141 141 dev_err(dev, 142 - "Could not decode bank configuration for %s\n", 143 - child->name); 142 + "Could not decode bank configuration for %pOFn\n", 143 + child); 144 144 bad_bank_config = true; 145 145 } 146 146 }
+3 -3
drivers/memory/tegra/mc.c
··· 345 345 err = of_property_read_u32(node, "clock-frequency", &tmp); 346 346 if (err) { 347 347 dev_err(mc->dev, 348 - "timing %s: failed to read rate\n", node->name); 348 + "timing %pOFn: failed to read rate\n", node); 349 349 return err; 350 350 } 351 351 ··· 360 360 mc->soc->num_emem_regs); 361 361 if (err) { 362 362 dev_err(mc->dev, 363 - "timing %s: failed to read EMEM configuration\n", 364 - node->name); 363 + "timing %pOFn: failed to read EMEM configuration\n", 364 + node); 365 365 return err; 366 366 } 367 367
+6 -6
drivers/memory/tegra/tegra124-emc.c
··· 888 888 889 889 err = of_property_read_u32(node, "clock-frequency", &value); 890 890 if (err) { 891 - dev_err(emc->dev, "timing %s: failed to read rate: %d\n", 892 - node->name, err); 891 + dev_err(emc->dev, "timing %pOFn: failed to read rate: %d\n", 892 + node, err); 893 893 return err; 894 894 } 895 895 ··· 900 900 ARRAY_SIZE(timing->emc_burst_data)); 901 901 if (err) { 902 902 dev_err(emc->dev, 903 - "timing %s: failed to read emc burst data: %d\n", 904 - node->name, err); 903 + "timing %pOFn: failed to read emc burst data: %d\n", 904 + node, err); 905 905 return err; 906 906 } 907 907 908 908 #define EMC_READ_PROP(prop, dtprop) { \ 909 909 err = of_property_read_u32(node, dtprop, &timing->prop); \ 910 910 if (err) { \ 911 - dev_err(emc->dev, "timing %s: failed to read " #prop ": %d\n", \ 912 - node->name, err); \ 911 + dev_err(emc->dev, "timing %pOFn: failed to read " #prop ": %d\n", \ 912 + node, err); \ 913 913 return err; \ 914 914 } \ 915 915 }
+1 -1
drivers/mtd/devices/powernv_flash.c
··· 212 212 * Going to have to check what details I need to set and how to 213 213 * get them 214 214 */ 215 - mtd->name = of_get_property(dev->of_node, "name", NULL); 215 + mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node); 216 216 mtd->type = MTD_NORFLASH; 217 217 mtd->flags = MTD_WRITEABLE; 218 218 mtd->size = size;
+3 -3
drivers/of/address.c
··· 110 110 * "vci" is for the /chaos bridge on 1st-gen PCI powermacs 111 111 * "ht" is hypertransport 112 112 */ 113 - return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") || 114 - !strcmp(np->type, "vci") || !strcmp(np->type, "ht"); 113 + return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") || 114 + of_node_is_type(np, "vci") || of_node_is_type(np, "ht"); 115 115 } 116 116 117 117 static void of_bus_pci_count_cells(struct device_node *np, ··· 371 371 372 372 static int of_bus_isa_match(struct device_node *np) 373 373 { 374 - return !strcmp(np->name, "isa"); 374 + return of_node_name_eq(np, "isa"); 375 375 } 376 376 377 377 static void of_bus_isa_count_cells(struct device_node *child,
+91 -35
drivers/of/base.c
··· 79 79 } 80 80 EXPORT_SYMBOL(of_node_name_prefix); 81 81 82 + static bool __of_node_is_type(const struct device_node *np, const char *type) 83 + { 84 + const char *match = __of_get_property(np, "device_type", NULL); 85 + 86 + return np && match && type && !strcmp(match, type); 87 + } 88 + 82 89 int of_n_addr_cells(struct device_node *np) 83 90 { 84 91 u32 cells; ··· 123 116 } 124 117 #endif 125 118 126 - static struct device_node **phandle_cache; 127 - static u32 phandle_cache_mask; 128 - 129 119 /* 130 120 * Assumptions behind phandle_cache implementation: 131 121 * - phandle property values are in a contiguous range of 1..n ··· 131 127 * - the phandle lookup overhead reduction provided by the cache 132 128 * will likely be less 133 129 */ 130 + 131 + static struct device_node **phandle_cache; 132 + static u32 phandle_cache_mask; 133 + 134 + /* 135 + * Caller must hold devtree_lock. 136 + */ 137 + static void __of_free_phandle_cache(void) 138 + { 139 + u32 cache_entries = phandle_cache_mask + 1; 140 + u32 k; 141 + 142 + if (!phandle_cache) 143 + return; 144 + 145 + for (k = 0; k < cache_entries; k++) 146 + of_node_put(phandle_cache[k]); 147 + 148 + kfree(phandle_cache); 149 + phandle_cache = NULL; 150 + } 151 + 152 + int of_free_phandle_cache(void) 153 + { 154 + unsigned long flags; 155 + 156 + raw_spin_lock_irqsave(&devtree_lock, flags); 157 + 158 + __of_free_phandle_cache(); 159 + 160 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 161 + 162 + return 0; 163 + } 164 + #if !defined(CONFIG_MODULES) 165 + late_initcall_sync(of_free_phandle_cache); 166 + #endif 167 + 168 + /* 169 + * Caller must hold devtree_lock. 170 + */ 171 + void __of_free_phandle_cache_entry(phandle handle) 172 + { 173 + phandle masked_handle; 174 + struct device_node *np; 175 + 176 + if (!handle) 177 + return; 178 + 179 + masked_handle = handle & phandle_cache_mask; 180 + 181 + if (phandle_cache) { 182 + np = phandle_cache[masked_handle]; 183 + if (np && handle == np->phandle) { 184 + of_node_put(np); 185 + phandle_cache[masked_handle] = NULL; 186 + } 187 + } 188 + } 189 + 134 190 void of_populate_phandle_cache(void) 135 191 { 136 192 unsigned long flags; ··· 200 136 201 137 raw_spin_lock_irqsave(&devtree_lock, flags); 202 138 203 - kfree(phandle_cache); 204 - phandle_cache = NULL; 139 + __of_free_phandle_cache(); 205 140 206 141 for_each_of_allnodes(np) 207 142 if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) ··· 218 155 goto out; 219 156 220 157 for_each_of_allnodes(np) 221 - if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) 158 + if (np->phandle && np->phandle != OF_PHANDLE_ILLEGAL) { 159 + of_node_get(np); 222 160 phandle_cache[np->phandle & phandle_cache_mask] = np; 161 + } 223 162 224 163 out: 225 164 raw_spin_unlock_irqrestore(&devtree_lock, flags); 226 165 } 227 - 228 - int of_free_phandle_cache(void) 229 - { 230 - unsigned long flags; 231 - 232 - raw_spin_lock_irqsave(&devtree_lock, flags); 233 - 234 - kfree(phandle_cache); 235 - phandle_cache = NULL; 236 - 237 - raw_spin_unlock_irqrestore(&devtree_lock, flags); 238 - 239 - return 0; 240 - } 241 - #if !defined(CONFIG_MODULES) 242 - late_initcall_sync(of_free_phandle_cache); 243 - #endif 244 166 245 167 void __init of_core_init(void) 246 168 { ··· 530 482 531 483 /* Matching type is better than matching name */ 532 484 if (type && type[0]) { 533 - if (!device->type || of_node_cmp(type, device->type)) 485 + if (!__of_node_is_type(device, type)) 534 486 return 0; 535 487 score += 2; 536 488 } 537 489 538 490 /* Matching name is a bit better than not */ 539 491 if (name && name[0]) { 540 - if (!device->name || of_node_cmp(name, device->name)) 492 + if (!of_node_name_eq(device, name)) 541 493 return 0; 542 494 score++; 543 495 } ··· 823 775 } 824 776 for (; next; next = next->sibling) { 825 777 if (!(of_node_name_eq(next, "cpu") || 826 - (next->type && !of_node_cmp(next->type, "cpu")))) 778 + __of_node_is_type(next, "cpu"))) 827 779 continue; 828 780 if (of_node_get(next)) 829 781 break; ··· 876 828 struct device_node *child; 877 829 878 830 for_each_child_of_node(node, child) 879 - if (child->name && (of_node_cmp(child->name, name) == 0)) 831 + if (of_node_name_eq(child, name)) 880 832 break; 881 833 return child; 882 834 } ··· 1002 954 1003 955 raw_spin_lock_irqsave(&devtree_lock, flags); 1004 956 for_each_of_allnodes_from(from, np) 1005 - if (np->name && (of_node_cmp(np->name, name) == 0) 1006 - && of_node_get(np)) 957 + if (of_node_name_eq(np, name) && of_node_get(np)) 1007 958 break; 1008 959 of_node_put(from); 1009 960 raw_spin_unlock_irqrestore(&devtree_lock, flags); ··· 1030 983 1031 984 raw_spin_lock_irqsave(&devtree_lock, flags); 1032 985 for_each_of_allnodes_from(from, np) 1033 - if (np->type && (of_node_cmp(np->type, type) == 0) 1034 - && of_node_get(np)) 986 + if (__of_node_is_type(np, type) && of_node_get(np)) 1035 987 break; 1036 988 of_node_put(from); 1037 989 raw_spin_unlock_irqrestore(&devtree_lock, flags); ··· 1236 1190 if (phandle_cache[masked_handle] && 1237 1191 handle == phandle_cache[masked_handle]->phandle) 1238 1192 np = phandle_cache[masked_handle]; 1193 + if (np && of_node_check_flag(np, OF_DETACHED)) { 1194 + WARN_ON(1); /* did not uncache np on node removal */ 1195 + of_node_put(np); 1196 + phandle_cache[masked_handle] = NULL; 1197 + np = NULL; 1198 + } 1239 1199 } 1240 1200 1241 1201 if (!np) { 1242 1202 for_each_of_allnodes(np) 1243 - if (np->phandle == handle) { 1244 - if (phandle_cache) 1203 + if (np->phandle == handle && 1204 + !of_node_check_flag(np, OF_DETACHED)) { 1205 + if (phandle_cache) { 1206 + /* will put when removed from cache */ 1207 + of_node_get(np); 1245 1208 phandle_cache[masked_handle] = np; 1209 + } 1246 1210 break; 1247 1211 } 1248 1212 } ··· 2164 2108 /* OF on pmac has nodes instead of properties named "l2-cache" 2165 2109 * beneath CPU nodes. 2166 2110 */ 2167 - if (IS_ENABLED(CONFIG_PPC_PMAC) && !strcmp(np->type, "cpu")) 2111 + if (IS_ENABLED(CONFIG_PPC_PMAC) && of_node_is_type(np, "cpu")) 2168 2112 for_each_child_of_node(np, child) 2169 - if (!strcmp(child->type, "cache")) 2113 + if (of_node_is_type(child, "cache")) 2170 2114 return child; 2171 2115 2172 2116 return NULL;
+5 -4
drivers/of/device.c
··· 211 211 /* Name & Type */ 212 212 /* %p eats all alphanum characters, so %c must be used here */ 213 213 csize = snprintf(str, len, "of:N%pOFn%c%s", dev->of_node, 'T', 214 - dev->of_node->type); 214 + of_node_get_device_type(dev->of_node)); 215 215 tsize = csize; 216 216 len -= csize; 217 217 if (str) ··· 281 281 */ 282 282 void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) 283 283 { 284 - const char *compat; 284 + const char *compat, *type; 285 285 struct alias_prop *app; 286 286 struct property *p; 287 287 int seen = 0; ··· 291 291 292 292 add_uevent_var(env, "OF_NAME=%pOFn", dev->of_node); 293 293 add_uevent_var(env, "OF_FULLNAME=%pOF", dev->of_node); 294 - if (dev->of_node->type && strcmp("<NULL>", dev->of_node->type) != 0) 295 - add_uevent_var(env, "OF_TYPE=%s", dev->of_node->type); 294 + type = of_node_get_device_type(dev->of_node); 295 + if (type) 296 + add_uevent_var(env, "OF_TYPE=%s", type); 296 297 297 298 /* Since the compatible field can contain pretty much anything 298 299 * it's not really legal to split it out with commas. We split it
+49 -11
drivers/of/dynamic.c
··· 205 205 const __be32 *phandle; 206 206 int sz; 207 207 208 - np->name = __of_get_property(np, "name", NULL) ? : "<NULL>"; 209 - np->type = __of_get_property(np, "device_type", NULL) ? : "<NULL>"; 208 + if (!of_node_check_flag(np, OF_OVERLAY)) { 209 + np->name = __of_get_property(np, "name", NULL); 210 + np->type = __of_get_property(np, "device_type", NULL); 211 + if (!np->name) 212 + np->name = "<NULL>"; 213 + if (!np->type) 214 + np->type = "<NULL>"; 210 215 211 - phandle = __of_get_property(np, "phandle", &sz); 212 - if (!phandle) 213 - phandle = __of_get_property(np, "linux,phandle", &sz); 214 - if (IS_ENABLED(CONFIG_PPC_PSERIES) && !phandle) 215 - phandle = __of_get_property(np, "ibm,phandle", &sz); 216 - np->phandle = (phandle && (sz >= 4)) ? be32_to_cpup(phandle) : 0; 216 + phandle = __of_get_property(np, "phandle", &sz); 217 + if (!phandle) 218 + phandle = __of_get_property(np, "linux,phandle", &sz); 219 + if (IS_ENABLED(CONFIG_PPC_PSERIES) && !phandle) 220 + phandle = __of_get_property(np, "ibm,phandle", &sz); 221 + if (phandle && (sz >= 4)) 222 + np->phandle = be32_to_cpup(phandle); 223 + else 224 + np->phandle = 0; 225 + } 217 226 218 227 np->child = NULL; 219 228 np->sibling = np->parent->child; ··· 277 268 } 278 269 279 270 of_node_set_flag(np, OF_DETACHED); 271 + 272 + /* race with of_find_node_by_phandle() prevented by devtree_lock */ 273 + __of_free_phandle_cache_entry(np->phandle); 280 274 } 281 275 282 276 /** 283 277 * of_detach_node() - "Unplug" a node from the device tree. 284 - * 285 - * The caller must hold a reference to the node. The memory associated with 286 - * the node is not freed until its refcount goes to zero. 287 278 */ 288 279 int of_detach_node(struct device_node *np) 289 280 { ··· 338 329 } 339 330 if (!of_node_check_flag(node, OF_DYNAMIC)) 340 331 return; 332 + 333 + if (of_node_check_flag(node, OF_OVERLAY)) { 334 + 335 + if (!of_node_check_flag(node, OF_OVERLAY_FREE_CSET)) { 336 + /* premature refcount of zero, do not free memory */ 337 + pr_err("ERROR: memory leak before free overlay changeset, %pOF\n", 338 + node); 339 + return; 340 + } 341 + 342 + /* 343 + * If node->properties non-empty then properties were added 344 + * to this node either by different overlay that has not 345 + * yet been removed, or by a non-overlay mechanism. 346 + */ 347 + if (node->properties) 348 + pr_err("ERROR: %s(), unexpected properties in %pOF\n", 349 + __func__, node); 350 + } 341 351 342 352 property_list_free(node->properties); 343 353 property_list_free(node->deadprops); ··· 462 434 463 435 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce) 464 436 { 437 + if (ce->action == OF_RECONFIG_ATTACH_NODE && 438 + of_node_check_flag(ce->np, OF_OVERLAY)) { 439 + if (kref_read(&ce->np->kobj.kref) > 1) { 440 + pr_err("ERROR: memory leak, expected refcount 1 instead of %d, of_node_get()/of_node_put() unbalanced - destroy cset entry: attach overlay node %pOF\n", 441 + kref_read(&ce->np->kobj.kref), ce->np); 442 + } else { 443 + of_node_set_flag(ce->np, OF_OVERLAY_FREE_CSET); 444 + } 445 + } 446 + 465 447 of_node_put(ce->np); 466 448 list_del(&ce->node); 467 449 kfree(ce);
+17 -6
drivers/of/fdt.c
··· 891 891 } 892 892 893 893 #ifdef CONFIG_BLK_DEV_INITRD 894 - #ifndef __early_init_dt_declare_initrd 895 894 static void __early_init_dt_declare_initrd(unsigned long start, 896 895 unsigned long end) 897 896 { 898 - initrd_start = (unsigned long)__va(start); 899 - initrd_end = (unsigned long)__va(end); 900 - initrd_below_start_ok = 1; 897 + /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is 898 + * enabled since __va() is called too early. ARM64 does make use 899 + * of phys_initrd_start/phys_initrd_size so we can skip this 900 + * conversion. 901 + */ 902 + if (!IS_ENABLED(CONFIG_ARM64)) { 903 + initrd_start = (unsigned long)__va(start); 904 + initrd_end = (unsigned long)__va(end); 905 + initrd_below_start_ok = 1; 906 + } 901 907 } 902 - #endif 903 908 904 909 /** 905 910 * early_init_dt_check_for_initrd - Decode initrd location from flat tree ··· 929 924 end = of_read_number(prop, len/4); 930 925 931 926 __early_init_dt_declare_initrd(start, end); 927 + phys_initrd_start = start; 928 + phys_initrd_size = end - start; 932 929 933 930 pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", 934 931 (unsigned long long)start, (unsigned long long)end); ··· 1207 1200 1208 1201 void __init early_init_dt_scan_nodes(void) 1209 1202 { 1203 + int rc = 0; 1204 + 1210 1205 /* Retrieve various information from the /chosen node */ 1211 - of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); 1206 + rc = of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); 1207 + if (!rc) 1208 + pr_warn("No chosen node found, continuing without\n"); 1212 1209 1213 1210 /* Initialize {size,address}-cells info */ 1214 1211 of_scan_flat_dt(early_init_dt_scan_root, NULL);
+3 -1
drivers/of/kobj.c
··· 133 133 } 134 134 if (!name) 135 135 return -ENOMEM; 136 + 137 + of_node_get(np); 138 + 136 139 rc = kobject_add(&np->kobj, parent, "%s", name); 137 140 kfree(name); 138 141 if (rc) ··· 162 159 kobject_del(&np->kobj); 163 160 } 164 161 165 - /* finally remove the kobj_init ref */ 166 162 of_node_put(np); 167 163 }
+4
drivers/of/of_private.h
··· 84 84 int of_resolve_phandles(struct device_node *tree); 85 85 #endif 86 86 87 + #if defined(CONFIG_OF_DYNAMIC) 88 + void __of_free_phandle_cache_entry(phandle handle); 89 + #endif 90 + 87 91 #if defined(CONFIG_OF_OVERLAY) 88 92 void of_overlay_mutex_lock(void); 89 93 void of_overlay_mutex_unlock(void);
+231 -61
drivers/of/overlay.c
··· 24 24 #include "of_private.h" 25 25 26 26 /** 27 + * struct target - info about current target node as recursing through overlay 28 + * @np: node where current level of overlay will be applied 29 + * @in_livetree: @np is a node in the live devicetree 30 + * 31 + * Used in the algorithm to create the portion of a changeset that describes 32 + * an overlay fragment, which is a devicetree subtree. Initially @np is a node 33 + * in the live devicetree where the overlay subtree is targeted to be grafted 34 + * into. When recursing to the next level of the overlay subtree, the target 35 + * also recurses to the next level of the live devicetree, as long as overlay 36 + * subtree node also exists in the live devicetree. When a node in the overlay 37 + * subtree does not exist at the same level in the live devicetree, target->np 38 + * points to a newly allocated node, and all subsequent targets in the subtree 39 + * will be newly allocated nodes. 40 + */ 41 + struct target { 42 + struct device_node *np; 43 + bool in_livetree; 44 + }; 45 + 46 + /** 27 47 * struct fragment - info about fragment nodes in overlay expanded device tree 28 48 * @target: target of the overlay operation 29 49 * @overlay: pointer to the __overlay__ node 30 50 */ 31 51 struct fragment { 32 - struct device_node *target; 33 52 struct device_node *overlay; 53 + struct device_node *target; 34 54 }; 35 55 36 56 /** ··· 92 72 } 93 73 94 74 static int build_changeset_next_level(struct overlay_changeset *ovcs, 95 - struct device_node *target_node, 96 - const struct device_node *overlay_node); 75 + struct target *target, const struct device_node *overlay_node); 97 76 98 77 /* 99 78 * of_resolve_phandles() finds the largest phandle in the live tree. ··· 276 257 /** 277 258 * add_changeset_property() - add @overlay_prop to overlay changeset 278 259 * @ovcs: overlay changeset 279 - * @target_node: where to place @overlay_prop in live tree 260 + * @target: where @overlay_prop will be placed 280 261 * @overlay_prop: property to add or update, from overlay tree 281 262 * @is_symbols_prop: 1 if @overlay_prop is from node "/__symbols__" 282 263 * 283 - * If @overlay_prop does not already exist in @target_node, add changeset entry 284 - * to add @overlay_prop in @target_node, else add changeset entry to update 264 + * If @overlay_prop does not already exist in live devicetree, add changeset 265 + * entry to add @overlay_prop in @target, else add changeset entry to update 285 266 * value of @overlay_prop. 286 267 * 287 - * Some special properties are not updated (no error returned). 268 + * @target may be either in the live devicetree or in a new subtree that 269 + * is contained in the changeset. 270 + * 271 + * Some special properties are not added or updated (no error returned): 272 + * "name", "phandle", "linux,phandle". 273 + * 274 + * Properties "#address-cells" and "#size-cells" are not updated if they 275 + * are already in the live tree, but if present in the live tree, the values 276 + * in the overlay must match the values in the live tree. 288 277 * 289 278 * Update of property in symbols node is not allowed. 290 279 * ··· 300 273 * invalid @overlay. 301 274 */ 302 275 static int add_changeset_property(struct overlay_changeset *ovcs, 303 - struct device_node *target_node, 304 - struct property *overlay_prop, 276 + struct target *target, struct property *overlay_prop, 305 277 bool is_symbols_prop) 306 278 { 307 279 struct property *new_prop = NULL, *prop; 308 280 int ret = 0; 281 + bool check_for_non_overlay_node = false; 309 282 310 - prop = of_find_property(target_node, overlay_prop->name, NULL); 283 + if (target->in_livetree) 284 + if (!of_prop_cmp(overlay_prop->name, "name") || 285 + !of_prop_cmp(overlay_prop->name, "phandle") || 286 + !of_prop_cmp(overlay_prop->name, "linux,phandle")) 287 + return 0; 311 288 312 - if (!of_prop_cmp(overlay_prop->name, "name") || 313 - !of_prop_cmp(overlay_prop->name, "phandle") || 314 - !of_prop_cmp(overlay_prop->name, "linux,phandle")) 315 - return 0; 289 + if (target->in_livetree) 290 + prop = of_find_property(target->np, overlay_prop->name, NULL); 291 + else 292 + prop = NULL; 316 293 317 294 if (is_symbols_prop) { 318 295 if (prop) ··· 329 298 if (!new_prop) 330 299 return -ENOMEM; 331 300 332 - if (!prop) 333 - ret = of_changeset_add_property(&ovcs->cset, target_node, 301 + if (!prop) { 302 + check_for_non_overlay_node = true; 303 + if (!target->in_livetree) { 304 + new_prop->next = target->np->deadprops; 305 + target->np->deadprops = new_prop; 306 + } 307 + ret = of_changeset_add_property(&ovcs->cset, target->np, 334 308 new_prop); 335 - else 336 - ret = of_changeset_update_property(&ovcs->cset, target_node, 309 + } else if (!of_prop_cmp(prop->name, "#address-cells")) { 310 + if (!of_prop_val_eq(prop, new_prop)) { 311 + pr_err("ERROR: changing value of #address-cells is not allowed in %pOF\n", 312 + target->np); 313 + ret = -EINVAL; 314 + } 315 + } else if (!of_prop_cmp(prop->name, "#size-cells")) { 316 + if (!of_prop_val_eq(prop, new_prop)) { 317 + pr_err("ERROR: changing value of #size-cells is not allowed in %pOF\n", 318 + target->np); 319 + ret = -EINVAL; 320 + } 321 + } else { 322 + check_for_non_overlay_node = true; 323 + ret = of_changeset_update_property(&ovcs->cset, target->np, 337 324 new_prop); 325 + } 326 + 327 + if (check_for_non_overlay_node && 328 + !of_node_check_flag(target->np, OF_OVERLAY)) 329 + pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n", 330 + target->np, new_prop->name); 338 331 339 332 if (ret) { 340 333 kfree(new_prop->name); ··· 370 315 371 316 /** 372 317 * add_changeset_node() - add @node (and children) to overlay changeset 373 - * @ovcs: overlay changeset 374 - * @target_node: where to place @node in live tree 375 - * @node: node from within overlay device tree fragment 318 + * @ovcs: overlay changeset 319 + * @target: where @node will be placed in live tree or changeset 320 + * @node: node from within overlay device tree fragment 376 321 * 377 - * If @node does not already exist in @target_node, add changeset entry 378 - * to add @node in @target_node. 322 + * If @node does not already exist in @target, add changeset entry 323 + * to add @node in @target. 379 324 * 380 - * If @node already exists in @target_node, and the existing node has 325 + * If @node already exists in @target, and the existing node has 381 326 * a phandle, the overlay node is not allowed to have a phandle. 382 327 * 383 328 * If @node has child nodes, add the children recursively via ··· 397 342 * a live devicetree created from Open Firmware. 398 343 * 399 344 * NOTE_2: Multiple mods of created nodes not supported. 400 - * If more than one fragment contains a node that does not already exist 401 - * in the live tree, then for each fragment of_changeset_attach_node() 402 - * will add a changeset entry to add the node. When the changeset is 403 - * applied, __of_attach_node() will attach the node twice (once for 404 - * each fragment). At this point the device tree will be corrupted. 405 - * 406 - * TODO: add integrity check to ensure that multiple fragments do not 407 - * create the same node. 408 345 * 409 346 * Returns 0 on success, -ENOMEM if memory allocation failure, or -EINVAL if 410 347 * invalid @overlay. 411 348 */ 412 349 static int add_changeset_node(struct overlay_changeset *ovcs, 413 - struct device_node *target_node, struct device_node *node) 350 + struct target *target, struct device_node *node) 414 351 { 415 352 const char *node_kbasename; 353 + const __be32 *phandle; 416 354 struct device_node *tchild; 417 - int ret = 0; 355 + struct target target_child; 356 + int ret = 0, size; 418 357 419 358 node_kbasename = kbasename(node->full_name); 420 359 421 - for_each_child_of_node(target_node, tchild) 360 + for_each_child_of_node(target->np, tchild) 422 361 if (!of_node_cmp(node_kbasename, kbasename(tchild->full_name))) 423 362 break; 424 363 425 364 if (!tchild) { 426 - tchild = __of_node_dup(node, node_kbasename); 365 + tchild = __of_node_dup(NULL, node_kbasename); 427 366 if (!tchild) 428 367 return -ENOMEM; 429 368 430 - tchild->parent = target_node; 369 + tchild->parent = target->np; 370 + tchild->name = __of_get_property(node, "name", NULL); 371 + tchild->type = __of_get_property(node, "device_type", NULL); 372 + 373 + if (!tchild->name) 374 + tchild->name = "<NULL>"; 375 + if (!tchild->type) 376 + tchild->type = "<NULL>"; 377 + 378 + /* ignore obsolete "linux,phandle" */ 379 + phandle = __of_get_property(node, "phandle", &size); 380 + if (phandle && (size == 4)) 381 + tchild->phandle = be32_to_cpup(phandle); 382 + 383 + of_node_set_flag(tchild, OF_OVERLAY); 431 384 432 385 ret = of_changeset_attach_node(&ovcs->cset, tchild); 433 386 if (ret) 434 387 return ret; 435 388 436 - return build_changeset_next_level(ovcs, tchild, node); 389 + target_child.np = tchild; 390 + target_child.in_livetree = false; 391 + 392 + ret = build_changeset_next_level(ovcs, &target_child, node); 393 + of_node_put(tchild); 394 + return ret; 437 395 } 438 396 439 - if (node->phandle && tchild->phandle) 397 + if (node->phandle && tchild->phandle) { 440 398 ret = -EINVAL; 441 - else 442 - ret = build_changeset_next_level(ovcs, tchild, node); 399 + } else { 400 + target_child.np = tchild; 401 + target_child.in_livetree = target->in_livetree; 402 + ret = build_changeset_next_level(ovcs, &target_child, node); 403 + } 443 404 of_node_put(tchild); 444 405 445 406 return ret; ··· 464 393 /** 465 394 * build_changeset_next_level() - add level of overlay changeset 466 395 * @ovcs: overlay changeset 467 - * @target_node: where to place @overlay_node in live tree 396 + * @target: where to place @overlay_node in live tree 468 397 * @overlay_node: node from within an overlay device tree fragment 469 398 * 470 399 * Add the properties (if any) and nodes (if any) from @overlay_node to the ··· 477 406 * invalid @overlay_node. 478 407 */ 479 408 static int build_changeset_next_level(struct overlay_changeset *ovcs, 480 - struct device_node *target_node, 481 - const struct device_node *overlay_node) 409 + struct target *target, const struct device_node *overlay_node) 482 410 { 483 411 struct device_node *child; 484 412 struct property *prop; 485 413 int ret; 486 414 487 415 for_each_property_of_node(overlay_node, prop) { 488 - ret = add_changeset_property(ovcs, target_node, prop, 0); 416 + ret = add_changeset_property(ovcs, target, prop, 0); 489 417 if (ret) { 490 418 pr_debug("Failed to apply prop @%pOF/%s, err=%d\n", 491 - target_node, prop->name, ret); 419 + target->np, prop->name, ret); 492 420 return ret; 493 421 } 494 422 } 495 423 496 424 for_each_child_of_node(overlay_node, child) { 497 - ret = add_changeset_node(ovcs, target_node, child); 425 + ret = add_changeset_node(ovcs, target, child); 498 426 if (ret) { 499 427 pr_debug("Failed to apply node @%pOF/%pOFn, err=%d\n", 500 - target_node, child, ret); 428 + target->np, child, ret); 501 429 of_node_put(child); 502 430 return ret; 503 431 } ··· 509 439 * Add the properties from __overlay__ node to the @ovcs->cset changeset. 510 440 */ 511 441 static int build_changeset_symbols_node(struct overlay_changeset *ovcs, 512 - struct device_node *target_node, 442 + struct target *target, 513 443 const struct device_node *overlay_symbols_node) 514 444 { 515 445 struct property *prop; 516 446 int ret; 517 447 518 448 for_each_property_of_node(overlay_symbols_node, prop) { 519 - ret = add_changeset_property(ovcs, target_node, prop, 1); 449 + ret = add_changeset_property(ovcs, target, prop, 1); 520 450 if (ret) { 521 - pr_debug("Failed to apply prop @%pOF/%s, err=%d\n", 522 - target_node, prop->name, ret); 451 + pr_debug("Failed to apply symbols prop @%pOF/%s, err=%d\n", 452 + target->np, prop->name, ret); 523 453 return ret; 524 454 } 525 455 } 526 456 527 457 return 0; 458 + } 459 + 460 + static int find_dup_cset_node_entry(struct overlay_changeset *ovcs, 461 + struct of_changeset_entry *ce_1) 462 + { 463 + struct of_changeset_entry *ce_2; 464 + char *fn_1, *fn_2; 465 + int node_path_match; 466 + 467 + if (ce_1->action != OF_RECONFIG_ATTACH_NODE && 468 + ce_1->action != OF_RECONFIG_DETACH_NODE) 469 + return 0; 470 + 471 + ce_2 = ce_1; 472 + list_for_each_entry_continue(ce_2, &ovcs->cset.entries, node) { 473 + if ((ce_2->action != OF_RECONFIG_ATTACH_NODE && 474 + ce_2->action != OF_RECONFIG_DETACH_NODE) || 475 + of_node_cmp(ce_1->np->full_name, ce_2->np->full_name)) 476 + continue; 477 + 478 + fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); 479 + fn_2 = kasprintf(GFP_KERNEL, "%pOF", ce_2->np); 480 + node_path_match = !strcmp(fn_1, fn_2); 481 + kfree(fn_1); 482 + kfree(fn_2); 483 + if (node_path_match) { 484 + pr_err("ERROR: multiple fragments add and/or delete node %pOF\n", 485 + ce_1->np); 486 + return -EINVAL; 487 + } 488 + } 489 + 490 + return 0; 491 + } 492 + 493 + static int find_dup_cset_prop(struct overlay_changeset *ovcs, 494 + struct of_changeset_entry *ce_1) 495 + { 496 + struct of_changeset_entry *ce_2; 497 + char *fn_1, *fn_2; 498 + int node_path_match; 499 + 500 + if (ce_1->action != OF_RECONFIG_ADD_PROPERTY && 501 + ce_1->action != OF_RECONFIG_REMOVE_PROPERTY && 502 + ce_1->action != OF_RECONFIG_UPDATE_PROPERTY) 503 + return 0; 504 + 505 + ce_2 = ce_1; 506 + list_for_each_entry_continue(ce_2, &ovcs->cset.entries, node) { 507 + if ((ce_2->action != OF_RECONFIG_ADD_PROPERTY && 508 + ce_2->action != OF_RECONFIG_REMOVE_PROPERTY && 509 + ce_2->action != OF_RECONFIG_UPDATE_PROPERTY) || 510 + of_node_cmp(ce_1->np->full_name, ce_2->np->full_name)) 511 + continue; 512 + 513 + fn_1 = kasprintf(GFP_KERNEL, "%pOF", ce_1->np); 514 + fn_2 = kasprintf(GFP_KERNEL, "%pOF", ce_2->np); 515 + node_path_match = !strcmp(fn_1, fn_2); 516 + kfree(fn_1); 517 + kfree(fn_2); 518 + if (node_path_match && 519 + !of_prop_cmp(ce_1->prop->name, ce_2->prop->name)) { 520 + pr_err("ERROR: multiple fragments add, update, and/or delete property %pOF/%s\n", 521 + ce_1->np, ce_1->prop->name); 522 + return -EINVAL; 523 + } 524 + } 525 + 526 + return 0; 527 + } 528 + 529 + /** 530 + * changeset_dup_entry_check() - check for duplicate entries 531 + * @ovcs: Overlay changeset 532 + * 533 + * Check changeset @ovcs->cset for multiple {add or delete} node entries for 534 + * the same node or duplicate {add, delete, or update} properties entries 535 + * for the same property. 536 + * 537 + * Returns 0 on success, or -EINVAL if duplicate changeset entry found. 538 + */ 539 + static int changeset_dup_entry_check(struct overlay_changeset *ovcs) 540 + { 541 + struct of_changeset_entry *ce_1; 542 + int dup_entry = 0; 543 + 544 + list_for_each_entry(ce_1, &ovcs->cset.entries, node) { 545 + dup_entry |= find_dup_cset_node_entry(ovcs, ce_1); 546 + dup_entry |= find_dup_cset_prop(ovcs, ce_1); 547 + } 548 + 549 + return dup_entry ? -EINVAL : 0; 528 550 } 529 551 530 552 /** ··· 634 472 static int build_changeset(struct overlay_changeset *ovcs) 635 473 { 636 474 struct fragment *fragment; 475 + struct target target; 637 476 int fragments_count, i, ret; 638 477 639 478 /* ··· 649 486 for (i = 0; i < fragments_count; i++) { 650 487 fragment = &ovcs->fragments[i]; 651 488 652 - ret = build_changeset_next_level(ovcs, fragment->target, 489 + target.np = fragment->target; 490 + target.in_livetree = true; 491 + ret = build_changeset_next_level(ovcs, &target, 653 492 fragment->overlay); 654 493 if (ret) { 655 - pr_debug("apply failed '%pOF'\n", fragment->target); 494 + pr_debug("fragment apply failed '%pOF'\n", 495 + fragment->target); 656 496 return ret; 657 497 } 658 498 } 659 499 660 500 if (ovcs->symbols_fragment) { 661 501 fragment = &ovcs->fragments[ovcs->count - 1]; 662 - ret = build_changeset_symbols_node(ovcs, fragment->target, 502 + 503 + target.np = fragment->target; 504 + target.in_livetree = true; 505 + ret = build_changeset_symbols_node(ovcs, &target, 663 506 fragment->overlay); 664 507 if (ret) { 665 - pr_debug("apply failed '%pOF'\n", fragment->target); 508 + pr_debug("symbols fragment apply failed '%pOF'\n", 509 + fragment->target); 666 510 return ret; 667 511 } 668 512 } 669 513 670 - return 0; 514 + return changeset_dup_entry_check(ovcs); 671 515 } 672 516 673 517 /* ··· 684 514 * 1) "target" property containing the phandle of the target 685 515 * 2) "target-path" property containing the path of the target 686 516 */ 687 - static struct device_node *find_target_node(struct device_node *info_node) 517 + static struct device_node *find_target(struct device_node *info_node) 688 518 { 689 519 struct device_node *node; 690 520 const char *path; ··· 790 620 791 621 fragment = &fragments[cnt]; 792 622 fragment->overlay = overlay_node; 793 - fragment->target = find_target_node(node); 623 + fragment->target = find_target(node); 794 624 if (!fragment->target) { 795 625 of_node_put(fragment->overlay); 796 626 ret = -EINVAL; ··· 978 808 979 809 ret = __of_changeset_apply_notify(&ovcs->cset); 980 810 if (ret) 981 - pr_err("overlay changeset entry notify error %d\n", ret); 811 + pr_err("overlay apply changeset entry notify error %d\n", ret); 982 812 /* notify failure is not fatal, continue */ 983 813 984 814 list_add_tail(&ovcs->ovcs_list, &ovcs_list); ··· 1237 1067 1238 1068 ret = __of_changeset_revert_notify(&ovcs->cset); 1239 1069 if (ret) 1240 - pr_err("overlay changeset entry notify error %d\n", ret); 1070 + pr_err("overlay remove changeset entry notify error %d\n", ret); 1241 1071 /* notify failure is not fatal, continue */ 1242 1072 1243 1073 *ovcs_id = 0;
-5
drivers/of/pdt.c
··· 21 21 22 22 static struct of_pdt_ops *of_pdt_prom_ops __initdata; 23 23 24 - void __initdata (*of_pdt_build_more)(struct device_node *dp); 25 - 26 24 #if defined(CONFIG_SPARC) 27 25 unsigned int of_pdt_unique_id __initdata; 28 26 ··· 186 188 prev_sibling = dp; 187 189 188 190 dp->child = of_pdt_build_tree(dp, of_pdt_prom_ops->getchild(node)); 189 - 190 - if (of_pdt_build_more) 191 - of_pdt_build_more(dp); 192 191 193 192 node = of_pdt_prom_ops->getsibling(node); 194 193 }
+5 -5
drivers/of/property.c
··· 571 571 for_each_child_of_node(parent, port) { 572 572 u32 port_id = 0; 573 573 574 - if (of_node_cmp(port->name, "port") != 0) 574 + if (!of_node_name_eq(port, "port")) 575 575 continue; 576 576 of_property_read_u32(port, "reg", &port_id); 577 577 if (id == port_id) ··· 646 646 port = of_get_next_child(parent, port); 647 647 if (!port) 648 648 return NULL; 649 - } while (of_node_cmp(port->name, "port")); 649 + } while (!of_node_name_eq(port, "port")); 650 650 } 651 651 } 652 652 EXPORT_SYMBOL(of_graph_get_next_endpoint); ··· 715 715 /* Walk 3 levels up only if there is 'ports' node. */ 716 716 for (depth = 3; depth && node; depth--) { 717 717 node = of_get_next_parent(node); 718 - if (depth == 2 && of_node_cmp(node->name, "ports")) 718 + if (depth == 2 && !of_node_name_eq(node, "ports")) 719 719 break; 720 720 } 721 721 return node; ··· 893 893 struct device_node *child; 894 894 895 895 for_each_available_child_of_node(node, child) 896 - if (!of_node_cmp(child->name, childname)) 896 + if (of_node_name_eq(child, childname)) 897 897 return of_fwnode_handle(child); 898 898 899 899 return NULL; ··· 955 955 return NULL; 956 956 957 957 /* Is this the "ports" node? If not, it's the port parent. */ 958 - if (of_node_cmp(np->name, "ports")) 958 + if (!of_node_name_eq(np, "ports")) 959 959 return of_fwnode_handle(np); 960 960 961 961 return of_fwnode_handle(of_get_next_parent(np));
+2 -2
drivers/of/resolver.c
··· 281 281 adjust_overlay_phandles(overlay, phandle_delta); 282 282 283 283 for_each_child_of_node(overlay, local_fixups) 284 - if (!of_node_cmp(local_fixups->name, "__local_fixups__")) 284 + if (of_node_name_eq(local_fixups, "__local_fixups__")) 285 285 break; 286 286 287 287 err = adjust_local_phandle_references(local_fixups, overlay, phandle_delta); ··· 291 291 overlay_fixups = NULL; 292 292 293 293 for_each_child_of_node(overlay, child) { 294 - if (!of_node_cmp(child->name, "__fixups__")) 294 + if (of_node_name_eq(child, "__fixups__")) 295 295 overlay_fixups = child; 296 296 } 297 297
+2
drivers/of/unittest-data/Makefile
··· 17 17 overlay_12.dtb.o \ 18 18 overlay_13.dtb.o \ 19 19 overlay_15.dtb.o \ 20 + overlay_bad_add_dup_node.dtb.o \ 21 + overlay_bad_add_dup_prop.dtb.o \ 20 22 overlay_bad_phandle.dtb.o \ 21 23 overlay_bad_symbol.dtb.o \ 22 24 overlay_base.dtb.o
+28
drivers/of/unittest-data/overlay_bad_add_dup_node.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /dts-v1/; 3 + /plugin/; 4 + 5 + /* 6 + * &electric_1/motor-1 and &spin_ctrl_1 are the same node: 7 + * /testcase-data-2/substation@100/motor-1 8 + * 9 + * Thus the new node "controller" in each fragment will 10 + * result in an attempt to add the same node twice. 11 + * This will result in an error and the overlay apply 12 + * will fail. 13 + */ 14 + 15 + &electric_1 { 16 + 17 + motor-1 { 18 + controller { 19 + power_bus = < 0x1 0x2 >; 20 + }; 21 + }; 22 + }; 23 + 24 + &spin_ctrl_1 { 25 + controller { 26 + power_bus_emergency = < 0x101 0x102 >; 27 + }; 28 + };
+24
drivers/of/unittest-data/overlay_bad_add_dup_prop.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /dts-v1/; 3 + /plugin/; 4 + 5 + /* 6 + * &electric_1/motor-1 and &spin_ctrl_1 are the same node: 7 + * /testcase-data-2/substation@100/motor-1 8 + * 9 + * Thus the property "rpm_avail" in each fragment will 10 + * result in an attempt to update the same property twice. 11 + * This will result in an error and the overlay apply 12 + * will fail. 13 + */ 14 + 15 + &electric_1 { 16 + 17 + motor-1 { 18 + rpm_avail = < 100 >; 19 + }; 20 + }; 21 + 22 + &spin_ctrl_1 { 23 + rpm_avail = < 100 200 >; 24 + };
+1
drivers/of/unittest-data/overlay_base.dts
··· 30 30 spin_ctrl_1: motor-1 { 31 31 compatible = "ot,ferris-wheel-motor"; 32 32 spin = "clockwise"; 33 + rpm_avail = < 50 >; 33 34 }; 34 35 35 36 spin_ctrl_2: motor-8 {
+80 -20
drivers/of/unittest.c
··· 379 379 for (i = 0; i < 8; i++) { 380 380 bool passed = true; 381 381 382 + memset(&args, 0, sizeof(args)); 382 383 rc = of_parse_phandle_with_args(np, "phandle-list", 383 384 "#phandle-cells", i, &args); 384 385 ··· 433 432 } 434 433 435 434 /* Check for missing list property */ 435 + memset(&args, 0, sizeof(args)); 436 436 rc = of_parse_phandle_with_args(np, "phandle-list-missing", 437 437 "#phandle-cells", 0, &args); 438 438 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); ··· 442 440 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); 443 441 444 442 /* Check for missing cells property */ 443 + memset(&args, 0, sizeof(args)); 445 444 rc = of_parse_phandle_with_args(np, "phandle-list", 446 445 "#phandle-cells-missing", 0, &args); 447 446 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); ··· 451 448 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 452 449 453 450 /* Check for bad phandle in list */ 451 + memset(&args, 0, sizeof(args)); 454 452 rc = of_parse_phandle_with_args(np, "phandle-list-bad-phandle", 455 453 "#phandle-cells", 0, &args); 456 454 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); ··· 460 456 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 461 457 462 458 /* Check for incorrectly formed argument list */ 459 + memset(&args, 0, sizeof(args)); 463 460 rc = of_parse_phandle_with_args(np, "phandle-list-bad-args", 464 461 "#phandle-cells", 1, &args); 465 462 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); ··· 511 506 for (i = 0; i < 8; i++) { 512 507 bool passed = true; 513 508 509 + memset(&args, 0, sizeof(args)); 514 510 rc = of_parse_phandle_with_args_map(np, "phandle-list", 515 511 "phandle", i, &args); 516 512 ··· 569 563 } 570 564 571 565 /* Check for missing list property */ 566 + memset(&args, 0, sizeof(args)); 572 567 rc = of_parse_phandle_with_args_map(np, "phandle-list-missing", 573 568 "phandle", 0, &args); 574 569 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); 575 570 576 571 /* Check for missing cells,map,mask property */ 572 + memset(&args, 0, sizeof(args)); 577 573 rc = of_parse_phandle_with_args_map(np, "phandle-list", 578 574 "phandle-missing", 0, &args); 579 575 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 580 576 581 577 /* Check for bad phandle in list */ 578 + memset(&args, 0, sizeof(args)); 582 579 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle", 583 580 "phandle", 0, &args); 584 581 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 585 582 586 583 /* Check for incorrectly formed argument list */ 584 + memset(&args, 0, sizeof(args)); 587 585 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args", 588 586 "phandle", 1, &args); 589 587 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); ··· 797 787 for (i = 0; i < 4; i++) { 798 788 bool passed = true; 799 789 800 - args.args_count = 0; 790 + memset(&args, 0, sizeof(args)); 801 791 rc = of_irq_parse_one(np, i, &args); 802 792 803 793 passed &= !rc; ··· 818 808 for (i = 0; i < 4; i++) { 819 809 bool passed = true; 820 810 821 - args.args_count = 0; 811 + memset(&args, 0, sizeof(args)); 822 812 rc = of_irq_parse_one(np, i, &args); 823 813 824 814 /* Test the values from tests-phandle.dtsi */ ··· 874 864 for (i = 0; i < 7; i++) { 875 865 bool passed = true; 876 866 867 + memset(&args, 0, sizeof(args)); 877 868 rc = of_irq_parse_one(np, i, &args); 878 869 879 870 /* Test the values from tests-phandle.dtsi */ ··· 1082 1071 * of np into dup node (present in live tree) and 1083 1072 * updates parent of children of np to dup. 1084 1073 * 1085 - * @np: node already present in live tree 1074 + * @np: node whose properties are being added to the live tree 1086 1075 * @dup: node present in live tree to be updated 1087 1076 */ 1088 1077 static void update_node_properties(struct device_node *np, 1089 1078 struct device_node *dup) 1090 1079 { 1091 1080 struct property *prop; 1081 + struct property *save_next; 1092 1082 struct device_node *child; 1093 - 1094 - for_each_property_of_node(np, prop) 1095 - of_add_property(dup, prop); 1083 + int ret; 1096 1084 1097 1085 for_each_child_of_node(np, child) 1098 1086 child->parent = dup; 1087 + 1088 + /* 1089 + * "unittest internal error: unable to add testdata property" 1090 + * 1091 + * If this message reports a property in node '/__symbols__' then 1092 + * the respective unittest overlay contains a label that has the 1093 + * same name as a label in the live devicetree. The label will 1094 + * be in the live devicetree only if the devicetree source was 1095 + * compiled with the '-@' option. If you encounter this error, 1096 + * please consider renaming __all__ of the labels in the unittest 1097 + * overlay dts files with an odd prefix that is unlikely to be 1098 + * used in a real devicetree. 1099 + */ 1100 + 1101 + /* 1102 + * open code for_each_property_of_node() because of_add_property() 1103 + * sets prop->next to NULL 1104 + */ 1105 + for (prop = np->properties; prop != NULL; prop = save_next) { 1106 + save_next = prop->next; 1107 + ret = of_add_property(dup, prop); 1108 + if (ret) 1109 + pr_err("unittest internal error: unable to add testdata property %pOF/%s", 1110 + np, prop->name); 1111 + } 1099 1112 } 1100 1113 1101 1114 /** ··· 1128 1093 * 1129 1094 * @np: Node to attach to live tree 1130 1095 */ 1131 - static int attach_node_and_children(struct device_node *np) 1096 + static void attach_node_and_children(struct device_node *np) 1132 1097 { 1133 1098 struct device_node *next, *dup, *child; 1134 1099 unsigned long flags; 1135 1100 const char *full_name; 1136 1101 1137 1102 full_name = kasprintf(GFP_KERNEL, "%pOF", np); 1103 + 1104 + if (!strcmp(full_name, "/__local_fixups__") || 1105 + !strcmp(full_name, "/__fixups__")) 1106 + return; 1107 + 1138 1108 dup = of_find_node_by_path(full_name); 1139 1109 kfree(full_name); 1140 1110 if (dup) { 1141 1111 update_node_properties(np, dup); 1142 - return 0; 1112 + return; 1143 1113 } 1144 1114 1145 1115 child = np->child; ··· 1165 1125 attach_node_and_children(child); 1166 1126 child = next; 1167 1127 } 1168 - 1169 - return 0; 1170 1128 } 1171 1129 1172 1130 /** ··· 1471 1433 } while (defers > 0); 1472 1434 } 1473 1435 1474 - static int __init of_unittest_apply_overlay(int overlay_nr, int unittest_nr, 1475 - int *overlay_id) 1436 + static int __init of_unittest_apply_overlay(int overlay_nr, int *overlay_id) 1476 1437 { 1477 1438 const char *overlay_name; 1478 1439 ··· 1504 1467 } 1505 1468 1506 1469 ovcs_id = 0; 1507 - ret = of_unittest_apply_overlay(overlay_nr, unittest_nr, &ovcs_id); 1470 + ret = of_unittest_apply_overlay(overlay_nr, &ovcs_id); 1508 1471 if (ret != 0) { 1509 1472 /* of_unittest_apply_overlay already called unittest() */ 1510 1473 return ret; ··· 1540 1503 1541 1504 /* apply the overlay */ 1542 1505 ovcs_id = 0; 1543 - ret = of_unittest_apply_overlay(overlay_nr, unittest_nr, &ovcs_id); 1506 + ret = of_unittest_apply_overlay(overlay_nr, &ovcs_id); 1544 1507 if (ret != 0) { 1545 1508 /* of_unittest_apply_overlay already called unittest() */ 1546 1509 return ret; ··· 2198 2161 OVERLAY_INFO_EXTERN(overlay_12); 2199 2162 OVERLAY_INFO_EXTERN(overlay_13); 2200 2163 OVERLAY_INFO_EXTERN(overlay_15); 2164 + OVERLAY_INFO_EXTERN(overlay_bad_add_dup_node); 2165 + OVERLAY_INFO_EXTERN(overlay_bad_add_dup_prop); 2201 2166 OVERLAY_INFO_EXTERN(overlay_bad_phandle); 2202 2167 OVERLAY_INFO_EXTERN(overlay_bad_symbol); 2203 2168 2204 - /* order of entries is hard-coded into users of overlays[] */ 2169 + /* entries found by name */ 2205 2170 static struct overlay_info overlays[] = { 2206 2171 OVERLAY_INFO(overlay_base, -9999), 2207 2172 OVERLAY_INFO(overlay, 0), ··· 2222 2183 OVERLAY_INFO(overlay_12, 0), 2223 2184 OVERLAY_INFO(overlay_13, 0), 2224 2185 OVERLAY_INFO(overlay_15, 0), 2186 + OVERLAY_INFO(overlay_bad_add_dup_node, -EINVAL), 2187 + OVERLAY_INFO(overlay_bad_add_dup_prop, -EINVAL), 2225 2188 OVERLAY_INFO(overlay_bad_phandle, -EINVAL), 2226 2189 OVERLAY_INFO(overlay_bad_symbol, -EINVAL), 2227 - {} 2190 + /* end marker */ 2191 + {.dtb_begin = NULL, .dtb_end = NULL, .expected_result = 0, .name = NULL} 2228 2192 }; 2229 2193 2230 2194 static struct device_node *overlay_base_root; ··· 2257 2215 u32 data_size; 2258 2216 void *new_fdt; 2259 2217 u32 size; 2218 + int found = 0; 2219 + const char *overlay_name = "overlay_base"; 2220 + 2221 + for (info = overlays; info && info->name; info++) { 2222 + if (!strcmp(overlay_name, info->name)) { 2223 + found = 1; 2224 + break; 2225 + } 2226 + } 2227 + if (!found) { 2228 + pr_err("no overlay data for %s\n", overlay_name); 2229 + return; 2230 + } 2260 2231 2261 2232 info = &overlays[0]; 2262 2233 ··· 2317 2262 { 2318 2263 struct overlay_info *info; 2319 2264 int found = 0; 2320 - int k; 2321 2265 int ret; 2322 2266 u32 size; 2323 2267 2324 - for (k = 0, info = overlays; info && info->name; info++, k++) { 2268 + for (info = overlays; info && info->name; info++) { 2325 2269 if (!strcmp(overlay_name, info->name)) { 2326 2270 found = 1; 2327 2271 break; ··· 2393 2339 */ 2394 2340 pprev = &overlay_base_root->child; 2395 2341 for (np = overlay_base_root->child; np; np = np->sibling) { 2396 - if (!of_node_cmp(np->name, "__local_fixups__")) { 2342 + if (of_node_name_eq(np, "__local_fixups__")) { 2397 2343 *pprev = np->sibling; 2398 2344 break; 2399 2345 } ··· 2406 2352 /* will have to graft properties from node into live tree */ 2407 2353 pprev = &overlay_base_root->child; 2408 2354 for (np = overlay_base_root->child; np; np = np->sibling) { 2409 - if (!of_node_cmp(np->name, "__symbols__")) { 2355 + if (of_node_name_eq(np, "__symbols__")) { 2410 2356 overlay_base_symbols = np; 2411 2357 *pprev = np->sibling; 2412 2358 break; ··· 2483 2429 2484 2430 unittest(overlay_data_apply("overlay", NULL), 2485 2431 "Adding overlay 'overlay' failed\n"); 2432 + 2433 + unittest(overlay_data_apply("overlay_bad_add_dup_node", NULL), 2434 + "Adding overlay 'overlay_bad_add_dup_node' failed\n"); 2435 + 2436 + unittest(overlay_data_apply("overlay_bad_add_dup_prop", NULL), 2437 + "Adding overlay 'overlay_bad_add_dup_prop' failed\n"); 2486 2438 2487 2439 unittest(overlay_data_apply("overlay_bad_phandle", NULL), 2488 2440 "Adding overlay 'overlay_bad_phandle' failed\n");
+1 -1
drivers/power/reset/axxia-reset.c
··· 65 65 66 66 syscon = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon"); 67 67 if (IS_ERR(syscon)) { 68 - pr_err("%s: syscon lookup failed\n", dev->of_node->name); 68 + pr_err("%pOFn: syscon lookup failed\n", dev->of_node); 69 69 return PTR_ERR(syscon); 70 70 } 71 71
+1 -1
drivers/video/backlight/pm8941-wled.c
··· 330 330 331 331 rc = of_property_read_string(dev->of_node, "label", &wled->name); 332 332 if (rc) 333 - wled->name = dev->of_node->name; 333 + wled->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node); 334 334 335 335 *cfg = pm8941_wled_config_defaults; 336 336 for (i = 0; i < ARRAY_SIZE(u32_opts); ++i) {
+3
include/linux/initrd.h
··· 21 21 extern unsigned long initrd_start, initrd_end; 22 22 extern void free_initrd_mem(unsigned long, unsigned long); 23 23 24 + extern phys_addr_t phys_initrd_start; 25 + extern unsigned long phys_initrd_size; 26 + 24 27 extern unsigned int real_root_dev;
+16 -5
include/linux/of.h
··· 137 137 extern struct device_node *of_stdout; 138 138 extern raw_spinlock_t devtree_lock; 139 139 140 - /* flag descriptions (need to be visible even when !CONFIG_OF) */ 141 - #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 142 - #define OF_DETACHED 2 /* node has been detached from the device tree */ 143 - #define OF_POPULATED 3 /* device already created for the node */ 144 - #define OF_POPULATED_BUS 4 /* of_platform_populate recursed to children of this node */ 140 + /* 141 + * struct device_node flag descriptions 142 + * (need to be visible even when !CONFIG_OF) 143 + */ 144 + #define OF_DYNAMIC 1 /* (and properties) allocated via kmalloc */ 145 + #define OF_DETACHED 2 /* detached from the device tree */ 146 + #define OF_POPULATED 3 /* device already created */ 147 + #define OF_POPULATED_BUS 4 /* platform bus created for children */ 148 + #define OF_OVERLAY 5 /* allocated for an overlay */ 149 + #define OF_OVERLAY_FREE_CSET 6 /* in overlay cset being freed */ 145 150 146 151 #define OF_BAD_ADDR ((u64)-1) 147 152 ··· 988 983 #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 989 984 #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 990 985 #endif 986 + 987 + static inline int of_prop_val_eq(struct property *p1, struct property *p2) 988 + { 989 + return p1->length == p2->length && 990 + !memcmp(p1->value, p2->value, (size_t)p1->length); 991 + } 991 992 992 993 #if defined(CONFIG_OF) && defined(CONFIG_NUMA) 993 994 extern int of_node_to_nid(struct device_node *np);
-2
include/linux/of_pdt.h
··· 35 35 /* for building the device tree */ 36 36 extern void of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops); 37 37 38 - extern void (*of_pdt_build_more)(struct device_node *dp); 39 - 40 38 #endif /* _LINUX_OF_PDT_H */
+20
init/do_mounts_initrd.c
··· 16 16 unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ 17 17 static int __initdata mount_initrd = 1; 18 18 19 + phys_addr_t phys_initrd_start __initdata; 20 + unsigned long phys_initrd_size __initdata; 21 + 19 22 static int __init no_initrd(char *str) 20 23 { 21 24 mount_initrd = 0; ··· 26 23 } 27 24 28 25 __setup("noinitrd", no_initrd); 26 + 27 + static int __init early_initrd(char *p) 28 + { 29 + phys_addr_t start; 30 + unsigned long size; 31 + char *endp; 32 + 33 + start = memparse(p, &endp); 34 + if (*endp == ',') { 35 + size = memparse(endp + 1, NULL); 36 + 37 + phys_initrd_start = start; 38 + phys_initrd_size = size; 39 + } 40 + return 0; 41 + } 42 + early_param("initrd", early_initrd); 29 43 30 44 static int init_linuxrc(struct subprocess_info *info, struct cred *new) 31 45 {
+23 -3
scripts/Makefile.lib
··· 61 61 extra-y += $(dtb-y) 62 62 extra-$(CONFIG_OF_ALL_DTBS) += $(dtb-) 63 63 64 + ifneq ($(CHECK_DTBS),) 65 + extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) 66 + extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) 67 + endif 68 + 64 69 # Add subdir path 65 70 66 71 extra-y := $(addprefix $(obj)/,$(extra-y)) ··· 256 251 -Wno-avoid_unnecessary_addr_size \ 257 252 -Wno-alias_paths \ 258 253 -Wno-graph_child_address \ 259 - -Wno-graph_port \ 254 + -Wno-simple_bus_reg \ 260 255 -Wno-unique_unit_address \ 261 256 -Wno-pci_device_reg 262 257 endif ··· 289 284 quiet_cmd_dtc = DTC $@ 290 285 cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ 291 286 $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ 292 - $(DTC) -O dtb -o $@ -b 0 \ 287 + $(DTC) -O $(2) -o $@ -b 0 \ 293 288 $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ 294 289 -d $(depfile).dtc.tmp $(dtc-tmp) ; \ 295 290 cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) 296 291 297 292 $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE 298 - $(call if_changed_dep,dtc) 293 + $(call if_changed_dep,dtc,dtb) 294 + 295 + DT_CHECKER ?= dt-validate 296 + DT_BINDING_DIR := Documentation/devicetree/bindings 297 + DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml 298 + 299 + quiet_cmd_dtb_check = CHECK $@ 300 + cmd_dtb_check = $(DT_CHECKER) -p $(DT_TMP_SCHEMA) $@ ; 301 + 302 + define rule_dtc_dt_yaml 303 + $(call cmd_and_fixdep,dtc,yaml) \ 304 + $(call echo-cmd,dtb_check) $(cmd_dtb_check) 305 + endef 306 + 307 + $(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE 308 + $(call if_changed_rule,dtc_dt_yaml) 299 309 300 310 dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) 301 311
+4
scripts/dtc/Makefile
··· 12 12 HOST_EXTRACFLAGS := -I$(src)/libfdt 13 13 14 14 ifeq ($(wildcard /usr/include/yaml.h),) 15 + ifneq ($(CHECK_DTBS),) 16 + $(error dtc needs libyaml for DT schema validation support. \ 17 + Install the necessary libyaml development package.) 18 + endif 15 19 HOST_EXTRACFLAGS += -DNO_YAML 16 20 else 17 21 dtc-objs += yamltree.o
+58 -17
scripts/dtc/checks.c
··· 19 19 */ 20 20 21 21 #include "dtc.h" 22 + #include "srcpos.h" 22 23 23 24 #ifdef TRACE_CHECKS 24 25 #define TRACE(c, ...) \ ··· 79 78 const char *fmt, ...) 80 79 { 81 80 va_list ap; 82 - va_start(ap, fmt); 81 + char *str = NULL; 82 + struct srcpos *pos = NULL; 83 + char *file_str; 83 84 84 - if ((c->warn && (quiet < 1)) 85 - || (c->error && (quiet < 2))) { 86 - fprintf(stderr, "%s: %s (%s): ", 87 - strcmp(dti->outname, "-") ? dti->outname : "<stdout>", 88 - (c->error) ? "ERROR" : "Warning", c->name); 89 - if (node) { 90 - fprintf(stderr, "%s", node->fullpath); 91 - if (prop) 92 - fprintf(stderr, ":%s", prop->name); 93 - fputs(": ", stderr); 94 - } 95 - vfprintf(stderr, fmt, ap); 96 - fprintf(stderr, "\n"); 85 + if (!(c->warn && (quiet < 1)) && !(c->error && (quiet < 2))) 86 + return; 87 + 88 + if (prop && prop->srcpos) 89 + pos = prop->srcpos; 90 + else if (node && node->srcpos) 91 + pos = node->srcpos; 92 + 93 + if (pos) { 94 + file_str = srcpos_string(pos); 95 + xasprintf(&str, "%s", file_str); 96 + free(file_str); 97 + } else if (streq(dti->outname, "-")) { 98 + xasprintf(&str, "<stdout>"); 99 + } else { 100 + xasprintf(&str, "%s", dti->outname); 97 101 } 102 + 103 + xasprintf_append(&str, ": %s (%s): ", 104 + (c->error) ? "ERROR" : "Warning", c->name); 105 + 106 + if (node) { 107 + if (prop) 108 + xasprintf_append(&str, "%s:%s: ", node->fullpath, prop->name); 109 + else 110 + xasprintf_append(&str, "%s: ", node->fullpath); 111 + } 112 + 113 + va_start(ap, fmt); 114 + xavsprintf_append(&str, fmt, ap); 98 115 va_end(ap); 116 + 117 + xasprintf_append(&str, "\n"); 118 + 119 + if (!prop && pos) { 120 + pos = node->srcpos; 121 + while (pos->next) { 122 + pos = pos->next; 123 + 124 + file_str = srcpos_string(pos); 125 + xasprintf_append(&str, " also defined at %s\n", file_str); 126 + free(file_str); 127 + } 128 + } 129 + 130 + fputs(str, stderr); 99 131 } 100 132 101 133 #define FAIL(c, dti, node, ...) \ ··· 944 910 945 911 for (str = prop->val.val, end = str + prop->val.len; str < end; 946 912 str += strnlen(str, end - str) + 1) { 947 - if (strprefixeq(str, end - str, compat)) 913 + if (streq(str, compat)) 948 914 return true; 949 915 } 950 916 return false; ··· 955 921 if (node_is_compatible(node, "simple-bus")) 956 922 node->bus = &simple_bus; 957 923 } 958 - WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells); 924 + WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, 925 + &addr_size_cells, &compatible_is_string_list); 959 926 960 927 static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) 961 928 { ··· 1070 1035 1071 1036 static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) 1072 1037 { 1038 + int spi_addr_cells = 1; 1073 1039 1074 1040 if (strprefixeq(node->name, node->basenamelen, "spi")) { 1075 1041 node->bus = &spi_bus; ··· 1099 1063 if (node->bus != &spi_bus || !node->children) 1100 1064 return; 1101 1065 1102 - if (node_addr_cells(node) != 1) 1066 + if (get_property(node, "spi-slave")) 1067 + spi_addr_cells = 0; 1068 + if (node_addr_cells(node) != spi_addr_cells) 1103 1069 FAIL(c, dti, node, "incorrect #address-cells for SPI bus"); 1104 1070 if (node_size_cells(node) != 0) 1105 1071 FAIL(c, dti, node, "incorrect #size-cells for SPI bus"); ··· 1118 1080 cell_t *cells = NULL; 1119 1081 1120 1082 if (!node->parent || (node->parent->bus != &spi_bus)) 1083 + return; 1084 + 1085 + if (get_property(node->parent, "spi-slave")) 1121 1086 return; 1122 1087 1123 1088 prop = get_property(node, "reg");
+2 -2
scripts/dtc/dtc-lexer.l
··· 213 213 <*>\&{LABEL} { /* label reference */ 214 214 DPRINT("Ref: %s\n", yytext+1); 215 215 yylval.labelref = xstrdup(yytext+1); 216 - return DT_REF; 216 + return DT_LABEL_REF; 217 217 } 218 218 219 219 <*>"&{/"{PATHCHAR}*\} { /* new-style path reference */ 220 220 yytext[yyleng-1] = '\0'; 221 221 DPRINT("Ref: %s\n", yytext+2); 222 222 yylval.labelref = xstrdup(yytext+2); 223 - return DT_REF; 223 + return DT_PATH_REF; 224 224 } 225 225 226 226 <BYTESTRING>[0-9a-fA-F]{2} {
+39 -13
scripts/dtc/dtc-parser.y
··· 70 70 %token <byte> DT_BYTE 71 71 %token <data> DT_STRING 72 72 %token <labelref> DT_LABEL 73 - %token <labelref> DT_REF 73 + %token <labelref> DT_LABEL_REF 74 + %token <labelref> DT_PATH_REF 74 75 %token DT_INCBIN 75 76 76 77 %type <data> propdata ··· 84 83 %type <data> bytestring 85 84 %type <prop> propdef 86 85 %type <proplist> proplist 86 + %type <labelref> dt_ref 87 87 88 88 %type <node> devicetree 89 89 %type <node> nodedef ··· 160 158 } 161 159 ; 162 160 161 + dt_ref: DT_LABEL_REF | DT_PATH_REF; 162 + 163 163 devicetree: 164 164 '/' nodedef 165 165 { ··· 171 167 { 172 168 $$ = merge_nodes($1, $3); 173 169 } 174 - | DT_REF nodedef 170 + | dt_ref nodedef 175 171 { 176 172 /* 177 173 * We rely on the rule being always: ··· 180 176 */ 181 177 if (!($<flags>-1 & DTSF_PLUGIN)) 182 178 ERROR(&@2, "Label or path %s not found", $1); 183 - $$ = add_orphan_node(name_node(build_node(NULL, NULL), ""), $2, $1); 179 + $$ = add_orphan_node( 180 + name_node(build_node(NULL, NULL, NULL), 181 + ""), 182 + $2, $1); 184 183 } 185 - | devicetree DT_LABEL DT_REF nodedef 184 + | devicetree DT_LABEL dt_ref nodedef 186 185 { 187 186 struct node *target = get_node_by_ref($1, $3); 188 187 ··· 196 189 ERROR(&@3, "Label or path %s not found", $3); 197 190 $$ = $1; 198 191 } 199 - | devicetree DT_REF nodedef 192 + | devicetree DT_PATH_REF nodedef 200 193 { 201 194 /* 202 195 * We rely on the rule being always: ··· 215 208 } 216 209 $$ = $1; 217 210 } 218 - | devicetree DT_DEL_NODE DT_REF ';' 211 + | devicetree DT_LABEL_REF nodedef 212 + { 213 + struct node *target = get_node_by_ref($1, $2); 214 + 215 + if (target) { 216 + merge_nodes(target, $3); 217 + } else { 218 + /* 219 + * We rely on the rule being always: 220 + * versioninfo plugindecl memreserves devicetree 221 + * so $-1 is what we want (plugindecl) 222 + */ 223 + if ($<flags>-1 & DTSF_PLUGIN) 224 + add_orphan_node($1, $3, $2); 225 + else 226 + ERROR(&@2, "Label or path %s not found", $2); 227 + } 228 + $$ = $1; 229 + } 230 + | devicetree DT_DEL_NODE dt_ref ';' 219 231 { 220 232 struct node *target = get_node_by_ref($1, $3); 221 233 ··· 246 220 247 221 $$ = $1; 248 222 } 249 - | devicetree DT_OMIT_NO_REF DT_REF ';' 223 + | devicetree DT_OMIT_NO_REF dt_ref ';' 250 224 { 251 225 struct node *target = get_node_by_ref($1, $3); 252 226 ··· 263 237 nodedef: 264 238 '{' proplist subnodes '}' ';' 265 239 { 266 - $$ = build_node($2, $3); 240 + $$ = build_node($2, $3, &@$); 267 241 } 268 242 ; 269 243 ··· 281 255 propdef: 282 256 DT_PROPNODENAME '=' propdata ';' 283 257 { 284 - $$ = build_property($1, $3); 258 + $$ = build_property($1, $3, &@$); 285 259 } 286 260 | DT_PROPNODENAME ';' 287 261 { 288 - $$ = build_property($1, empty_data); 262 + $$ = build_property($1, empty_data, &@$); 289 263 } 290 264 | DT_DEL_PROP DT_PROPNODENAME ';' 291 265 { ··· 311 285 { 312 286 $$ = data_merge($1, $3); 313 287 } 314 - | propdataprefix DT_REF 288 + | propdataprefix dt_ref 315 289 { 316 290 $1 = data_add_marker($1, TYPE_STRING, $2); 317 291 $$ = data_add_marker($1, REF_PATH, $2); ··· 409 383 410 384 $$.data = data_append_integer($1.data, $2, $1.bits); 411 385 } 412 - | arrayprefix DT_REF 386 + | arrayprefix dt_ref 413 387 { 414 388 uint64_t val = ~0ULL >> (64 - $1.bits); 415 389 ··· 566 540 } 567 541 | DT_DEL_NODE DT_PROPNODENAME ';' 568 542 { 569 - $$ = name_node(build_node_delete(), $2); 543 + $$ = name_node(build_node_delete(&@$), $2); 570 544 } 571 545 | DT_OMIT_NO_REF subnode 572 546 {
+10 -1
scripts/dtc/dtc.c
··· 35 35 int generate_symbols; /* enable symbols & fixup support */ 36 36 int generate_fixups; /* suppress generation of fixups on symbol support */ 37 37 int auto_label_aliases; /* auto generate labels -> aliases */ 38 + int annotate; /* Level of annotation: 1 for input source location 39 + >1 for full input source location. */ 38 40 39 41 static int is_power_of_2(int x) 40 42 { ··· 62 60 63 61 /* Usage related data. */ 64 62 static const char usage_synopsis[] = "dtc [options] <input file>"; 65 - static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@Ahv"; 63 + static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@AThv"; 66 64 static struct option const usage_long_opts[] = { 67 65 {"quiet", no_argument, NULL, 'q'}, 68 66 {"in-format", a_argument, NULL, 'I'}, ··· 83 81 {"error", a_argument, NULL, 'E'}, 84 82 {"symbols", no_argument, NULL, '@'}, 85 83 {"auto-alias", no_argument, NULL, 'A'}, 84 + {"annotate", no_argument, NULL, 'T'}, 86 85 {"help", no_argument, NULL, 'h'}, 87 86 {"version", no_argument, NULL, 'v'}, 88 87 {NULL, no_argument, NULL, 0x0}, ··· 120 117 "\n\tEnable/disable errors (prefix with \"no-\")", 121 118 "\n\tEnable generation of symbols", 122 119 "\n\tEnable auto-alias of labels", 120 + "\n\tAnnotate output .dts with input source file and line (-T -T for more details)", 123 121 "\n\tPrint this help and exit", 124 122 "\n\tPrint version and exit", 125 123 NULL, ··· 268 264 case 'A': 269 265 auto_label_aliases = 1; 270 266 break; 267 + case 'T': 268 + annotate++; 269 + break; 271 270 272 271 case 'h': 273 272 usage(NULL); ··· 309 302 outform = "dts"; 310 303 } 311 304 } 305 + if (annotate && (!streq(inform, "dts") || !streq(outform, "dts"))) 306 + die("--annotate requires -I dts -O dts\n"); 312 307 if (streq(inform, "dts")) 313 308 dti = dt_from_source(arg); 314 309 else if (streq(inform, "fs"))
+8 -3
scripts/dtc/dtc.h
··· 58 58 extern int generate_symbols; /* generate symbols for nodes with labels */ 59 59 extern int generate_fixups; /* generate fixups */ 60 60 extern int auto_label_aliases; /* auto generate labels -> aliases */ 61 + extern int annotate; /* annotate .dts with input source location */ 61 62 62 63 #define PHANDLE_LEGACY 0x1 63 64 #define PHANDLE_EPAPR 0x2 ··· 159 158 struct property *next; 160 159 161 160 struct label *labels; 161 + struct srcpos *srcpos; 162 162 }; 163 163 164 164 struct node { ··· 179 177 180 178 struct label *labels; 181 179 const struct bus_type *bus; 180 + struct srcpos *srcpos; 182 181 183 182 bool omit_if_unused, is_referenced; 184 183 }; ··· 208 205 void add_label(struct label **labels, char *label); 209 206 void delete_labels(struct label **labels); 210 207 211 - struct property *build_property(char *name, struct data val); 208 + struct property *build_property(char *name, struct data val, 209 + struct srcpos *srcpos); 212 210 struct property *build_property_delete(char *name); 213 211 struct property *chain_property(struct property *first, struct property *list); 214 212 struct property *reverse_properties(struct property *first); 215 213 216 - struct node *build_node(struct property *proplist, struct node *children); 217 - struct node *build_node_delete(void); 214 + struct node *build_node(struct property *proplist, struct node *children, 215 + struct srcpos *srcpos); 216 + struct node *build_node_delete(struct srcpos *srcpos); 218 217 struct node *name_node(struct node *node, char *name); 219 218 struct node *omit_node_if_unused(struct node *node); 220 219 struct node *reference_node(struct node *node);
+2 -2
scripts/dtc/flattree.c
··· 692 692 693 693 val = flat_read_data(dtbuf, proplen); 694 694 695 - return build_property(name, val); 695 + return build_property(name, val, NULL); 696 696 } 697 697 698 698 ··· 750 750 char *flatname; 751 751 uint32_t val; 752 752 753 - node = build_node(NULL, NULL); 753 + node = build_node(NULL, NULL, NULL); 754 754 755 755 flatname = flat_read_string(dtbuf); 756 756
+3 -2
scripts/dtc/fstree.c
··· 34 34 if (!d) 35 35 die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno)); 36 36 37 - tree = build_node(NULL, NULL); 37 + tree = build_node(NULL, NULL, NULL); 38 38 39 39 while ((de = readdir(d)) != NULL) { 40 40 char *tmpname; ··· 60 60 } else { 61 61 prop = build_property(xstrdup(de->d_name), 62 62 data_copy_file(pfile, 63 - st.st_size)); 63 + st.st_size), 64 + NULL); 64 65 add_property(tree, prop); 65 66 fclose(pfile); 66 67 }
+4
scripts/dtc/libfdt/Makefile.libfdt
··· 9 9 LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c \ 10 10 fdt_addresses.c fdt_overlay.c 11 11 LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o) 12 + 13 + libfdt_clean: 14 + @$(VECHO) CLEAN "(libfdt)" 15 + rm -f $(STD_CLEANFILES:%=$(LIBFDT_dir)/%)
+13 -3
scripts/dtc/libfdt/fdt_addresses.c
··· 64 64 65 65 c = fdt_getprop(fdt, nodeoffset, name, &len); 66 66 if (!c) 67 - return 2; 67 + return len; 68 68 69 69 if (len != sizeof(*c)) 70 70 return -FDT_ERR_BADNCELLS; ··· 78 78 79 79 int fdt_address_cells(const void *fdt, int nodeoffset) 80 80 { 81 - return fdt_cells(fdt, nodeoffset, "#address-cells"); 81 + int val; 82 + 83 + val = fdt_cells(fdt, nodeoffset, "#address-cells"); 84 + if (val == -FDT_ERR_NOTFOUND) 85 + return 2; 86 + return val; 82 87 } 83 88 84 89 int fdt_size_cells(const void *fdt, int nodeoffset) 85 90 { 86 - return fdt_cells(fdt, nodeoffset, "#size-cells"); 91 + int val; 92 + 93 + val = fdt_cells(fdt, nodeoffset, "#size-cells"); 94 + if (val == -FDT_ERR_NOTFOUND) 95 + return 1; 96 + return val; 87 97 }
+15 -7
scripts/dtc/libfdt/libfdt.h
··· 163 163 164 164 static inline uint32_t fdt32_ld(const fdt32_t *p) 165 165 { 166 - fdt32_t v; 166 + const uint8_t *bp = (const uint8_t *)p; 167 167 168 - memcpy(&v, p, sizeof(v)); 169 - return fdt32_to_cpu(v); 168 + return ((uint32_t)bp[0] << 24) 169 + | ((uint32_t)bp[1] << 16) 170 + | ((uint32_t)bp[2] << 8) 171 + | bp[3]; 170 172 } 171 173 172 174 static inline uint64_t fdt64_ld(const fdt64_t *p) 173 175 { 174 - fdt64_t v; 176 + const uint8_t *bp = (const uint8_t *)p; 175 177 176 - memcpy(&v, p, sizeof(v)); 177 - return fdt64_to_cpu(v); 178 + return ((uint64_t)bp[0] << 56) 179 + | ((uint64_t)bp[1] << 48) 180 + | ((uint64_t)bp[2] << 40) 181 + | ((uint64_t)bp[3] << 32) 182 + | ((uint64_t)bp[4] << 24) 183 + | ((uint64_t)bp[5] << 16) 184 + | ((uint64_t)bp[6] << 8) 185 + | bp[7]; 178 186 } 179 187 180 188 /**********************************************************************/ ··· 1153 1145 * 1154 1146 * returns: 1155 1147 * 0 <= n < FDT_MAX_NCELLS, on success 1156 - * 2, if the node has no #size-cells property 1148 + * 1, if the node has no #size-cells property 1157 1149 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid 1158 1150 * #size-cells property 1159 1151 * -FDT_ERR_BADMAGIC,
+22 -11
scripts/dtc/livetree.c
··· 19 19 */ 20 20 21 21 #include "dtc.h" 22 + #include "srcpos.h" 22 23 23 24 /* 24 25 * Tree building functions ··· 51 50 label->deleted = 1; 52 51 } 53 52 54 - struct property *build_property(char *name, struct data val) 53 + struct property *build_property(char *name, struct data val, 54 + struct srcpos *srcpos) 55 55 { 56 56 struct property *new = xmalloc(sizeof(*new)); 57 57 ··· 60 58 61 59 new->name = name; 62 60 new->val = val; 61 + new->srcpos = srcpos_copy(srcpos); 63 62 64 63 return new; 65 64 } ··· 100 97 return head; 101 98 } 102 99 103 - struct node *build_node(struct property *proplist, struct node *children) 100 + struct node *build_node(struct property *proplist, struct node *children, 101 + struct srcpos *srcpos) 104 102 { 105 103 struct node *new = xmalloc(sizeof(*new)); 106 104 struct node *child; ··· 110 106 111 107 new->proplist = reverse_properties(proplist); 112 108 new->children = children; 109 + new->srcpos = srcpos_copy(srcpos); 113 110 114 111 for_each_child(new, child) { 115 112 child->parent = new; ··· 119 114 return new; 120 115 } 121 116 122 - struct node *build_node_delete(void) 117 + struct node *build_node_delete(struct srcpos *srcpos) 123 118 { 124 119 struct node *new = xmalloc(sizeof(*new)); 125 120 126 121 memset(new, 0, sizeof(*new)); 127 122 128 123 new->deleted = 1; 124 + new->srcpos = srcpos_copy(srcpos); 129 125 130 126 return new; 131 127 } ··· 189 183 190 184 old_prop->val = new_prop->val; 191 185 old_prop->deleted = 0; 186 + free(old_prop->srcpos); 187 + old_prop->srcpos = new_prop->srcpos; 192 188 free(new_prop); 193 189 new_prop = NULL; 194 190 break; ··· 231 223 add_child(old_node, new_child); 232 224 } 233 225 226 + old_node->srcpos = srcpos_extend(old_node->srcpos, new_node->srcpos); 227 + 234 228 /* The new node contents are now merged into the old node. Free 235 229 * the new node. */ 236 230 free(new_node); ··· 251 241 if (ref[0] == '/') { 252 242 d = data_append_data(d, ref, strlen(ref) + 1); 253 243 254 - p = build_property("target-path", d); 244 + p = build_property("target-path", d, NULL); 255 245 } else { 256 246 d = data_add_marker(d, REF_PHANDLE, ref); 257 247 d = data_append_integer(d, 0xffffffff, 32); 258 248 259 - p = build_property("target", d); 249 + p = build_property("target", d, NULL); 260 250 } 261 251 262 252 xasprintf(&name, "fragment@%u", 263 253 next_orphan_fragment++); 264 254 name_node(new_node, "__overlay__"); 265 - node = build_node(p, new_node); 255 + node = build_node(p, new_node, NULL); 266 256 name_node(node, name); 267 257 268 258 add_child(dt, node); ··· 361 351 p->val = d; 362 352 } else { 363 353 d = data_append_data(empty_data, data, len); 364 - p = build_property(name, d); 354 + p = build_property(name, d, NULL); 365 355 add_property(node, p); 366 356 } 367 357 } ··· 619 609 620 610 if (!get_property(node, "linux,phandle") 621 611 && (phandle_format & PHANDLE_LEGACY)) 622 - add_property(node, build_property("linux,phandle", d)); 612 + add_property(node, build_property("linux,phandle", d, NULL)); 623 613 624 614 if (!get_property(node, "phandle") 625 615 && (phandle_format & PHANDLE_EPAPR)) 626 - add_property(node, build_property("phandle", d)); 616 + add_property(node, build_property("phandle", d, NULL)); 627 617 628 618 /* If the node *does* have a phandle property, we must 629 619 * be dealing with a self-referencing phandle, which will be ··· 797 787 { 798 788 struct node *node; 799 789 800 - node = build_node(NULL, NULL); 790 + node = build_node(NULL, NULL, NULL); 801 791 name_node(node, xstrdup(name)); 802 792 add_child(parent, node); 803 793 ··· 859 849 /* insert it */ 860 850 p = build_property(l->label, 861 851 data_copy_mem(node->fullpath, 862 - strlen(node->fullpath) + 1)); 852 + strlen(node->fullpath) + 1), 853 + NULL); 863 854 add_property(an, p); 864 855 } 865 856
+138 -15
scripts/dtc/srcpos.c
··· 33 33 /* This is the list of directories that we search for source files */ 34 34 static struct search_path *search_path_head, **search_path_tail; 35 35 36 + /* Detect infinite include recursion. */ 37 + #define MAX_SRCFILE_DEPTH (100) 38 + static int srcfile_depth; /* = 0 */ 36 39 37 40 static char *get_dirname(const char *path) 38 41 { ··· 54 51 55 52 FILE *depfile; /* = NULL */ 56 53 struct srcfile_state *current_srcfile; /* = NULL */ 54 + static char *initial_path; /* = NULL */ 55 + static int initial_pathlen; /* = 0 */ 56 + static bool initial_cpp = true; 57 57 58 - /* Detect infinite include recursion. */ 59 - #define MAX_SRCFILE_DEPTH (100) 60 - static int srcfile_depth; /* = 0 */ 58 + static void set_initial_path(char *fname) 59 + { 60 + int i, len = strlen(fname); 61 61 62 + xasprintf(&initial_path, "%s", fname); 63 + initial_pathlen = 0; 64 + for (i = 0; i != len; i++) 65 + if (initial_path[i] == '/') 66 + initial_pathlen++; 67 + } 68 + 69 + static char *shorten_to_initial_path(char *fname) 70 + { 71 + char *p1, *p2, *prevslash1 = NULL; 72 + int slashes = 0; 73 + 74 + for (p1 = fname, p2 = initial_path; *p1 && *p2; p1++, p2++) { 75 + if (*p1 != *p2) 76 + break; 77 + if (*p1 == '/') { 78 + prevslash1 = p1; 79 + slashes++; 80 + } 81 + } 82 + p1 = prevslash1 + 1; 83 + if (prevslash1) { 84 + int diff = initial_pathlen - slashes, i, j; 85 + int restlen = strlen(fname) - (p1 - fname); 86 + char *res; 87 + 88 + res = xmalloc((3 * diff) + restlen + 1); 89 + for (i = 0, j = 0; i != diff; i++) { 90 + res[j++] = '.'; 91 + res[j++] = '.'; 92 + res[j++] = '/'; 93 + } 94 + strcpy(res + j, p1); 95 + return res; 96 + } 97 + return NULL; 98 + } 62 99 63 100 /** 64 101 * Try to open a file in a given directory. ··· 200 157 srcfile->colno = 1; 201 158 202 159 current_srcfile = srcfile; 160 + 161 + if (srcfile_depth == 1) 162 + set_initial_path(srcfile->name); 203 163 } 204 164 205 165 bool srcfile_pop(void) ··· 243 197 search_path_tail = &node->next; 244 198 } 245 199 246 - /* 247 - * The empty source position. 248 - */ 249 - 250 - struct srcpos srcpos_empty = { 251 - .first_line = 0, 252 - .first_column = 0, 253 - .last_line = 0, 254 - .last_column = 0, 255 - .file = NULL, 256 - }; 257 - 258 200 void srcpos_update(struct srcpos *pos, const char *text, int len) 259 201 { 260 202 int i; ··· 268 234 srcpos_copy(struct srcpos *pos) 269 235 { 270 236 struct srcpos *pos_new; 237 + struct srcfile_state *srcfile_state; 238 + 239 + if (!pos) 240 + return NULL; 271 241 272 242 pos_new = xmalloc(sizeof(struct srcpos)); 243 + assert(pos->next == NULL); 273 244 memcpy(pos_new, pos, sizeof(struct srcpos)); 274 245 246 + /* allocate without free */ 247 + srcfile_state = xmalloc(sizeof(struct srcfile_state)); 248 + memcpy(srcfile_state, pos->file, sizeof(struct srcfile_state)); 249 + pos_new->file = srcfile_state; 250 + 275 251 return pos_new; 252 + } 253 + 254 + struct srcpos *srcpos_extend(struct srcpos *pos, struct srcpos *newtail) 255 + { 256 + struct srcpos *p; 257 + 258 + if (!pos) 259 + return newtail; 260 + 261 + for (p = pos; p->next != NULL; p = p->next); 262 + p->next = newtail; 263 + return pos; 276 264 } 277 265 278 266 char * ··· 320 264 pos->first_line, pos->first_column); 321 265 322 266 return pos_str; 267 + } 268 + 269 + static char * 270 + srcpos_string_comment(struct srcpos *pos, bool first_line, int level) 271 + { 272 + char *pos_str, *fname, *first, *rest; 273 + bool fresh_fname = false; 274 + 275 + if (!pos) { 276 + if (level > 1) { 277 + xasprintf(&pos_str, "<no-file>:<no-line>"); 278 + return pos_str; 279 + } else { 280 + return NULL; 281 + } 282 + } 283 + 284 + if (!pos->file) 285 + fname = "<no-file>"; 286 + else if (!pos->file->name) 287 + fname = "<no-filename>"; 288 + else if (level > 1) 289 + fname = pos->file->name; 290 + else { 291 + fname = shorten_to_initial_path(pos->file->name); 292 + if (fname) 293 + fresh_fname = true; 294 + else 295 + fname = pos->file->name; 296 + } 297 + 298 + if (level > 1) 299 + xasprintf(&first, "%s:%d:%d-%d:%d", fname, 300 + pos->first_line, pos->first_column, 301 + pos->last_line, pos->last_column); 302 + else 303 + xasprintf(&first, "%s:%d", fname, 304 + first_line ? pos->first_line : pos->last_line); 305 + 306 + if (fresh_fname) 307 + free(fname); 308 + 309 + if (pos->next != NULL) { 310 + rest = srcpos_string_comment(pos->next, first_line, level); 311 + xasprintf(&pos_str, "%s, %s", first, rest); 312 + free(first); 313 + free(rest); 314 + } else { 315 + pos_str = first; 316 + } 317 + 318 + return pos_str; 319 + } 320 + 321 + char *srcpos_string_first(struct srcpos *pos, int level) 322 + { 323 + return srcpos_string_comment(pos, true, level); 324 + } 325 + 326 + char *srcpos_string_last(struct srcpos *pos, int level) 327 + { 328 + return srcpos_string_comment(pos, false, level); 323 329 } 324 330 325 331 void srcpos_verror(struct srcpos *pos, const char *prefix, ··· 412 294 { 413 295 current_srcfile->name = f; 414 296 current_srcfile->lineno = l; 297 + 298 + if (initial_cpp) { 299 + initial_cpp = false; 300 + set_initial_path(f); 301 + } 415 302 }
+7 -7
scripts/dtc/srcpos.h
··· 74 74 int last_line; 75 75 int last_column; 76 76 struct srcfile_state *file; 77 + struct srcpos *next; 77 78 }; 78 79 79 80 #define YYLTYPE struct srcpos ··· 94 93 YYRHSLOC(Rhs, 0).last_column; \ 95 94 (Current).file = YYRHSLOC (Rhs, 0).file; \ 96 95 } \ 96 + (Current).next = NULL; \ 97 97 } while (0) 98 98 99 99 100 - /* 101 - * Fictional source position used for IR nodes that are 102 - * created without otherwise knowing a true source position. 103 - * For example,constant definitions from the command line. 104 - */ 105 - extern struct srcpos srcpos_empty; 106 - 107 100 extern void srcpos_update(struct srcpos *pos, const char *text, int len); 108 101 extern struct srcpos *srcpos_copy(struct srcpos *pos); 102 + extern struct srcpos *srcpos_extend(struct srcpos *new_srcpos, 103 + struct srcpos *old_srcpos); 109 104 extern char *srcpos_string(struct srcpos *pos); 105 + extern char *srcpos_string_first(struct srcpos *pos, int level); 106 + extern char *srcpos_string_last(struct srcpos *pos, int level); 107 + 110 108 111 109 extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, 112 110 const char *fmt, va_list va);
+73 -42
scripts/dtc/treesource.c
··· 64 64 static void write_propval_string(FILE *f, const char *s, size_t len) 65 65 { 66 66 const char *end = s + len - 1; 67 + 68 + if (!len) 69 + return; 70 + 67 71 assert(*end == '\0'); 68 72 69 73 fprintf(f, "\""); ··· 122 118 for (; p < end; p += width) { 123 119 switch (width) { 124 120 case 1: 125 - fprintf(f, " %02"PRIx8, *(const uint8_t*)p); 121 + fprintf(f, "%02"PRIx8, *(const uint8_t*)p); 126 122 break; 127 123 case 2: 128 - fprintf(f, " 0x%02"PRIx16, fdt16_to_cpu(*(const fdt16_t*)p)); 124 + fprintf(f, "0x%02"PRIx16, fdt16_to_cpu(*(const fdt16_t*)p)); 129 125 break; 130 126 case 4: 131 - fprintf(f, " 0x%02"PRIx32, fdt32_to_cpu(*(const fdt32_t*)p)); 127 + fprintf(f, "0x%02"PRIx32, fdt32_to_cpu(*(const fdt32_t*)p)); 132 128 break; 133 129 case 8: 134 - fprintf(f, " 0x%02"PRIx64, fdt64_to_cpu(*(const fdt64_t*)p)); 130 + fprintf(f, "0x%02"PRIx64, fdt64_to_cpu(*(const fdt64_t*)p)); 135 131 break; 136 132 } 133 + if (p + width < end) 134 + fputc(' ', f); 137 135 } 138 136 } 139 137 ··· 168 162 [TYPE_STRING] = "", 169 163 }; 170 164 static const char *delim_end[] = { 171 - [TYPE_UINT8] = " ]", 172 - [TYPE_UINT16] = " >", 173 - [TYPE_UINT32] = " >", 174 - [TYPE_UINT64] = " >", 165 + [TYPE_UINT8] = "]", 166 + [TYPE_UINT16] = ">", 167 + [TYPE_UINT32] = ">", 168 + [TYPE_UINT64] = ">", 175 169 [TYPE_STRING] = "", 176 170 }; 177 171 ··· 214 208 struct marker *m = prop->val.markers; 215 209 struct marker dummy_marker; 216 210 enum markertype emit_type = TYPE_NONE; 211 + char *srcstr; 217 212 218 213 if (len == 0) { 219 - fprintf(f, ";\n"); 214 + fprintf(f, ";"); 215 + if (annotate) { 216 + srcstr = srcpos_string_first(prop->srcpos, annotate); 217 + if (srcstr) { 218 + fprintf(f, " /* %s */", srcstr); 219 + free(srcstr); 220 + } 221 + } 222 + fprintf(f, "\n"); 220 223 return; 221 224 } 222 225 223 - fprintf(f, " = "); 226 + fprintf(f, " ="); 224 227 225 228 if (!next_type_marker(m)) { 226 229 /* data type information missing, need to guess */ ··· 240 225 m = &dummy_marker; 241 226 } 242 227 243 - struct marker *m_label = prop->val.markers; 244 228 for_each_marker(m) { 245 - size_t chunk_len; 229 + size_t chunk_len = (m->next ? m->next->offset : len) - m->offset; 230 + size_t data_len = type_marker_length(m) ? : len - m->offset; 246 231 const char *p = &prop->val.val[m->offset]; 247 232 248 - if (!has_data_type_information(m)) 233 + if (has_data_type_information(m)) { 234 + emit_type = m->type; 235 + fprintf(f, " %s", delim_start[emit_type]); 236 + } else if (m->type == LABEL) 237 + fprintf(f, " %s:", m->ref); 238 + else if (m->offset) 239 + fputc(' ', f); 240 + 241 + if (emit_type == TYPE_NONE) { 242 + assert(chunk_len == 0); 249 243 continue; 250 - 251 - chunk_len = type_marker_length(m); 252 - if (!chunk_len) 253 - chunk_len = len - m->offset; 254 - 255 - if (emit_type != TYPE_NONE) 256 - fprintf(f, "%s, ", delim_end[emit_type]); 257 - emit_type = m->type; 258 - 259 - for_each_marker_of_type(m_label, LABEL) { 260 - if (m_label->offset > m->offset) 261 - break; 262 - fprintf(f, "%s: ", m_label->ref); 263 244 } 264 - 265 - fprintf(f, "%s", delim_start[emit_type]); 266 - 267 - if (chunk_len <= 0) 268 - continue; 269 245 270 246 switch(emit_type) { 271 247 case TYPE_UINT16: ··· 274 268 default: 275 269 write_propval_int(f, p, chunk_len, 1); 276 270 } 277 - } 278 271 279 - /* Wrap up any labels at the end of the value */ 280 - for_each_marker_of_type(m_label, LABEL) { 281 - assert (m_label->offset == len); 282 - fprintf(f, " %s:", m_label->ref); 272 + if (chunk_len == data_len) { 273 + size_t pos = m->offset + chunk_len; 274 + fprintf(f, pos == len ? "%s" : "%s,", 275 + delim_end[emit_type] ? : ""); 276 + emit_type = TYPE_NONE; 277 + } 283 278 } 284 - 285 - fprintf(f, "%s;\n", delim_end[emit_type] ? : ""); 279 + fprintf(f, ";"); 280 + if (annotate) { 281 + srcstr = srcpos_string_first(prop->srcpos, annotate); 282 + if (srcstr) { 283 + fprintf(f, " /* %s */", srcstr); 284 + free(srcstr); 285 + } 286 + } 287 + fprintf(f, "\n"); 286 288 } 287 289 288 290 static void write_tree_source_node(FILE *f, struct node *tree, int level) ··· 298 284 struct property *prop; 299 285 struct node *child; 300 286 struct label *l; 287 + char *srcstr; 301 288 302 289 write_prefix(f, level); 303 290 for_each_label(tree->labels, l) 304 291 fprintf(f, "%s: ", l->label); 305 292 if (tree->name && (*tree->name)) 306 - fprintf(f, "%s {\n", tree->name); 293 + fprintf(f, "%s {", tree->name); 307 294 else 308 - fprintf(f, "/ {\n"); 295 + fprintf(f, "/ {"); 296 + 297 + if (annotate) { 298 + srcstr = srcpos_string_first(tree->srcpos, annotate); 299 + if (srcstr) { 300 + fprintf(f, " /* %s */", srcstr); 301 + free(srcstr); 302 + } 303 + } 304 + fprintf(f, "\n"); 309 305 310 306 for_each_property(tree, prop) { 311 307 write_prefix(f, level+1); ··· 329 305 write_tree_source_node(f, child, level+1); 330 306 } 331 307 write_prefix(f, level); 332 - fprintf(f, "};\n"); 308 + fprintf(f, "};"); 309 + if (annotate) { 310 + srcstr = srcpos_string_last(tree->srcpos, annotate); 311 + if (srcstr) { 312 + fprintf(f, " /* %s */", srcstr); 313 + free(srcstr); 314 + } 315 + } 316 + fprintf(f, "\n"); 333 317 } 334 - 335 318 336 319 void dt_to_source(FILE *f, struct dt_info *dti) 337 320 {
+39 -21
scripts/dtc/util.c
··· 46 46 return d; 47 47 } 48 48 49 - /* based in part from (3) vsnprintf */ 50 - int xasprintf(char **strp, const char *fmt, ...) 49 + int xavsprintf_append(char **strp, const char *fmt, va_list ap) 51 50 { 52 - int n, size = 128; /* start with 128 bytes */ 51 + int n, size = 0; /* start with 128 bytes */ 53 52 char *p; 54 - va_list ap; 53 + va_list ap_copy; 55 54 56 - /* initial pointer is NULL making the fist realloc to be malloc */ 57 - p = NULL; 58 - while (1) { 59 - p = xrealloc(p, size); 55 + p = *strp; 56 + if (p) 57 + size = strlen(p); 60 58 61 - /* Try to print in the allocated space. */ 62 - va_start(ap, fmt); 63 - n = vsnprintf(p, size, fmt, ap); 64 - va_end(ap); 59 + va_copy(ap_copy, ap); 60 + n = vsnprintf(NULL, 0, fmt, ap_copy) + 1; 61 + va_end(ap_copy); 65 62 66 - /* If that worked, return the string. */ 67 - if (n > -1 && n < size) 68 - break; 69 - /* Else try again with more space. */ 70 - if (n > -1) /* glibc 2.1 */ 71 - size = n + 1; /* precisely what is needed */ 72 - else /* glibc 2.0 */ 73 - size *= 2; /* twice the old size */ 74 - } 63 + p = xrealloc(p, size + n); 64 + 65 + n = vsnprintf(p + size, n, fmt, ap); 66 + 75 67 *strp = p; 76 68 return strlen(p); 69 + } 70 + 71 + int xasprintf_append(char **strp, const char *fmt, ...) 72 + { 73 + int n; 74 + va_list ap; 75 + 76 + va_start(ap, fmt); 77 + n = xavsprintf_append(strp, fmt, ap); 78 + va_end(ap); 79 + 80 + return n; 81 + } 82 + 83 + int xasprintf(char **strp, const char *fmt, ...) 84 + { 85 + int n; 86 + va_list ap; 87 + 88 + *strp = NULL; 89 + 90 + va_start(ap, fmt); 91 + n = xavsprintf_append(strp, fmt, ap); 92 + va_end(ap); 93 + 94 + return n; 77 95 } 78 96 79 97 char *join_path(const char *path, const char *name)
+2
scripts/dtc/util.h
··· 72 72 extern char *xstrdup(const char *s); 73 73 74 74 extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); 75 + extern int PRINTF(2, 3) xasprintf_append(char **strp, const char *fmt, ...); 76 + extern int xavsprintf_append(char **strp, const char *fmt, va_list ap); 75 77 extern char *join_path(const char *path, const char *name); 76 78 77 79 /**
+1 -1
scripts/dtc/version_gen.h
··· 1 - #define DTC_VERSION "DTC 1.4.7-gc86da84d" 1 + #define DTC_VERSION "DTC 1.4.7-gf267e674"