Devicetree updates for v7.0:

DT core:
 - Sync dtc/libfdt with upstream v1.7.2-62-ga26ef6400bd8
 
 - Add a for_each_compatible_node_scoped() loop and convert users in
   cpufreq, dmaengine, clk, cdx, powerpc and Arm
 
 - Simplify of/platform.c with scoped loop helpers
 
 - Add fw_devlink tracking for "mmc-pwrseq"
 
 - Optimize fw_devlink callback code size for pinctrl-N properties
 
 - Replace strcmp_suffix() with strends()
 
 DT bindings:
 - Support building single binding targets
 
 - Convert google,goldfish-fb, cznic,turris-mox-rwtm, ti,prm-inst
 
 - Add bindings for Freescale AVIC, Realtek RTD1xxx system controllers,
   Microchip 25AA010A EEPROM, OnSemi FIN3385, IEI WT61P803 PUZZLE, Delta
   Electronics DPS-800-AB power supply, Infineon IR35221 Digital
   Multi-phase Controller, Infineon PXE1610 Digital Dual Output 6+1
   VR12.5 & VR13 CPU Controller, socionext,uniphier-smpctrl, and
   xlnx,zynqmp-firmware
 
 - Lots of trivial binding fixes to address warnings in DTS files. These
   are mostly for arm64 platforms which is getting closer to be warning
   free. Some public shaming has helped.
 
 - Fix I2C bus node names in examples
 
 - Drop obsolete brcm,vulcan-soc binding
 
 - Drop unreferenced binding headers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmmNLZEACgkQ+vtdtY28
 YcPa+A/+Lpf1FLau//mfndvkzRUvuU5aF3eJdL1FPxfC64Js2cb9ZGSoEK+YDjaV
 XzNIi2Z1j+i4+uf5MTvyGaqaVx3PcQBcQtb7pu+W1pt2KiOzfVqn66EmRsY3b4cc
 twyOwx2sZMTOZambUfZreWwEl6uJiMowIbcLCsnVWihoiGVTnMpnV/jLcO9jISaP
 fe42FX9qN4NL2QqWwcREYuWMuOH7MkHDRNpEhTouWosdmFCp3PkVZcuWv3NKjGMg
 /tsH5X9QMr972A9s8Zk36ijvTv7NN+9t1GOtPS9KGpbwJmyPHr38mG1fsj+P0rY7
 rOXRnT2PScN6kvKZuw0Rex5xeMxrQCzRkFLzyfq2LOsE0GAUyyR3qysNOdH8xO3Z
 3TVMGVaelYw5T+ahie1+gf/H/t+8hGhX3teCo8ORFNYo7oLsA9qNclfd5SW2Acat
 pPK80PXkqTRsQ9lVGfytPZJ+m5OhcTIBdI9ieEXk/kryDAL4dHcB2IIVHM2/qm50
 aGW0Kh0d61Roe0PZ5GEqI/yWPVHZroXEBxT61tDKwPyGawcq4Gs3Sftd6RXbLi8h
 +T6HzkHPZFlKaiLmBC1wqXnEKLd8h72qNjjDdXbRBdLXW6S5hGPtPiLv18ArlmmR
 4eiFX1Tr+pUAt2W/IwZb9H84mGkbJODbI62x9k9rst/vLeHmnjs=
 =RE7t
 -----END PGP SIGNATURE-----

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

Pull devicetree updates from Rob Herring:
 "DT core:

   - Sync dtc/libfdt with upstream v1.7.2-62-ga26ef6400bd8

   - Add a for_each_compatible_node_scoped() loop and convert users in
     cpufreq, dmaengine, clk, cdx, powerpc and Arm

   - Simplify of/platform.c with scoped loop helpers

   - Add fw_devlink tracking for "mmc-pwrseq"

   - Optimize fw_devlink callback code size for pinctrl-N properties

   - Replace strcmp_suffix() with strends()

  DT bindings:

   - Support building single binding targets

   - Convert google,goldfish-fb, cznic,turris-mox-rwtm, ti,prm-inst

   - Add bindings for Freescale AVIC, Realtek RTD1xxx system
     controllers, Microchip 25AA010A EEPROM, OnSemi FIN3385, IEI
     WT61P803 PUZZLE, Delta Electronics DPS-800-AB power supply,
     Infineon IR35221 Digital Multi-phase Controller, Infineon PXE1610
     Digital Dual Output 6+1 VR12.5 & VR13 CPU Controller,
     socionext,uniphier-smpctrl, and xlnx,zynqmp-firmware

   - Lots of trivial binding fixes to address warnings in DTS files.
     These are mostly for arm64 platforms which is getting closer to be
     warning free. Some public shaming has helped.

   - Fix I2C bus node names in examples

   - Drop obsolete brcm,vulcan-soc binding

   - Drop unreferenced binding headers"

* tag 'devicetree-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (60 commits)
  dt-bindings: interrupt-controller: Add compatiblie string fsl,imx(1|25|27|31|35)-avic
  dt-bindings: soc: imx: add fsl,aips and fsl,emi compatible strings
  dt-bindings: display: bridge: lt8912b: Drop reset gpio requirement
  dt-bindings: firmware: fsl,scu: Mark multi-channel MU layouts as deprecated
  cpufreq: s5pv210: Simplify with scoped for each OF child loop
  dmaengine: fsl_raid: Simplify with scoped for each OF child loop
  clk: imx: imx31: Simplify with scoped for each OF child loop
  clk: imx: imx27: Simplify with scoped for each OF child loop
  cdx: Use mutex guard to simplify error handling
  cdx: Simplify with scoped for each OF child loop
  powerpc/wii: Simplify with scoped for each OF child loop
  powerpc/fsp2: Simplify with scoped for each OF child loop
  ARM: exynos: Simplify with scoped for each OF child loop
  ARM: at91: Simplify with scoped for each OF child loop
  of: Add for_each_compatible_node_scoped() helper
  dt-bindings: Fix emails with spaces or missing brackets
  scripts/dtc: Update to upstream version v1.7.2-62-ga26ef6400bd8
  dt-bindings: crypto: inside-secure,safexcel: Mandate only ring IRQs
  dt-bindings: crypto: inside-secure,safexcel: Add SoC compatibles
  of: reserved_mem: Fix placement of __free() annotation
  ...
This commit is contained in:
Linus Torvalds 2026-02-11 18:27:08 -08:00
commit 098b6e44cb
97 changed files with 1255 additions and 1838 deletions

View file

@ -259,6 +259,7 @@ ForEachMacros:
- 'for_each_collection'
- 'for_each_comp_order'
- 'for_each_compatible_node'
- 'for_each_compatible_node_scoped'
- 'for_each_component_dais'
- 'for_each_component_dais_safe'
- 'for_each_conduit'

View file

@ -56,7 +56,6 @@ DT_DOCS = $(patsubst $(srctree)/%,%,$(shell $(find_all_cmd)))
override DTC_FLAGS := \
-Wno-avoid_unnecessary_addr_size \
-Wno-graph_child_address \
-Wno-unique_unit_address \
-Wunique_unit_address_if_enabled
@ -82,5 +81,8 @@ clean-files = $(shell find $(obj) \( -name '*.example.dts' -o \
dt_compatible_check: $(obj)/processed-schema.json
$(Q)$(srctree)/scripts/dtc/dt-extract-compatibles $(srctree) | xargs dt-check-compatible -v -s $<
PHONY += dt_binding_check_one
dt_binding_check_one: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked
PHONY += dt_binding_check
dt_binding_check: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked $(CHK_DT_EXAMPLES)
dt_binding_check: dt_binding_check_one $(CHK_DT_EXAMPLES)

View file

@ -157,6 +157,12 @@ patternProperties:
- const: simple-bus
- const: simple-bus
"#interrupt-cells":
const: 1
interrupt-map: true
interrupt-map-mask: true
patternProperties:
'^motherboard-bus@':
type: object

View file

@ -1,24 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/bcm/brcm,vulcan-soc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Broadcom Vulcan
maintainers:
- Robert Richter <rrichter@marvell.com>
properties:
$nodename:
const: '/'
compatible:
items:
- enum:
- brcm,vulcan-eval
- cavium,thunderx2-cn9900
- const: brcm,vulcan-soc
additionalProperties: true
...

View file

@ -65,6 +65,11 @@ properties:
gpio-line-names:
minItems: 8
patternProperties:
'-hog$':
required:
- gpio-hog
required:
- compatible
- gpio-controller
@ -87,6 +92,9 @@ properties:
- compatible
- "#reset-cells"
power:
$ref: /schemas/power/raspberrypi,bcm2835-power.yaml#
pwm:
type: object
additionalProperties: false

View file

@ -1,31 +0,0 @@
OMAP PRM instance bindings
Power and Reset Manager is an IP block on OMAP family of devices which
handle the power domains and their current state, and provide reset
handling for the domains and/or separate IP blocks under the power domain
hierarchy.
Required properties:
- compatible: Must contain one of the following:
"ti,am3-prm-inst"
"ti,am4-prm-inst"
"ti,omap4-prm-inst"
"ti,omap5-prm-inst"
"ti,dra7-prm-inst"
and additionally must contain:
"ti,omap-prm-inst"
- reg: Contains PRM instance register address range
(base address and length)
Optional properties:
- #power-domain-cells: Should be 0 if the instance is a power domain provider.
- #reset-cells: Should be 1 if the PRM instance in question supports resets.
Example:
prm_dsp2: prm@1b00 {
compatible = "ti,dra7-prm-inst", "ti,omap-prm-inst";
reg = <0x1b00 0x40>;
#power-domain-cells = <0>;
#reset-cells = <1>;
};

View file

@ -0,0 +1,55 @@
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/ti/ti,omap-prm-inst.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: OMAP PRM instances
maintainers:
- Aaro Koskinen <aaro.koskinen@iki.fi>
- Andreas Kemnade <andreas@kemnade.info>
- Kevin Hilman <khilman@baylibre.com>
- Roger Quadros <rogerq@kernel.org>
- Tony Lindgren <tony@atomide.com>
description:
Power and Reset Manager is an IP block on OMAP family of devices which
handle the power domains and their current state, and provide reset
handling for the domains and/or separate IP blocks under the power domain
hierarchy.
properties:
compatible:
items:
- enum:
- ti,am3-prm-inst
- ti,am4-prm-inst
- ti,omap4-prm-inst
- ti,omap5-prm-inst
- ti,dra7-prm-inst
- const: ti,omap-prm-inst
reg:
maxItems: 1
"#power-domain-cells":
const: 0
"#reset-cells":
const: 1
required:
- compatible
- reg
additionalProperties: false
examples:
- |
reset-controller@1b00 {
compatible = "ti,dra7-prm-inst", "ti,omap-prm-inst";
reg = <0x1b00 0x40>;
#power-domain-cells = <0>;
#reset-cells = <1>;
};

View file

@ -103,7 +103,7 @@ required:
- arm,vexpress,config-bridge
patternProperties:
'clk[0-9]*$':
'^clock-controller.*$':
type: object
description:
clocks
@ -137,7 +137,7 @@ patternProperties:
- arm,vexpress-sysreg,func
- "#clock-cells"
"^volt-.+$":
"^regulator-.+$":
$ref: /schemas/regulator/regulator.yaml#
properties:
compatible:
@ -272,7 +272,7 @@ examples:
compatible = "arm,vexpress,config-bus";
arm,vexpress,config-bridge = <&v2m_sysreg>;
clk0 {
clock-controller {
compatible = "arm,vexpress-osc";
arm,vexpress-sysreg,func = <1 0>;
#clock-cells = <0>;

View file

@ -17,8 +17,10 @@ description: |
properties:
compatible:
enum:
- aspeed,ast2600-ahbc
items:
- enum:
- aspeed,ast2600-ahbc
- const: syscon
reg:
maxItems: 1
@ -32,6 +34,6 @@ additionalProperties: false
examples:
- |
ahbc@1e600000 {
compatible = "aspeed,ast2600-ahbc";
compatible = "aspeed,ast2600-ahbc", "syscon";
reg = <0x1e600000 0x100>;
};

View file

@ -19,21 +19,29 @@ description: |
the SDMA can access. There are no special clocks for the bus, because
the SDMA controller itself has its interrupt and clock assignments.
EMI (External Memory Interface) for legacy i.MX35.
select:
properties:
compatible:
contains:
const: fsl,spba-bus
enum:
- fsl,aips
- fsl,emi
- fsl,spba-bus
required:
- compatible
properties:
$nodename:
pattern: "^spba-bus(@[0-9a-f]+)?$"
pattern: "^((spba|emi)-bus|bus)(@[0-9a-f]+)?$"
compatible:
items:
- const: fsl,spba-bus
- enum:
- fsl,aips
- fsl,emi
- fsl,spba-bus
- const: simple-bus
'#address-cells':

View file

@ -54,7 +54,7 @@ properties:
const: 1
"#size-cells":
const: 1
enum: [ 1, 2 ]
ranges: true

View file

@ -30,11 +30,17 @@ properties:
interrupts:
maxItems: 1
aspeed,ahbc:
$ref: /schemas/types.yaml#/definitions/phandle
description:
A phandle to the AHB controller node, which must be a syscon
required:
- compatible
- reg
- clocks
- interrupts
- aspeed,ahbc
additionalProperties: false
@ -46,4 +52,5 @@ examples:
reg = <0x1e6fa000 0x400>, <0x1e710000 0x1800>;
interrupts = <160>;
clocks = <&syscon ASPEED_CLK_GATE_RSACLK>;
aspeed,ahbc = <&ahbc>;
};

View file

@ -12,6 +12,14 @@ maintainers:
properties:
compatible:
oneOf:
- items:
- const: marvell,armada-cp110-crypto
- const: inside-secure,safexcel-eip197b
- items:
- enum:
- marvell,armada-3700-crypto
- mediatek,mt7986-crypto
- const: inside-secure,safexcel-eip97ies
- const: inside-secure,safexcel-eip197b
- const: inside-secure,safexcel-eip197d
- const: inside-secure,safexcel-eip97ies
@ -26,9 +34,11 @@ properties:
maxItems: 1
interrupts:
minItems: 4
maxItems: 6
interrupt-names:
minItems: 4
items:
- const: ring0
- const: ring1
@ -65,6 +75,18 @@ allOf:
minItems: 2
required:
- clock-names
- if:
properties:
compatible:
not:
contains:
const: mediatek,mt7986-crypto
then:
properties:
interrupts:
minItems: 6
interrupt-names:
minItems: 6
additionalProperties: false

View file

@ -59,6 +59,7 @@ required:
- compatible
- clocks
- ports
- reg
allOf:
- if:
@ -73,6 +74,15 @@ allOf:
ports:
properties:
port@2: false
- if:
not:
properties:
compatible:
contains:
const: fsl,imx6sx-ldb
then:
required:
- reg-names
additionalProperties: false

View file

@ -79,7 +79,6 @@ properties:
required:
- compatible
- reg
- reset-gpios
- ports
additionalProperties: false

View file

@ -33,6 +33,7 @@ properties:
oneOf:
- items:
- enum:
- onnn,fin3385 # OnSemi FIN3385
- ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer
- ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer
- ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter

View file

@ -19,6 +19,9 @@ properties:
interrupts:
maxItems: 1
clocks:
maxItems: 1
video-ports:
$ref: /schemas/types.yaml#/definitions/uint32
default: 0x230145

View file

@ -117,7 +117,7 @@ properties:
- 1 # 3.5dB pre-emphasis
- 2 # 6dB pre-emphasis
oneOf:
anyOf:
- required:
- port@0
- required:

View file

@ -1,17 +0,0 @@
Android Goldfish framebuffer
Android Goldfish framebuffer device used by Android emulator.
Required properties:
- compatible : should contain "google,goldfish-fb"
- reg : <registers mapping>
- interrupts : <interrupt mapping>
Example:
display-controller@1f008000 {
compatible = "google,goldfish-fb";
interrupts = <0x10>;
reg = <0x1f008000 0x100>;
};

View file

@ -0,0 +1,38 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/google,goldfish-fb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Android Goldfish Framebuffer
maintainers:
- Kuan-Wei Chiu <visitorckw@gmail.com>
description:
Android Goldfish framebuffer device used by Android emulator.
properties:
compatible:
const: google,goldfish-fb
reg:
maxItems: 1
interrupts:
maxItems: 1
required:
- compatible
- reg
- interrupts
additionalProperties: false
examples:
- |
display@1f008000 {
compatible = "google,goldfish-fb";
reg = <0x1f008000 0x100>;
interrupts = <16>;
};

View file

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek mt8186 DSP core
maintainers:
- Tinghan Shen <tinghan.shen@mediatek.com>
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
description: |
MediaTek mt8186 SoC contains a DSP core used for

View file

@ -31,6 +31,7 @@ properties:
- fujitsu,mb85rs1mt
- fujitsu,mb85rs256
- fujitsu,mb85rs64
- microchip,25aa010a
- microchip,at25160bn
- microchip,25lc040
- st,m95m02

View file

@ -50,7 +50,7 @@ additionalProperties: false
examples:
- |+
#include <dt-bindings/interrupt-controller/irq.h>
i2c1 {
i2c {
clock-frequency = <400000>;
#address-cells = <1>;

View file

@ -1,19 +0,0 @@
Turris Mox rWTM firmware driver
Required properties:
- compatible : Should be "cznic,turris-mox-rwtm"
- mboxes : Must contain a reference to associated mailbox
This device tree node should be used on Turris Mox, or potentially another A3700
compatible device running the Mox's rWTM firmware in the secure processor (for
example it is possible to flash this firmware into EspressoBin).
Example:
firmware {
turris-mox-rwtm {
compatible = "cznic,turris-mox-rwtm";
mboxes = <&rwtm 0>;
status = "okay";
};
};

View file

@ -0,0 +1,40 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/firmware/cznic,turris-mox-rwtm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: CZ.NIC Turris Mox rWTM firmware
maintainers:
- Marek Behún <kabel@kernel.org>
description:
This device tree node should be used on Turris Mox, or potentially another
A3700 compatible device running the Mox's rWTM firmware in the secure
processor (for example it is possible to flash this firmware into
EspressoBin).
properties:
compatible:
oneOf:
- items:
- const: marvell,armada-3700-rwtm-firmware
- const: cznic,turris-mox-rwtm
- const: marvell,armada-3700-rwtm-firmware
mboxes:
maxItems: 1
required:
- compatible
- mboxes
additionalProperties: false
examples:
- |
turris-mox-rwtm {
compatible = "marvell,armada-3700-rwtm-firmware", "cznic,turris-mox-rwtm";
mboxes = <&rwtm 0>;
};

View file

@ -76,7 +76,8 @@ properties:
- description: TX0 MU channel
- description: RX0 MU channel
- description: optional MU channel for general interrupt
- items:
- deprecated: true
items:
- description: TX0 MU channel
- description: TX1 MU channel
- description: TX2 MU channel
@ -85,7 +86,8 @@ properties:
- description: RX1 MU channel
- description: RX2 MU channel
- description: RX3 MU channel
- items:
- deprecated: true
items:
- description: TX0 MU channel
- description: TX1 MU channel
- description: TX2 MU channel
@ -105,7 +107,8 @@ properties:
- const: tx0
- const: rx0
- const: gip3
- items:
- deprecated: true
items:
- const: tx0
- const: tx1
- const: tx2
@ -114,7 +117,8 @@ properties:
- const: rx1
- const: rx2
- const: rx3
- items:
- deprecated: true
items:
- const: tx0
- const: tx1
- const: tx2
@ -167,11 +171,9 @@ examples:
firmware {
system-controller {
compatible = "fsl,imx-scu";
mbox-names = "tx0", "tx1", "tx2", "tx3",
"rx0", "rx1", "rx2", "rx3",
"gip3";
mboxes = <&lsio_mu1 0 0 &lsio_mu1 0 1 &lsio_mu1 0 2 &lsio_mu1 0 3
&lsio_mu1 1 0 &lsio_mu1 1 1 &lsio_mu1 1 2 &lsio_mu1 1 3
mbox-names = "tx0", "rx0", "gip3";
mboxes = <&lsio_mu1 0 0
&lsio_mu1 1 0
&lsio_mu1 3 3>;
clock-controller {

View file

@ -76,7 +76,6 @@ properties:
type: object
pinctrl:
$ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
description: The pinctrl node provides access to pinconfig and pincontrol
functionality available in firmware.
type: object
@ -106,6 +105,21 @@ properties:
type: object
deprecated: true
allOf:
- if:
properties:
compatible:
contains:
const: xlnx,zynqmp-firmware
then:
properties:
pinctrl:
$ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
else:
properties:
pinctrl:
$ref: /schemas/pinctrl/xlnx,versal-pinctrl.yaml#
required:
- compatible
@ -116,6 +130,7 @@ examples:
#include <dt-bindings/power/xlnx-zynqmp-power.h>
firmware {
zynqmp_firmware: zynqmp-firmware {
compatible = "xlnx,zynqmp-firmware";
#power-domain-cells = <1>;
soc-nvmem {
compatible = "xlnx,zynqmp-nvmem-fw";
@ -163,6 +178,10 @@ examples:
compatible = "xlnx,versal-fpga";
};
pinctrl {
compatible = "xlnx,versal-pinctrl";
};
xlnx_aes: zynqmp-aes {
compatible = "xlnx,zynqmp-aes";
};

View file

@ -0,0 +1,59 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: IEI WT61P803 PUZZLE MCU HWMON module from IEI Integration Corp.
maintainers:
- Luka Kovacic <luka.kovacic@sartura.hr>
description: |
This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details
see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml.
The HWMON module is a sub-node of the MCU node in the Device Tree.
properties:
compatible:
const: iei,wt61p803-puzzle-hwmon
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
'^fan-group@[0-1]$':
type: object
additionalProperties: false
properties:
reg:
minimum: 0
maximum: 1
description:
Fan group ID
'#cooling-cells':
const: 2
cooling-levels:
minItems: 1
maxItems: 255
description:
Cooling levels for the fans (PWM value mapping)
required:
- reg
- '#cooling-cells'
- cooling-levels
required:
- compatible
- '#address-cells'
- '#size-cells'
additionalProperties: false

View file

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Sensirion SHTC1 Humidity and Temperature Sensor IC
maintainers:
- Christopher Ruehl chris.ruehl@gtsys.com.hk
- Christopher Ruehl <chris.ruehl@gtsys.com.hk>
description: |
The SHTC1, SHTW1 and SHTC3 are digital humidity and temperature sensors

View file

@ -8,7 +8,7 @@ title: Synaptics RMI4 compliant devices
maintainers:
- Jason A. Donenfeld <Jason@zx2c4.com>
- Matthias Schiffer <matthias.schiffer@ew.tq-group.com
- Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
- Vincent Huang <vincent.huang@tw.synaptics.com>
description: |

View file

@ -12,6 +12,14 @@ maintainers:
properties:
compatible:
oneOf:
- items:
- enum:
- fsl,imx1-aitc
- fsl,imx25-asic
- fsl,imx27-aitc
- fsl,imx31-avic
- fsl,imx35-avic
- const: fsl,avic
- items:
- enum:
- fsl,imx51-tzic

View file

@ -29,6 +29,9 @@ properties:
interrupts:
maxItems: 1
'#address-cells':
const: 0
interrupt-controller: true
'#interrupt-cells':

View file

@ -40,6 +40,9 @@ properties:
- const: isr1
minItems: 2
'#address-cells':
const: 0
interrupt-controller: true
interrupts:

View file

@ -29,6 +29,9 @@ properties:
minimum: 0
maximum: 192
'#address-cells':
const: 0
interrupt-controller: true
'#interrupt-cells':

View file

@ -0,0 +1,41 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/iei,wt61p803-puzzle-leds.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: IEI WT61P803 PUZZLE MCU LED module from IEI Integration Corp.
maintainers:
- Luka Kovacic <luka.kovacic@sartura.hr>
description: |
This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details
see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml.
The LED module is a sub-node of the MCU node in the Device Tree.
properties:
compatible:
const: iei,wt61p803-puzzle-leds
'#address-cells':
const: 1
'#size-cells':
const: 0
led@0:
$ref: common.yaml
unevaluatedProperties: false
properties:
reg:
const: 0
required:
- compatible
- '#address-cells'
- '#size-cells'
additionalProperties: false

View file

@ -95,7 +95,7 @@ examples:
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/media/video-interfaces.h>
i2c0 {
i2c {
#address-cells = <1>;
#size-cells = <0>;

View file

@ -9,7 +9,7 @@ title: Samsung Exynos SoC G-Scaler
maintainers:
- Inki Dae <inki.dae@samsung.com>
- Krzysztof Kozlowski <krzk@kernel.org>
- Seung-Woo Kim <sw0312.kim@samsung.com
- Seung-Woo Kim <sw0312.kim@samsung.com>
description:
G-Scaler is used for scaling and color space conversion on Samsung Exynos

View file

@ -0,0 +1,80 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/iei,wt61p803-puzzle.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: IEI WT61P803 PUZZLE MCU from IEI Integration Corp.
maintainers:
- Luka Kovacic <luka.kovacic@sartura.hr>
description: |
IEI WT61P803 PUZZLE MCU is embedded in some IEI Puzzle series boards.
It's used for controlling system power states, fans, LEDs and temperature
sensors.
For Device Tree bindings of other sub-modules (HWMON, LEDs) refer to the
binding documents under the respective subsystem directories.
properties:
compatible:
const: iei,wt61p803-puzzle
current-speed: true
enable-beep:
type: boolean
hwmon:
$ref: /schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml
leds:
$ref: /schemas/leds/iei,wt61p803-puzzle-leds.yaml
required:
- compatible
- current-speed
additionalProperties: false
examples:
- |
#include <dt-bindings/leds/common.h>
serial {
mcu {
compatible = "iei,wt61p803-puzzle";
current-speed = <115200>;
enable-beep;
leds {
compatible = "iei,wt61p803-puzzle-leds";
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
function = LED_FUNCTION_POWER;
color = <LED_COLOR_ID_BLUE>;
};
};
hwmon {
compatible = "iei,wt61p803-puzzle-hwmon";
#address-cells = <1>;
#size-cells = <0>;
fan-group@0 {
#cooling-cells = <2>;
reg = <0x00>;
cooling-levels = <64 102 170 230 250>;
};
fan-group@1 {
#cooling-cells = <2>;
reg = <0x01>;
cooling-levels = <64 102 170 230 250>;
};
};
};
};

View file

@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek System Control Processor System
maintainers:
- MandyJH Liu <mandyjh.liu@mediatek.com>
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
- Matthias Brugger <matthias.bgg@gmail.com>
description:
MediaTek System Control Processor System (SCPSYS) has several

View file

@ -0,0 +1,69 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/realtek,rtd1xxx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Realtek RTD1xxx system controllers
maintainers:
- Andreas Färber <afaerber@suse.de>
properties:
compatible:
items:
- enum:
- realtek,rtd1293-crt
- realtek,rtd1293-iso
- realtek,rtd1293-misc
- realtek,rtd1293-sb2
- realtek,rtd1293-scpu-wrapper
- realtek,rtd1295-crt
- realtek,rtd1295-iso
- realtek,rtd1295-misc
- realtek,rtd1295-sb2
- realtek,rtd1295-scpu-wrapper
- realtek,rtd1296-crt
- realtek,rtd1296-iso
- realtek,rtd1296-misc
- realtek,rtd1296-sb2
- realtek,rtd1296-scpu-wrapper
- realtek,rtd1395-crt
- realtek,rtd1395-iso
- realtek,rtd1395-misc
- realtek,rtd1395-sb2
- realtek,rtd1395-scpu-wrapper
- realtek,rtd1619-crt
- realtek,rtd1619-iso
- realtek,rtd1619-misc
- realtek,rtd1619-sb2
- realtek,rtd1619-scpu-wrapper
- const: syscon
- const: simple-mfd
reg:
maxItems: 1
reg-io-width:
const: 4
ranges: true
'#address-cells':
const: 1
'#size-cells':
const: 1
patternProperties:
'@[0-9a-f]+$':
type: object
required:
- compatible
required:
- compatible
- reg
additionalProperties: false

View file

@ -73,6 +73,8 @@ properties:
- const: idm_base
- const: nicpm_base
dma-coherent: true
unevaluatedProperties: false
examples:

View file

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mobiveil AXI PCIe Host Bridge
maintainers:
- Frank Li <Frank Li@nxp.com>
- Frank Li <Frank.Li@nxp.com>
description:
Mobiveil's GPEX 4.0 is a PCIe Gen4 host bridge IP. This configurable IP

View file

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek Power Domains Controller
maintainers:
- MandyJH Liu <mandyjh.liu@mediatek.com>
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
- Matthias Brugger <mbrugger@suse.com>
description: |

View file

@ -23,6 +23,9 @@ properties:
compatible:
const: syscon-poweroff
reg:
maxItems: 1
mask:
$ref: /schemas/types.yaml#/definitions/uint32
description: Update only the register bits defined by the mask (32 bit).
@ -44,7 +47,10 @@ properties:
required:
- compatible
- offset
anyOf:
- required: [offset]
- required: [reg]
additionalProperties: false

View file

@ -79,7 +79,7 @@ allOf:
required:
- value
oneOf:
anyOf:
- required: [offset]
- required: [reg]

View file

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek SCP
maintainers:
- Tinghan Shen <tinghan.shen@mediatek.com>
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
description:
This binding provides support for ARM Cortex M4 Co-processor found on some

View file

@ -15,8 +15,8 @@ I. For patch submitters
"dt-bindings: <binding dir>: ..."
Few subsystems, like ASoC, media, regulators and SPI, expect reverse order
of the prefixes::
Few subsystems, like ASoC, media, regulators, SCSI, SPI and UFS, expect
reverse order of the prefixes, based on subsystem name::
"<binding dir>: dt-bindings: ..."

View file

@ -91,6 +91,8 @@ properties:
- delta,ahe50dc-fan
# Delta Electronics DPS-650-AB power supply
- delta,dps650ab
# Delta Electronics DPS-800-AB power supply
- delta,dps800
# Delta Electronics DPS920AB 920W 54V Power Supply
- delta,dps920ab
# 1/4 Brick DC/DC Regulated Power Module
@ -135,10 +137,14 @@ properties:
- ibm,cffps2
# IBM On-Chip Controller hwmon device
- ibm,p8-occ-hwmon
# Infineon Digital Multi-phase Controller
- infineon,ir35221
# Infineon IR36021 digital POL buck controller
- infineon,ir36021
# Infineon IRPS5401 Voltage Regulator (PMIC)
- infineon,irps5401
# Infineon Digital Dual Output 6+1 VR12.5 & VR13 CPU Controller
- infineon,pxe1610
# Infineon Hot-swap controller xdp710
- infineon,xdp710
# Infineon Multi-phase Digital VR Controller xdpe11280
@ -418,6 +424,8 @@ properties:
- smsc,emc6d103
# Temperature sensor with integrated fan control
- smsc,emc6d103s
# Socionext Uniphier SMP control registers
- socionext,uniphier-smpctrl
# SparkFun Qwiic Joystick (COM-15168) with i2c interface
- sparkfun,qwiic-joystick
# STMicroelectronics Hot-swap controller stef48h28

View file

@ -49,7 +49,7 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c2 {
i2c {
#address-cells = <1>;
#size-cells = <0>;

View file

@ -214,6 +214,10 @@ binding schema. All of the DT binding documents can be validated using the
make dt_binding_check
Or to validate a single schema and its example::
make sram/sram.yaml
In order to perform validation of DT source files, use the ``dtbs_check`` target::
make dtbs_check
@ -226,10 +230,10 @@ It is possible to run both in a single command::
make dt_binding_check dtbs_check
It is also possible to run checks with a subset of matching schema files by
setting the ``DT_SCHEMA_FILES`` variable to 1 or more specific schema files or
patterns (partial match of a fixed string). Each file or pattern should be
separated by ':'.
It is also possible to combine running the above commands with a subset of
matching schema files by setting the ``DT_SCHEMA_FILES`` variable to 1 or more
specific schema files or patterns (partial match of a fixed string). Each file
or pattern should be separated by ':'.
::

View file

@ -2728,7 +2728,7 @@ F: Documentation/ABI/testing/sysfs-bus-i2c-devices-turris-omnia-mcu
F: Documentation/ABI/testing/sysfs-bus-moxtet-devices
F: Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm
F: Documentation/devicetree/bindings/bus/cznic,moxtet.yaml
F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml
F: Documentation/devicetree/bindings/firmware/cznic,turris-omnia-mcu.yaml
F: Documentation/devicetree/bindings/interrupt-controller/marvell,mpic.yaml
F: Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml
@ -5776,13 +5776,6 @@ S: Supported
W: http://www.marvell.com
F: drivers/crypto/cavium/cpt/
CAVIUM THUNDERX2 ARM64 SOC
M: Robert Richter <rric@kernel.org>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Odd Fixes
F: Documentation/devicetree/bindings/arm/bcm/brcm,vulcan-soc.yaml
F: arch/arm64/boot/dts/cavium/thunder2-99xx*
CBS/ETF/TAPRIO QDISCS
M: Vinicius Costa Gomes <vinicius.gomes@intel.com>
L: netdev@vger.kernel.org
@ -19720,6 +19713,7 @@ F: include/linux/of*.h
F: rust/helpers/of.c
F: rust/kernel/of.rs
F: scripts/dtc/
F: scripts/Makefile.dtb*
F: tools/testing/selftests/dt/
K: of_overlay_notifier_
K: of_overlay_fdt_apply

View file

@ -1529,6 +1529,12 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
dtstree := arch/$(SRCARCH)/boot/dts
endif
dtbindingtree := Documentation/devicetree/bindings
%.yaml: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtbindingtree) \
$(dtbindingtree)/$(patsubst %.yaml,%.example.dtb,$@) dt_binding_check_one
ifneq ($(dtstree),)
%.dtb: dtbs_prepare
@ -1546,7 +1552,7 @@ dtbs: dtbs_prepare
# dtbs_install depend on it as dtbs_install may run as root.
dtbs_prepare: include/config/kernel.release scripts_dtc
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
ifneq ($(filter dtbs_check %.yaml, $(MAKECMDGOALS)),)
export CHECK_DTBS=y
endif
@ -1579,14 +1585,14 @@ endif
PHONY += dt_binding_check dt_binding_schemas
dt_binding_check: dt_binding_schemas scripts_dtc
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@
$(Q)$(MAKE) $(build)=$(dtbindingtree) $@
dt_binding_schemas:
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
$(Q)$(MAKE) $(build)=$(dtbindingtree)
PHONY += dt_compatible_check
dt_compatible_check: dt_binding_schemas
$(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@
$(Q)$(MAKE) $(build)=$(dtbindingtree) $@
# ---------------------------------------------------------------------------
# Modules

View file

@ -982,15 +982,12 @@ static void __init at91_pm_sram_init(void)
struct gen_pool *sram_pool;
phys_addr_t sram_pbase;
unsigned long sram_base;
struct device_node *node;
struct platform_device *pdev = NULL;
for_each_compatible_node(node, NULL, "mmio-sram") {
for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
pdev = of_find_device_by_node(node);
if (pdev) {
of_node_put(node);
if (pdev)
break;
}
}
if (!pdev) {

View file

@ -47,9 +47,7 @@ unsigned int exynos_rev(void)
void __init exynos_sysram_init(void)
{
struct device_node *node;
for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") {
for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram") {
struct resource res;
if (!of_device_is_available(node))
continue;
@ -57,15 +55,13 @@ void __init exynos_sysram_init(void)
of_address_to_resource(node, 0, &res);
sysram_base_addr = ioremap(res.start, resource_size(&res));
sysram_base_phys = res.start;
of_node_put(node);
break;
}
for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") {
for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") {
if (!of_device_is_available(node))
continue;
sysram_ns_base_addr = of_iomap(node, 0);
of_node_put(node);
break;
}
}

View file

@ -199,16 +199,14 @@ static irqreturn_t rst_wrn_handler(int irq, void *data) {
static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler)
{
struct device_node *np;
unsigned int irq;
int32_t rc;
for_each_compatible_node(np, NULL, compat) {
for_each_compatible_node_scoped(np, NULL, compat) {
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
pr_err("device tree node %pOFn is missing a interrupt",
np);
of_node_put(np);
return;
}
@ -216,7 +214,6 @@ static void __init node_irq_request(const char *compat, irq_handler_t errirq_han
if (rc) {
pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
np, rc);
of_node_put(np);
return;
}
}

View file

@ -201,11 +201,10 @@ unsigned int hlwd_pic_get_irq(void)
void __init hlwd_pic_probe(void)
{
struct irq_domain *host;
struct device_node *np;
const u32 *interrupts;
int cascade_virq;
for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") {
for_each_compatible_node_scoped(np, NULL, "nintendo,hollywood-pic") {
interrupts = of_get_property(np, "interrupts", NULL);
if (interrupts) {
host = hlwd_pic_init(np);
@ -215,7 +214,6 @@ void __init hlwd_pic_probe(void)
irq_set_chained_handler(cascade_virq,
hlwd_pic_irq_cascade);
hlwd_irq_host = host;
of_node_put(np);
break;
}
}

View file

@ -608,7 +608,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
{
struct cdx_controller *cdx;
struct platform_device *pd;
struct device_node *np;
bool val;
if (kstrtobool(buf, &val) < 0)
@ -617,19 +616,16 @@ static ssize_t rescan_store(const struct bus_type *bus,
if (!val)
return -EINVAL;
mutex_lock(&cdx_controller_lock);
guard(mutex)(&cdx_controller_lock);
/* Unregister all the devices on the bus */
cdx_unregister_devices(&cdx_bus_type);
/* Rescan all the devices */
for_each_compatible_node(np, NULL, compat_node_name) {
for_each_compatible_node_scoped(np, NULL, compat_node_name) {
pd = of_find_device_by_node(np);
if (!pd) {
of_node_put(np);
count = -EINVAL;
goto unlock;
}
if (!pd)
return -EINVAL;
cdx = platform_get_drvdata(pd);
if (cdx && cdx->controller_registered && cdx->ops->scan)
@ -638,9 +634,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
put_device(&pd->dev);
}
unlock:
mutex_unlock(&cdx_controller_lock);
return count;
}
static BUS_ATTR_WO(rescan);

View file

@ -171,17 +171,14 @@ static void __init _mx27_clocks_init(unsigned long fref)
static void __init mx27_clocks_init_dt(struct device_node *np)
{
struct device_node *refnp;
u32 fref = 26000000; /* default */
for_each_compatible_node(refnp, NULL, "fixed-clock") {
for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") {
if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
continue;
if (!of_property_read_u32(refnp, "clock-frequency", &fref)) {
of_node_put(refnp);
if (!of_property_read_u32(refnp, "clock-frequency", &fref))
break;
}
}
ccm = of_iomap(np, 0);

View file

@ -123,18 +123,15 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
static void __init mx31_clocks_init_dt(struct device_node *np)
{
struct device_node *osc_np;
u32 fref = 26000000; /* default */
void __iomem *ccm;
for_each_compatible_node(osc_np, NULL, "fixed-clock") {
for_each_compatible_node_scoped(osc_np, NULL, "fixed-clock") {
if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m"))
continue;
if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) {
of_node_put(osc_np);
if (!of_property_read_u32(osc_np, "clock-frequency", &fref))
break;
}
}
ccm = of_iomap(np, 0);

View file

@ -629,19 +629,17 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
goto err_clock;
}
for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
id = of_alias_get_id(np, "dmc");
for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") {
id = of_alias_get_id(dmc, "dmc");
if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
of_node_put(np);
dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc);
result = id;
goto err_clk_base;
}
dmc_base[id] = of_iomap(np, 0);
dmc_base[id] = of_iomap(dmc, 0);
if (!dmc_base[id]) {
dev_err(dev, "failed to map dmc%d registers\n", id);
of_node_put(np);
result = -EFAULT;
goto err_dmc;
}

View file

@ -746,7 +746,6 @@ err_free:
static int fsl_re_probe(struct platform_device *ofdev)
{
struct fsl_re_drv_private *re_priv;
struct device_node *np;
struct device_node *child;
u32 off;
u8 ridx = 0;
@ -823,11 +822,10 @@ static int fsl_re_probe(struct platform_device *ofdev)
dev_set_drvdata(dev, re_priv);
/* Parse Device tree to find out the total number of JQs present */
for_each_compatible_node(np, NULL, "fsl,raideng-v1.0-job-queue") {
for_each_compatible_node_scoped(np, NULL, "fsl,raideng-v1.0-job-queue") {
rc = of_property_read_u32(np, "reg", &off);
if (rc) {
dev_err(dev, "Reg property not found in JQ node\n");
of_node_put(np);
return -ENODEV;
}
/* Find out the Job Rings present under each JQ */

View file

@ -127,7 +127,6 @@ static void __init fdt_reserved_mem_save_node(unsigned long node, const char *un
fdt_init_reserved_mem_node(rmem);
reserved_mem_count++;
return;
}
static int __init early_init_dt_reserve_memory(phys_addr_t base,
@ -762,7 +761,7 @@ int of_reserved_mem_region_to_resource(const struct device_node *np,
if (!np)
return -EINVAL;
struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx);
struct device_node *target __free(device_node) = of_parse_phandle(np, "memory-region", idx);
if (!target || !of_device_is_available(target))
return -ENODEV;

View file

@ -394,7 +394,6 @@ int of_platform_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent)
{
struct device_node *child;
int rc = 0;
root = root ? of_node_get(root) : of_find_node_by_path("/");
@ -407,13 +406,13 @@ int of_platform_bus_probe(struct device_node *root,
/* Do a self check of bus type, if there's a match, create children */
if (of_match_node(matches, root)) {
rc = of_platform_bus_create(root, matches, NULL, parent, false);
} else for_each_child_of_node(root, child) {
if (!of_match_node(matches, child))
continue;
rc = of_platform_bus_create(child, matches, NULL, parent, false);
if (rc) {
of_node_put(child);
break;
} else {
for_each_child_of_node_scoped(root, child) {
if (!of_match_node(matches, child))
continue;
rc = of_platform_bus_create(child, matches, NULL, parent, false);
if (rc)
break;
}
}

View file

@ -21,6 +21,7 @@
#define pr_fmt(fmt) "OF: " fmt
#include <linux/ctype.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
@ -1294,17 +1295,6 @@ static struct device_node *parse_##fname(struct device_node *np, \
return parse_prop_cells(np, prop_name, index, name, cells); \
}
static int strcmp_suffix(const char *str, const char *suffix)
{
unsigned int len, suffix_len;
len = strlen(str);
suffix_len = strlen(suffix);
if (len <= suffix_len)
return -1;
return strcmp(str + len - suffix_len, suffix);
}
/**
* parse_suffix_prop_cells - Suffix property parsing function for suppliers
*
@ -1331,7 +1321,7 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np,
{
struct of_phandle_args sup_args;
if (strcmp_suffix(prop_name, suffix))
if (!strends(prop_name, suffix))
return NULL;
if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
@ -1391,15 +1381,6 @@ DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells")
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL)
DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL)
DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL)
DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL)
DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
@ -1410,13 +1391,26 @@ DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells")
DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells")
DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL)
DEFINE_SIMPLE_PROP(mmc_pwrseq, "mmc-pwrseq", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
static struct device_node *parse_pinctrl_n(struct device_node *np,
const char *prop_name, int index)
{
if (!strstarts(prop_name, "pinctrl-"))
return NULL;
if (!isdigit(prop_name[strlen("pinctrl-")]))
return NULL;
return of_parse_phandle(np, prop_name, index);
}
static struct device_node *parse_gpios(struct device_node *np,
const char *prop_name, int index)
{
if (!strcmp_suffix(prop_name, ",nr-gpios"))
if (strends(prop_name, ",nr-gpios"))
return NULL;
return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
@ -1536,15 +1530,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_nvmem_cells, },
{ .parse_prop = parse_phys, },
{ .parse_prop = parse_wakeup_parent, },
{ .parse_prop = parse_pinctrl0, },
{ .parse_prop = parse_pinctrl1, },
{ .parse_prop = parse_pinctrl2, },
{ .parse_prop = parse_pinctrl3, },
{ .parse_prop = parse_pinctrl4, },
{ .parse_prop = parse_pinctrl5, },
{ .parse_prop = parse_pinctrl6, },
{ .parse_prop = parse_pinctrl7, },
{ .parse_prop = parse_pinctrl8, },
{ .parse_prop = parse_pinctrl_n, },
{
.parse_prop = parse_remote_endpoint,
.get_con_dev = of_graph_get_port_parent,
@ -1557,6 +1543,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_msi_parent, },
{ .parse_prop = parse_pses, },
{ .parse_prop = parse_power_supplies, },
{ .parse_prop = parse_mmc_pwrseq, },
{ .parse_prop = parse_gpio_compat, },
{ .parse_prop = parse_interrupts, },
{ .parse_prop = parse_interrupt_map, },

View file

@ -804,11 +804,13 @@ static void __init of_unittest_property_copy(void)
new = __of_prop_dup(&p1, GFP_KERNEL);
unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n");
__of_prop_free(new);
if (new)
__of_prop_free(new);
new = __of_prop_dup(&p2, GFP_KERNEL);
unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n");
__of_prop_free(new);
if (new)
__of_prop_free(new);
#endif
}

View file

@ -1,19 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com>
*/
#ifndef DT_CLOCK_OXSEMI_OX810SE_H
#define DT_CLOCK_OXSEMI_OX810SE_H
#define CLK_810_LEON 0
#define CLK_810_DMA_SGDMA 1
#define CLK_810_CIPHER 2
#define CLK_810_SATA 3
#define CLK_810_AUDIO 4
#define CLK_810_USBMPH 5
#define CLK_810_ETHA 6
#define CLK_810_PCIEA 7
#define CLK_810_NAND 8
#endif /* DT_CLOCK_OXSEMI_OX810SE_H */

View file

@ -1,29 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com>
*/
#ifndef DT_CLOCK_OXSEMI_OX820_H
#define DT_CLOCK_OXSEMI_OX820_H
/* PLLs */
#define CLK_820_PLLA 0
#define CLK_820_PLLB 1
/* Gate Clocks */
#define CLK_820_LEON 2
#define CLK_820_DMA_SGDMA 3
#define CLK_820_CIPHER 4
#define CLK_820_SD 5
#define CLK_820_SATA 6
#define CLK_820_AUDIO 7
#define CLK_820_USBMPH 8
#define CLK_820_ETHA 9
#define CLK_820_PCIEA 10
#define CLK_820_NAND 11
#define CLK_820_PCIEB 12
#define CLK_820_ETHB 13
#define CLK_820_REF600 14
#define CLK_820_USBDEV 15
#endif /* DT_CLOCK_OXSEMI_OX820_H */

View file

@ -1,12 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#ifndef _DT_BINDINGS_CLK_QCOM_MSS_SC7180_H
#define _DT_BINDINGS_CLK_QCOM_MSS_SC7180_H
#define MSS_AXI_CRYPTO_CLK 0
#define MSS_AXI_NAV_CLK 1
#endif

View file

@ -1,123 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2019 Xilinx Inc.
*
*/
#ifndef _DT_BINDINGS_CLK_VERSAL_H
#define _DT_BINDINGS_CLK_VERSAL_H
#define PMC_PLL 1
#define APU_PLL 2
#define RPU_PLL 3
#define CPM_PLL 4
#define NOC_PLL 5
#define PLL_MAX 6
#define PMC_PRESRC 7
#define PMC_POSTCLK 8
#define PMC_PLL_OUT 9
#define PPLL 10
#define NOC_PRESRC 11
#define NOC_POSTCLK 12
#define NOC_PLL_OUT 13
#define NPLL 14
#define APU_PRESRC 15
#define APU_POSTCLK 16
#define APU_PLL_OUT 17
#define APLL 18
#define RPU_PRESRC 19
#define RPU_POSTCLK 20
#define RPU_PLL_OUT 21
#define RPLL 22
#define CPM_PRESRC 23
#define CPM_POSTCLK 24
#define CPM_PLL_OUT 25
#define CPLL 26
#define PPLL_TO_XPD 27
#define NPLL_TO_XPD 28
#define APLL_TO_XPD 29
#define RPLL_TO_XPD 30
#define EFUSE_REF 31
#define SYSMON_REF 32
#define IRO_SUSPEND_REF 33
#define USB_SUSPEND 34
#define SWITCH_TIMEOUT 35
#define RCLK_PMC 36
#define RCLK_LPD 37
#define WDT 38
#define TTC0 39
#define TTC1 40
#define TTC2 41
#define TTC3 42
#define GEM_TSU 43
#define GEM_TSU_LB 44
#define MUXED_IRO_DIV2 45
#define MUXED_IRO_DIV4 46
#define PSM_REF 47
#define GEM0_RX 48
#define GEM0_TX 49
#define GEM1_RX 50
#define GEM1_TX 51
#define CPM_CORE_REF 52
#define CPM_LSBUS_REF 53
#define CPM_DBG_REF 54
#define CPM_AUX0_REF 55
#define CPM_AUX1_REF 56
#define QSPI_REF 57
#define OSPI_REF 58
#define SDIO0_REF 59
#define SDIO1_REF 60
#define PMC_LSBUS_REF 61
#define I2C_REF 62
#define TEST_PATTERN_REF 63
#define DFT_OSC_REF 64
#define PMC_PL0_REF 65
#define PMC_PL1_REF 66
#define PMC_PL2_REF 67
#define PMC_PL3_REF 68
#define CFU_REF 69
#define SPARE_REF 70
#define NPI_REF 71
#define HSM0_REF 72
#define HSM1_REF 73
#define SD_DLL_REF 74
#define FPD_TOP_SWITCH 75
#define FPD_LSBUS 76
#define ACPU 77
#define DBG_TRACE 78
#define DBG_FPD 79
#define LPD_TOP_SWITCH 80
#define ADMA 81
#define LPD_LSBUS 82
#define CPU_R5 83
#define CPU_R5_CORE 84
#define CPU_R5_OCM 85
#define CPU_R5_OCM2 86
#define IOU_SWITCH 87
#define GEM0_REF 88
#define GEM1_REF 89
#define GEM_TSU_REF 90
#define USB0_BUS_REF 91
#define UART0_REF 92
#define UART1_REF 93
#define SPI0_REF 94
#define SPI1_REF 95
#define CAN0_REF 96
#define CAN1_REF 97
#define I2C0_REF 98
#define I2C1_REF 99
#define DBG_LPD 100
#define TIMESTAMP_REF 101
#define DBG_TSTMP 102
#define CPM_TOPSW_REF 103
#define USB3_DUAL_REF 104
#define OUTCLK_MAX 105
#define REF_CLK 106
#define PL_ALT_REF_CLK 107
#define MUXED_IRO 108
#define PL_EXT 109
#define PL_LB 110
#define MIO_50_OR_51 111
#define MIO_24_OR_25 112
#endif

View file

@ -1,133 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Xilinx Zynq MPSoC Firmware layer
*
* Copyright (C) 2014-2018 Xilinx, Inc.
*
*/
#ifndef _DT_BINDINGS_CLK_ZYNQMP_H
#define _DT_BINDINGS_CLK_ZYNQMP_H
/*
* These bindings are deprecated, because they do not match the actual
* concept of bindings but rather contain pure firmware values.
* Instead include the header in the DTS source directory.
*/
#warning "These bindings are deprecated. Instead use the header in the DTS source directory."
#define IOPLL 0
#define RPLL 1
#define APLL 2
#define DPLL 3
#define VPLL 4
#define IOPLL_TO_FPD 5
#define RPLL_TO_FPD 6
#define APLL_TO_LPD 7
#define DPLL_TO_LPD 8
#define VPLL_TO_LPD 9
#define ACPU 10
#define ACPU_HALF 11
#define DBF_FPD 12
#define DBF_LPD 13
#define DBG_TRACE 14
#define DBG_TSTMP 15
#define DP_VIDEO_REF 16
#define DP_AUDIO_REF 17
#define DP_STC_REF 18
#define GDMA_REF 19
#define DPDMA_REF 20
#define DDR_REF 21
#define SATA_REF 22
#define PCIE_REF 23
#define GPU_REF 24
#define GPU_PP0_REF 25
#define GPU_PP1_REF 26
#define TOPSW_MAIN 27
#define TOPSW_LSBUS 28
#define GTGREF0_REF 29
#define LPD_SWITCH 30
#define LPD_LSBUS 31
#define USB0_BUS_REF 32
#define USB1_BUS_REF 33
#define USB3_DUAL_REF 34
#define USB0 35
#define USB1 36
#define CPU_R5 37
#define CPU_R5_CORE 38
#define CSU_SPB 39
#define CSU_PLL 40
#define PCAP 41
#define IOU_SWITCH 42
#define GEM_TSU_REF 43
#define GEM_TSU 44
#define GEM0_TX 45
#define GEM1_TX 46
#define GEM2_TX 47
#define GEM3_TX 48
#define GEM0_RX 49
#define GEM1_RX 50
#define GEM2_RX 51
#define GEM3_RX 52
#define QSPI_REF 53
#define SDIO0_REF 54
#define SDIO1_REF 55
#define UART0_REF 56
#define UART1_REF 57
#define SPI0_REF 58
#define SPI1_REF 59
#define NAND_REF 60
#define I2C0_REF 61
#define I2C1_REF 62
#define CAN0_REF 63
#define CAN1_REF 64
#define CAN0 65
#define CAN1 66
#define DLL_REF 67
#define ADMA_REF 68
#define TIMESTAMP_REF 69
#define AMS_REF 70
#define PL0_REF 71
#define PL1_REF 72
#define PL2_REF 73
#define PL3_REF 74
#define WDT 75
#define IOPLL_INT 76
#define IOPLL_PRE_SRC 77
#define IOPLL_HALF 78
#define IOPLL_INT_MUX 79
#define IOPLL_POST_SRC 80
#define RPLL_INT 81
#define RPLL_PRE_SRC 82
#define RPLL_HALF 83
#define RPLL_INT_MUX 84
#define RPLL_POST_SRC 85
#define APLL_INT 86
#define APLL_PRE_SRC 87
#define APLL_HALF 88
#define APLL_INT_MUX 89
#define APLL_POST_SRC 90
#define DPLL_INT 91
#define DPLL_PRE_SRC 92
#define DPLL_HALF 93
#define DPLL_INT_MUX 94
#define DPLL_POST_SRC 95
#define VPLL_INT 96
#define VPLL_PRE_SRC 97
#define VPLL_HALF 98
#define VPLL_INT_MUX 99
#define VPLL_POST_SRC 100
#define CAN0_MIO 101
#define CAN1_MIO 102
#define ACPU_FULL 103
#define GEM0_REF 104
#define GEM1_REF 105
#define GEM2_REF 106
#define GEM3_REF 107
#define GEM0_REF_UNG 108
#define GEM1_REF_UNG 109
#define GEM2_REF_UNG 110
#define GEM3_REF_UNG 111
#define LPD_WDT 112
#endif

View file

@ -1,44 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* This header provides macros for JZ4775 DMA bindings.
*
* Copyright (c) 2020 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
*/
#ifndef __DT_BINDINGS_DMA_JZ4775_DMA_H__
#define __DT_BINDINGS_DMA_JZ4775_DMA_H__
/*
* Request type numbers for the JZ4775 DMA controller (written to the DRTn
* register for the channel).
*/
#define JZ4775_DMA_I2S0_TX 0x6
#define JZ4775_DMA_I2S0_RX 0x7
#define JZ4775_DMA_AUTO 0x8
#define JZ4775_DMA_SADC_RX 0x9
#define JZ4775_DMA_UART3_TX 0x0e
#define JZ4775_DMA_UART3_RX 0x0f
#define JZ4775_DMA_UART2_TX 0x10
#define JZ4775_DMA_UART2_RX 0x11
#define JZ4775_DMA_UART1_TX 0x12
#define JZ4775_DMA_UART1_RX 0x13
#define JZ4775_DMA_UART0_TX 0x14
#define JZ4775_DMA_UART0_RX 0x15
#define JZ4775_DMA_SSI0_TX 0x16
#define JZ4775_DMA_SSI0_RX 0x17
#define JZ4775_DMA_MSC0_TX 0x1a
#define JZ4775_DMA_MSC0_RX 0x1b
#define JZ4775_DMA_MSC1_TX 0x1c
#define JZ4775_DMA_MSC1_RX 0x1d
#define JZ4775_DMA_MSC2_TX 0x1e
#define JZ4775_DMA_MSC2_RX 0x1f
#define JZ4775_DMA_PCM0_TX 0x20
#define JZ4775_DMA_PCM0_RX 0x21
#define JZ4775_DMA_SMB0_TX 0x24
#define JZ4775_DMA_SMB0_RX 0x25
#define JZ4775_DMA_SMB1_TX 0x26
#define JZ4775_DMA_SMB1_RX 0x27
#define JZ4775_DMA_SMB2_TX 0x28
#define JZ4775_DMA_SMB2_RX 0x29
#endif /* __DT_BINDINGS_DMA_JZ4775_DMA_H__ */

View file

@ -1,54 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* This header provides macros for X2000 DMA bindings.
*
* Copyright (c) 2020 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
*/
#ifndef __DT_BINDINGS_DMA_X2000_DMA_H__
#define __DT_BINDINGS_DMA_X2000_DMA_H__
/*
* Request type numbers for the X2000 DMA controller (written to the DRTn
* register for the channel).
*/
#define X2000_DMA_AUTO 0x8
#define X2000_DMA_UART5_TX 0xa
#define X2000_DMA_UART5_RX 0xb
#define X2000_DMA_UART4_TX 0xc
#define X2000_DMA_UART4_RX 0xd
#define X2000_DMA_UART3_TX 0xe
#define X2000_DMA_UART3_RX 0xf
#define X2000_DMA_UART2_TX 0x10
#define X2000_DMA_UART2_RX 0x11
#define X2000_DMA_UART1_TX 0x12
#define X2000_DMA_UART1_RX 0x13
#define X2000_DMA_UART0_TX 0x14
#define X2000_DMA_UART0_RX 0x15
#define X2000_DMA_SSI0_TX 0x16
#define X2000_DMA_SSI0_RX 0x17
#define X2000_DMA_SSI1_TX 0x18
#define X2000_DMA_SSI1_RX 0x19
#define X2000_DMA_I2C0_TX 0x24
#define X2000_DMA_I2C0_RX 0x25
#define X2000_DMA_I2C1_TX 0x26
#define X2000_DMA_I2C1_RX 0x27
#define X2000_DMA_I2C2_TX 0x28
#define X2000_DMA_I2C2_RX 0x29
#define X2000_DMA_I2C3_TX 0x2a
#define X2000_DMA_I2C3_RX 0x2b
#define X2000_DMA_I2C4_TX 0x2c
#define X2000_DMA_I2C4_RX 0x2d
#define X2000_DMA_I2C5_TX 0x2e
#define X2000_DMA_I2C5_RX 0x2f
#define X2000_DMA_UART6_TX 0x30
#define X2000_DMA_UART6_RX 0x31
#define X2000_DMA_UART7_TX 0x32
#define X2000_DMA_UART7_RX 0x33
#define X2000_DMA_UART8_TX 0x34
#define X2000_DMA_UART8_RX 0x35
#define X2000_DMA_UART9_TX 0x36
#define X2000_DMA_UART9_RX 0x37
#define X2000_DMA_SADC_RX 0x38
#endif /* __DT_BINDINGS_DMA_X2000_DMA_H__ */

View file

@ -1,222 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
* Author: Dennis-YC Hsieh <dennis-yc.hsieh@mediatek.com>
*/
#ifndef _DT_BINDINGS_GCE_MT6779_H
#define _DT_BINDINGS_GCE_MT6779_H
#define CMDQ_NO_TIMEOUT 0xffffffff
/* GCE HW thread priority */
#define CMDQ_THR_PRIO_LOWEST 0
#define CMDQ_THR_PRIO_1 1
#define CMDQ_THR_PRIO_2 2
#define CMDQ_THR_PRIO_3 3
#define CMDQ_THR_PRIO_4 4
#define CMDQ_THR_PRIO_5 5
#define CMDQ_THR_PRIO_6 6
#define CMDQ_THR_PRIO_HIGHEST 7
/* GCE subsys table */
#define SUBSYS_1300XXXX 0
#define SUBSYS_1400XXXX 1
#define SUBSYS_1401XXXX 2
#define SUBSYS_1402XXXX 3
#define SUBSYS_1502XXXX 4
#define SUBSYS_1880XXXX 5
#define SUBSYS_1881XXXX 6
#define SUBSYS_1882XXXX 7
#define SUBSYS_1883XXXX 8
#define SUBSYS_1884XXXX 9
#define SUBSYS_1000XXXX 10
#define SUBSYS_1001XXXX 11
#define SUBSYS_1002XXXX 12
#define SUBSYS_1003XXXX 13
#define SUBSYS_1004XXXX 14
#define SUBSYS_1005XXXX 15
#define SUBSYS_1020XXXX 16
#define SUBSYS_1028XXXX 17
#define SUBSYS_1700XXXX 18
#define SUBSYS_1701XXXX 19
#define SUBSYS_1702XXXX 20
#define SUBSYS_1703XXXX 21
#define SUBSYS_1800XXXX 22
#define SUBSYS_1801XXXX 23
#define SUBSYS_1802XXXX 24
#define SUBSYS_1804XXXX 25
#define SUBSYS_1805XXXX 26
#define SUBSYS_1808XXXX 27
#define SUBSYS_180aXXXX 28
#define SUBSYS_180bXXXX 29
#define CMDQ_SUBSYS_OFF 32
/* GCE hardware events */
#define CMDQ_EVENT_DISP_RDMA0_SOF 0
#define CMDQ_EVENT_DISP_RDMA1_SOF 1
#define CMDQ_EVENT_MDP_RDMA0_SOF 2
#define CMDQ_EVENT_MDP_RDMA1_SOF 3
#define CMDQ_EVENT_MDP_RSZ0_SOF 4
#define CMDQ_EVENT_MDP_RSZ1_SOF 5
#define CMDQ_EVENT_MDP_TDSHP_SOF 6
#define CMDQ_EVENT_MDP_WROT0_SOF 7
#define CMDQ_EVENT_MDP_WROT1_SOF 8
#define CMDQ_EVENT_DISP_OVL0_SOF 9
#define CMDQ_EVENT_DISP_2L_OVL0_SOF 10
#define CMDQ_EVENT_DISP_2L_OVL1_SOF 11
#define CMDQ_EVENT_DISP_WDMA0_SOF 12
#define CMDQ_EVENT_DISP_COLOR0_SOF 13
#define CMDQ_EVENT_DISP_CCORR0_SOF 14
#define CMDQ_EVENT_DISP_AAL0_SOF 15
#define CMDQ_EVENT_DISP_GAMMA0_SOF 16
#define CMDQ_EVENT_DISP_DITHER0_SOF 17
#define CMDQ_EVENT_DISP_PWM0_SOF 18
#define CMDQ_EVENT_DISP_DSI0_SOF 19
#define CMDQ_EVENT_DISP_DPI0_SOF 20
#define CMDQ_EVENT_DISP_POSTMASK0_SOF 21
#define CMDQ_EVENT_DISP_RSZ0_SOF 22
#define CMDQ_EVENT_MDP_AAL_SOF 23
#define CMDQ_EVENT_MDP_CCORR_SOF 24
#define CMDQ_EVENT_DISP_DBI0_SOF 25
#define CMDQ_EVENT_ISP_RELAY_SOF 26
#define CMDQ_EVENT_IPU_RELAY_SOF 27
#define CMDQ_EVENT_DISP_RDMA0_EOF 28
#define CMDQ_EVENT_DISP_RDMA1_EOF 29
#define CMDQ_EVENT_MDP_RDMA0_EOF 30
#define CMDQ_EVENT_MDP_RDMA1_EOF 31
#define CMDQ_EVENT_MDP_RSZ0_EOF 32
#define CMDQ_EVENT_MDP_RSZ1_EOF 33
#define CMDQ_EVENT_MDP_TDSHP_EOF 34
#define CMDQ_EVENT_MDP_WROT0_W_EOF 35
#define CMDQ_EVENT_MDP_WROT1_W_EOF 36
#define CMDQ_EVENT_DISP_OVL0_EOF 37
#define CMDQ_EVENT_DISP_2L_OVL0_EOF 38
#define CMDQ_EVENT_DISP_2L_OVL1_EOF 39
#define CMDQ_EVENT_DISP_WDMA0_EOF 40
#define CMDQ_EVENT_DISP_COLOR0_EOF 41
#define CMDQ_EVENT_DISP_CCORR0_EOF 42
#define CMDQ_EVENT_DISP_AAL0_EOF 43
#define CMDQ_EVENT_DISP_GAMMA0_EOF 44
#define CMDQ_EVENT_DISP_DITHER0_EOF 45
#define CMDQ_EVENT_DISP_DSI0_EOF 46
#define CMDQ_EVENT_DISP_DPI0_EOF 47
#define CMDQ_EVENT_DISP_RSZ0_EOF 49
#define CMDQ_EVENT_MDP_AAL_FRAME_DONE 50
#define CMDQ_EVENT_MDP_CCORR_FRAME_DONE 51
#define CMDQ_EVENT_DISP_POSTMASK0_FRAME_DONE 52
#define CMDQ_EVENT_MUTEX0_STREAM_EOF 130
#define CMDQ_EVENT_MUTEX1_STREAM_EOF 131
#define CMDQ_EVENT_MUTEX2_STREAM_EOF 132
#define CMDQ_EVENT_MUTEX3_STREAM_EOF 133
#define CMDQ_EVENT_MUTEX4_STREAM_EOF 134
#define CMDQ_EVENT_MUTEX5_STREAM_EOF 135
#define CMDQ_EVENT_MUTEX6_STREAM_EOF 136
#define CMDQ_EVENT_MUTEX7_STREAM_EOF 137
#define CMDQ_EVENT_MUTEX8_STREAM_EOF 138
#define CMDQ_EVENT_MUTEX9_STREAM_EOF 139
#define CMDQ_EVENT_MUTEX10_STREAM_EOF 140
#define CMDQ_EVENT_MUTEX11_STREAM_EOF 141
#define CMDQ_EVENT_DISP_RDMA0_UNDERRUN 142
#define CMDQ_EVENT_DISP_RDMA1_UNDERRUN 143
#define CMDQ_EVENT_DISP_RDMA2_UNDERRUN 144
#define CMDQ_EVENT_DISP_RDMA3_UNDERRUN 145
#define CMDQ_EVENT_DSI0_TE 146
#define CMDQ_EVENT_DSI0_IRQ_EVENT 147
#define CMDQ_EVENT_DSI0_DONE_EVENT 148
#define CMDQ_EVENT_DISP_POSTMASK0_RST_DONE 150
#define CMDQ_EVENT_DISP_WDMA0_RST_DONE 151
#define CMDQ_EVENT_MDP_WROT0_RST_DONE 153
#define CMDQ_EVENT_MDP_RDMA0_RST_DONE 154
#define CMDQ_EVENT_DISP_OVL0_RST_DONE 155
#define CMDQ_EVENT_DISP_OVL0_2L_RST_DONE 156
#define CMDQ_EVENT_DISP_OVL1_2L_RST_DONE 157
#define CMDQ_EVENT_DIP_CQ_THREAD0_EOF 257
#define CMDQ_EVENT_DIP_CQ_THREAD1_EOF 258
#define CMDQ_EVENT_DIP_CQ_THREAD2_EOF 259
#define CMDQ_EVENT_DIP_CQ_THREAD3_EOF 260
#define CMDQ_EVENT_DIP_CQ_THREAD4_EOF 261
#define CMDQ_EVENT_DIP_CQ_THREAD5_EOF 262
#define CMDQ_EVENT_DIP_CQ_THREAD6_EOF 263
#define CMDQ_EVENT_DIP_CQ_THREAD7_EOF 264
#define CMDQ_EVENT_DIP_CQ_THREAD8_EOF 265
#define CMDQ_EVENT_DIP_CQ_THREAD9_EOF 266
#define CMDQ_EVENT_DIP_CQ_THREAD10_EOF 267
#define CMDQ_EVENT_DIP_CQ_THREAD11_EOF 268
#define CMDQ_EVENT_DIP_CQ_THREAD12_EOF 269
#define CMDQ_EVENT_DIP_CQ_THREAD13_EOF 270
#define CMDQ_EVENT_DIP_CQ_THREAD14_EOF 271
#define CMDQ_EVENT_DIP_CQ_THREAD15_EOF 272
#define CMDQ_EVENT_DIP_CQ_THREAD16_EOF 273
#define CMDQ_EVENT_DIP_CQ_THREAD17_EOF 274
#define CMDQ_EVENT_DIP_CQ_THREAD18_EOF 275
#define CMDQ_EVENT_DIP_DMA_ERR_EVENT 276
#define CMDQ_EVENT_AMD_FRAME_DONE 277
#define CMDQ_EVENT_MFB_DONE 278
#define CMDQ_EVENT_WPE_A_EOF 279
#define CMDQ_EVENT_VENC_EOF 289
#define CMDQ_EVENT_VENC_CMDQ_PAUSE_DONE 290
#define CMDQ_EVENT_JPEG_ENC_EOF 291
#define CMDQ_EVENT_VENC_MB_DONE 292
#define CMDQ_EVENT_VENC_128BYTE_CNT_DONE 293
#define CMDQ_EVENT_ISP_FRAME_DONE_A 321
#define CMDQ_EVENT_ISP_FRAME_DONE_B 322
#define CMDQ_EVENT_ISP_FRAME_DONE_C 323
#define CMDQ_EVENT_ISP_CAMSV_0_PASS1_DONE 324
#define CMDQ_EVENT_ISP_CAMSV_0_2_PASS1_DONE 325
#define CMDQ_EVENT_ISP_CAMSV_1_PASS1_DONE 326
#define CMDQ_EVENT_ISP_CAMSV_2_PASS1_DONE 327
#define CMDQ_EVENT_ISP_CAMSV_3_PASS1_DONE 328
#define CMDQ_EVENT_ISP_TSF_DONE 329
#define CMDQ_EVENT_SENINF_0_FIFO_FULL 330
#define CMDQ_EVENT_SENINF_1_FIFO_FULL 331
#define CMDQ_EVENT_SENINF_2_FIFO_FULL 332
#define CMDQ_EVENT_SENINF_3_FIFO_FULL 333
#define CMDQ_EVENT_SENINF_4_FIFO_FULL 334
#define CMDQ_EVENT_SENINF_5_FIFO_FULL 335
#define CMDQ_EVENT_SENINF_6_FIFO_FULL 336
#define CMDQ_EVENT_SENINF_7_FIFO_FULL 337
#define CMDQ_EVENT_TG_OVRUN_A_INT_DLY 338
#define CMDQ_EVENT_TG_OVRUN_B_INT_DLY 339
#define CMDQ_EVENT_TG_OVRUN_C_INT 340
#define CMDQ_EVENT_TG_GRABERR_A_INT_DLY 341
#define CMDQ_EVENT_TG_GRABERR_B_INT_DLY 342
#define CMDQ_EVENT_TG_GRABERR_C_INT 343
#define CMDQ_EVENT_CQ_VR_SNAP_A_INT_DLY 344
#define CMDQ_EVENT_CQ_VR_SNAP_B_INT_DLY 345
#define CMDQ_EVENT_CQ_VR_SNAP_C_INT 346
#define CMDQ_EVENT_DMA_R1_ERROR_A_INT_DLY 347
#define CMDQ_EVENT_DMA_R1_ERROR_B_INT_DLY 348
#define CMDQ_EVENT_DMA_R1_ERROR_C_INT 349
#define CMDQ_EVENT_APU_GCE_CORE0_EVENT_0 353
#define CMDQ_EVENT_APU_GCE_CORE0_EVENT_1 354
#define CMDQ_EVENT_APU_GCE_CORE0_EVENT_2 355
#define CMDQ_EVENT_APU_GCE_CORE0_EVENT_3 356
#define CMDQ_EVENT_APU_GCE_CORE1_EVENT_0 385
#define CMDQ_EVENT_APU_GCE_CORE1_EVENT_1 386
#define CMDQ_EVENT_APU_GCE_CORE1_EVENT_2 387
#define CMDQ_EVENT_APU_GCE_CORE1_EVENT_3 388
#define CMDQ_EVENT_VDEC_EVENT_0 416
#define CMDQ_EVENT_VDEC_EVENT_1 417
#define CMDQ_EVENT_VDEC_EVENT_2 418
#define CMDQ_EVENT_VDEC_EVENT_3 419
#define CMDQ_EVENT_VDEC_EVENT_4 420
#define CMDQ_EVENT_VDEC_EVENT_5 421
#define CMDQ_EVENT_VDEC_EVENT_6 422
#define CMDQ_EVENT_VDEC_EVENT_7 423
#define CMDQ_EVENT_VDEC_EVENT_8 424
#define CMDQ_EVENT_VDEC_EVENT_9 425
#define CMDQ_EVENT_VDEC_EVENT_10 426
#define CMDQ_EVENT_VDEC_EVENT_11 427
#define CMDQ_EVENT_VDEC_EVENT_12 428
#define CMDQ_EVENT_VDEC_EVENT_13 429
#define CMDQ_EVENT_VDEC_EVENT_14 430
#define CMDQ_EVENT_VDEC_EVENT_15 431
#define CMDQ_EVENT_FDVT_DONE 449
#define CMDQ_EVENT_FE_DONE 450
#define CMDQ_EVENT_RSC_EOF 451
#define CMDQ_EVENT_DVS_DONE_ASYNC_SHOT 452
#define CMDQ_EVENT_DVP_DONE_ASYNC_SHOT 453
#define CMDQ_EVENT_DSI0_TE_INFRA 898
#endif

View file

@ -1,206 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
* Author: Chao Hao <chao.hao@mediatek.com>
*/
#ifndef _DT_BINDINGS_MEMORY_MT6779_LARB_PORT_H_
#define _DT_BINDINGS_MEMORY_MT6779_LARB_PORT_H_
#include <dt-bindings/memory/mtk-memory-port.h>
#define M4U_LARB0_ID 0
#define M4U_LARB1_ID 1
#define M4U_LARB2_ID 2
#define M4U_LARB3_ID 3
#define M4U_LARB4_ID 4
#define M4U_LARB5_ID 5
#define M4U_LARB6_ID 6
#define M4U_LARB7_ID 7
#define M4U_LARB8_ID 8
#define M4U_LARB9_ID 9
#define M4U_LARB10_ID 10
#define M4U_LARB11_ID 11
/* larb0 */
#define M4U_PORT_DISP_POSTMASK0 MTK_M4U_ID(M4U_LARB0_ID, 0)
#define M4U_PORT_DISP_OVL0_HDR MTK_M4U_ID(M4U_LARB0_ID, 1)
#define M4U_PORT_DISP_OVL1_HDR MTK_M4U_ID(M4U_LARB0_ID, 2)
#define M4U_PORT_DISP_OVL0 MTK_M4U_ID(M4U_LARB0_ID, 3)
#define M4U_PORT_DISP_OVL1 MTK_M4U_ID(M4U_LARB0_ID, 4)
#define M4U_PORT_DISP_PVRIC0 MTK_M4U_ID(M4U_LARB0_ID, 5)
#define M4U_PORT_DISP_RDMA0 MTK_M4U_ID(M4U_LARB0_ID, 6)
#define M4U_PORT_DISP_WDMA0 MTK_M4U_ID(M4U_LARB0_ID, 7)
#define M4U_PORT_DISP_FAKE0 MTK_M4U_ID(M4U_LARB0_ID, 8)
/* larb1 */
#define M4U_PORT_DISP_OVL0_2L_HDR MTK_M4U_ID(M4U_LARB1_ID, 0)
#define M4U_PORT_DISP_OVL1_2L_HDR MTK_M4U_ID(M4U_LARB1_ID, 1)
#define M4U_PORT_DISP_OVL0_2L MTK_M4U_ID(M4U_LARB1_ID, 2)
#define M4U_PORT_DISP_OVL1_2L MTK_M4U_ID(M4U_LARB1_ID, 3)
#define M4U_PORT_DISP_RDMA1 MTK_M4U_ID(M4U_LARB1_ID, 4)
#define M4U_PORT_MDP_PVRIC0 MTK_M4U_ID(M4U_LARB1_ID, 5)
#define M4U_PORT_MDP_PVRIC1 MTK_M4U_ID(M4U_LARB1_ID, 6)
#define M4U_PORT_MDP_RDMA0 MTK_M4U_ID(M4U_LARB1_ID, 7)
#define M4U_PORT_MDP_RDMA1 MTK_M4U_ID(M4U_LARB1_ID, 8)
#define M4U_PORT_MDP_WROT0_R MTK_M4U_ID(M4U_LARB1_ID, 9)
#define M4U_PORT_MDP_WROT0_W MTK_M4U_ID(M4U_LARB1_ID, 10)
#define M4U_PORT_MDP_WROT1_R MTK_M4U_ID(M4U_LARB1_ID, 11)
#define M4U_PORT_MDP_WROT1_W MTK_M4U_ID(M4U_LARB1_ID, 12)
#define M4U_PORT_DISP_FAKE1 MTK_M4U_ID(M4U_LARB1_ID, 13)
/* larb2-VDEC */
#define M4U_PORT_HW_VDEC_MC_EXT MTK_M4U_ID(M4U_LARB2_ID, 0)
#define M4U_PORT_HW_VDEC_UFO_EXT MTK_M4U_ID(M4U_LARB2_ID, 1)
#define M4U_PORT_HW_VDEC_PP_EXT MTK_M4U_ID(M4U_LARB2_ID, 2)
#define M4U_PORT_HW_VDEC_PRED_RD_EXT MTK_M4U_ID(M4U_LARB2_ID, 3)
#define M4U_PORT_HW_VDEC_PRED_WR_EXT MTK_M4U_ID(M4U_LARB2_ID, 4)
#define M4U_PORT_HW_VDEC_PPWRAP_EXT MTK_M4U_ID(M4U_LARB2_ID, 5)
#define M4U_PORT_HW_VDEC_TILE_EXT MTK_M4U_ID(M4U_LARB2_ID, 6)
#define M4U_PORT_HW_VDEC_VLD_EXT MTK_M4U_ID(M4U_LARB2_ID, 7)
#define M4U_PORT_HW_VDEC_VLD2_EXT MTK_M4U_ID(M4U_LARB2_ID, 8)
#define M4U_PORT_HW_VDEC_AVC_MV_EXT MTK_M4U_ID(M4U_LARB2_ID, 9)
#define M4U_PORT_HW_VDEC_UFO_ENC_EXT MTK_M4U_ID(M4U_LARB2_ID, 10)
#define M4U_PORT_HW_VDEC_RG_CTRL_DMA_EXT MTK_M4U_ID(M4U_LARB2_ID, 11)
/* larb3-VENC */
#define M4U_PORT_VENC_RCPU MTK_M4U_ID(M4U_LARB3_ID, 0)
#define M4U_PORT_VENC_REC MTK_M4U_ID(M4U_LARB3_ID, 1)
#define M4U_PORT_VENC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 2)
#define M4U_PORT_VENC_SV_COMV MTK_M4U_ID(M4U_LARB3_ID, 3)
#define M4U_PORT_VENC_RD_COMV MTK_M4U_ID(M4U_LARB3_ID, 4)
#define M4U_PORT_VENC_NBM_RDMA MTK_M4U_ID(M4U_LARB3_ID, 5)
#define M4U_PORT_VENC_NBM_RDMA_LITE MTK_M4U_ID(M4U_LARB3_ID, 6)
#define M4U_PORT_JPGENC_Y_RDMA MTK_M4U_ID(M4U_LARB3_ID, 7)
#define M4U_PORT_JPGENC_C_RDMA MTK_M4U_ID(M4U_LARB3_ID, 8)
#define M4U_PORT_JPGENC_Q_TABLE MTK_M4U_ID(M4U_LARB3_ID, 9)
#define M4U_PORT_JPGENC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 10)
#define M4U_PORT_JPGDEC_WDMA MTK_M4U_ID(M4U_LARB3_ID, 11)
#define M4U_PORT_JPGDEC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 12)
#define M4U_PORT_VENC_NBM_WDMA MTK_M4U_ID(M4U_LARB3_ID, 13)
#define M4U_PORT_VENC_NBM_WDMA_LITE MTK_M4U_ID(M4U_LARB3_ID, 14)
#define M4U_PORT_VENC_CUR_LUMA MTK_M4U_ID(M4U_LARB3_ID, 15)
#define M4U_PORT_VENC_CUR_CHROMA MTK_M4U_ID(M4U_LARB3_ID, 16)
#define M4U_PORT_VENC_REF_LUMA MTK_M4U_ID(M4U_LARB3_ID, 17)
#define M4U_PORT_VENC_REF_CHROMA MTK_M4U_ID(M4U_LARB3_ID, 18)
/* larb4-dummy */
/* larb5-IMG */
#define M4U_PORT_IMGI_D1 MTK_M4U_ID(M4U_LARB5_ID, 0)
#define M4U_PORT_IMGBI_D1 MTK_M4U_ID(M4U_LARB5_ID, 1)
#define M4U_PORT_DMGI_D1 MTK_M4U_ID(M4U_LARB5_ID, 2)
#define M4U_PORT_DEPI_D1 MTK_M4U_ID(M4U_LARB5_ID, 3)
#define M4U_PORT_LCEI_D1 MTK_M4U_ID(M4U_LARB5_ID, 4)
#define M4U_PORT_SMTI_D1 MTK_M4U_ID(M4U_LARB5_ID, 5)
#define M4U_PORT_SMTO_D2 MTK_M4U_ID(M4U_LARB5_ID, 6)
#define M4U_PORT_SMTO_D1 MTK_M4U_ID(M4U_LARB5_ID, 7)
#define M4U_PORT_CRZO_D1 MTK_M4U_ID(M4U_LARB5_ID, 8)
#define M4U_PORT_IMG3O_D1 MTK_M4U_ID(M4U_LARB5_ID, 9)
#define M4U_PORT_VIPI_D1 MTK_M4U_ID(M4U_LARB5_ID, 10)
#define M4U_PORT_WPE_RDMA1 MTK_M4U_ID(M4U_LARB5_ID, 11)
#define M4U_PORT_WPE_RDMA0 MTK_M4U_ID(M4U_LARB5_ID, 12)
#define M4U_PORT_WPE_WDMA MTK_M4U_ID(M4U_LARB5_ID, 13)
#define M4U_PORT_TIMGO_D1 MTK_M4U_ID(M4U_LARB5_ID, 14)
#define M4U_PORT_MFB_RDMA0 MTK_M4U_ID(M4U_LARB5_ID, 15)
#define M4U_PORT_MFB_RDMA1 MTK_M4U_ID(M4U_LARB5_ID, 16)
#define M4U_PORT_MFB_RDMA2 MTK_M4U_ID(M4U_LARB5_ID, 17)
#define M4U_PORT_MFB_RDMA3 MTK_M4U_ID(M4U_LARB5_ID, 18)
#define M4U_PORT_MFB_WDMA MTK_M4U_ID(M4U_LARB5_ID, 19)
#define M4U_PORT_RESERVE1 MTK_M4U_ID(M4U_LARB5_ID, 20)
#define M4U_PORT_RESERVE2 MTK_M4U_ID(M4U_LARB5_ID, 21)
#define M4U_PORT_RESERVE3 MTK_M4U_ID(M4U_LARB5_ID, 22)
#define M4U_PORT_RESERVE4 MTK_M4U_ID(M4U_LARB5_ID, 23)
#define M4U_PORT_RESERVE5 MTK_M4U_ID(M4U_LARB5_ID, 24)
#define M4U_PORT_RESERVE6 MTK_M4U_ID(M4U_LARB5_ID, 25)
/* larb6-IMG-VPU */
#define M4U_PORT_IMG_IPUO MTK_M4U_ID(M4U_LARB6_ID, 0)
#define M4U_PORT_IMG_IPU3O MTK_M4U_ID(M4U_LARB6_ID, 1)
#define M4U_PORT_IMG_IPUI MTK_M4U_ID(M4U_LARB6_ID, 2)
/* larb7-DVS */
#define M4U_PORT_DVS_RDMA MTK_M4U_ID(M4U_LARB7_ID, 0)
#define M4U_PORT_DVS_WDMA MTK_M4U_ID(M4U_LARB7_ID, 1)
#define M4U_PORT_DVP_RDMA MTK_M4U_ID(M4U_LARB7_ID, 2)
#define M4U_PORT_DVP_WDMA MTK_M4U_ID(M4U_LARB7_ID, 3)
/* larb8-IPESYS */
#define M4U_PORT_FDVT_RDA MTK_M4U_ID(M4U_LARB8_ID, 0)
#define M4U_PORT_FDVT_RDB MTK_M4U_ID(M4U_LARB8_ID, 1)
#define M4U_PORT_FDVT_WRA MTK_M4U_ID(M4U_LARB8_ID, 2)
#define M4U_PORT_FDVT_WRB MTK_M4U_ID(M4U_LARB8_ID, 3)
#define M4U_PORT_FE_RD0 MTK_M4U_ID(M4U_LARB8_ID, 4)
#define M4U_PORT_FE_RD1 MTK_M4U_ID(M4U_LARB8_ID, 5)
#define M4U_PORT_FE_WR0 MTK_M4U_ID(M4U_LARB8_ID, 6)
#define M4U_PORT_FE_WR1 MTK_M4U_ID(M4U_LARB8_ID, 7)
#define M4U_PORT_RSC_RDMA0 MTK_M4U_ID(M4U_LARB8_ID, 8)
#define M4U_PORT_RSC_WDMA MTK_M4U_ID(M4U_LARB8_ID, 9)
/* larb9-CAM */
#define M4U_PORT_CAM_IMGO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 0)
#define M4U_PORT_CAM_RRZO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 1)
#define M4U_PORT_CAM_LSCI_R1_C MTK_M4U_ID(M4U_LARB9_ID, 2)
#define M4U_PORT_CAM_BPCI_R1_C MTK_M4U_ID(M4U_LARB9_ID, 3)
#define M4U_PORT_CAM_YUVO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 4)
#define M4U_PORT_CAM_UFDI_R2_C MTK_M4U_ID(M4U_LARB9_ID, 5)
#define M4U_PORT_CAM_RAWI_R2_C MTK_M4U_ID(M4U_LARB9_ID, 6)
#define M4U_PORT_CAM_RAWI_R5_C MTK_M4U_ID(M4U_LARB9_ID, 7)
#define M4U_PORT_CAM_CAMSV_1 MTK_M4U_ID(M4U_LARB9_ID, 8)
#define M4U_PORT_CAM_CAMSV_2 MTK_M4U_ID(M4U_LARB9_ID, 9)
#define M4U_PORT_CAM_CAMSV_3 MTK_M4U_ID(M4U_LARB9_ID, 10)
#define M4U_PORT_CAM_CAMSV_4 MTK_M4U_ID(M4U_LARB9_ID, 11)
#define M4U_PORT_CAM_CAMSV_5 MTK_M4U_ID(M4U_LARB9_ID, 12)
#define M4U_PORT_CAM_CAMSV_6 MTK_M4U_ID(M4U_LARB9_ID, 13)
#define M4U_PORT_CAM_AAO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 14)
#define M4U_PORT_CAM_AFO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 15)
#define M4U_PORT_CAM_FLKO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 16)
#define M4U_PORT_CAM_LCESO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 17)
#define M4U_PORT_CAM_CRZO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 18)
#define M4U_PORT_CAM_LTMSO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 19)
#define M4U_PORT_CAM_RSSO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 20)
#define M4U_PORT_CAM_CCUI MTK_M4U_ID(M4U_LARB9_ID, 21)
#define M4U_PORT_CAM_CCUO MTK_M4U_ID(M4U_LARB9_ID, 22)
#define M4U_PORT_CAM_FAKE MTK_M4U_ID(M4U_LARB9_ID, 23)
/* larb10-CAM_A */
#define M4U_PORT_CAM_IMGO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 0)
#define M4U_PORT_CAM_RRZO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 1)
#define M4U_PORT_CAM_LSCI_R1_A MTK_M4U_ID(M4U_LARB10_ID, 2)
#define M4U_PORT_CAM_BPCI_R1_A MTK_M4U_ID(M4U_LARB10_ID, 3)
#define M4U_PORT_CAM_YUVO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 4)
#define M4U_PORT_CAM_UFDI_R2_A MTK_M4U_ID(M4U_LARB10_ID, 5)
#define M4U_PORT_CAM_RAWI_R2_A MTK_M4U_ID(M4U_LARB10_ID, 6)
#define M4U_PORT_CAM_RAWI_R5_A MTK_M4U_ID(M4U_LARB10_ID, 7)
#define M4U_PORT_CAM_IMGO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 8)
#define M4U_PORT_CAM_RRZO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 9)
#define M4U_PORT_CAM_LSCI_R1_B MTK_M4U_ID(M4U_LARB10_ID, 10)
#define M4U_PORT_CAM_BPCI_R1_B MTK_M4U_ID(M4U_LARB10_ID, 11)
#define M4U_PORT_CAM_YUVO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 12)
#define M4U_PORT_CAM_UFDI_R2_B MTK_M4U_ID(M4U_LARB10_ID, 13)
#define M4U_PORT_CAM_RAWI_R2_B MTK_M4U_ID(M4U_LARB10_ID, 14)
#define M4U_PORT_CAM_RAWI_R5_B MTK_M4U_ID(M4U_LARB10_ID, 15)
#define M4U_PORT_CAM_CAMSV_0 MTK_M4U_ID(M4U_LARB10_ID, 16)
#define M4U_PORT_CAM_AAO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 17)
#define M4U_PORT_CAM_AFO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 18)
#define M4U_PORT_CAM_FLKO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 19)
#define M4U_PORT_CAM_LCESO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 20)
#define M4U_PORT_CAM_CRZO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 21)
#define M4U_PORT_CAM_AAO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 22)
#define M4U_PORT_CAM_AFO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 23)
#define M4U_PORT_CAM_FLKO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 24)
#define M4U_PORT_CAM_LCESO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 25)
#define M4U_PORT_CAM_CRZO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 26)
#define M4U_PORT_CAM_LTMSO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 27)
#define M4U_PORT_CAM_RSSO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 28)
#define M4U_PORT_CAM_LTMSO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 29)
#define M4U_PORT_CAM_RSSO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 30)
/* larb11-CAM-VPU */
#define M4U_PORT_CAM_IPUO MTK_M4U_ID(M4U_LARB11_ID, 0)
#define M4U_PORT_CAM_IPU2O MTK_M4U_ID(M4U_LARB11_ID, 1)
#define M4U_PORT_CAM_IPU3O MTK_M4U_ID(M4U_LARB11_ID, 2)
#define M4U_PORT_CAM_IPUI MTK_M4U_ID(M4U_LARB11_ID, 3)
#define M4U_PORT_CAM_IPU2I MTK_M4U_ID(M4U_LARB11_ID, 4)
#endif

View file

@ -1,190 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* This header provides constants for SERDES MUX for TI SoCs
*/
#ifndef _DT_BINDINGS_MUX_TI_SERDES
#define _DT_BINDINGS_MUX_TI_SERDES
/*
* These bindings are deprecated, because they do not match the actual
* concept of bindings but rather contain pure constants values used only
* in DTS board files.
* Instead include the header in the DTS source directory.
*/
#warning "These bindings are deprecated. Instead, use the header in the DTS source directory."
/* J721E */
#define J721E_SERDES0_LANE0_QSGMII_LANE1 0x0
#define J721E_SERDES0_LANE0_PCIE0_LANE0 0x1
#define J721E_SERDES0_LANE0_USB3_0_SWAP 0x2
#define J721E_SERDES0_LANE0_IP4_UNUSED 0x3
#define J721E_SERDES0_LANE1_QSGMII_LANE2 0x0
#define J721E_SERDES0_LANE1_PCIE0_LANE1 0x1
#define J721E_SERDES0_LANE1_USB3_0 0x2
#define J721E_SERDES0_LANE1_IP4_UNUSED 0x3
#define J721E_SERDES1_LANE0_QSGMII_LANE3 0x0
#define J721E_SERDES1_LANE0_PCIE1_LANE0 0x1
#define J721E_SERDES1_LANE0_USB3_1_SWAP 0x2
#define J721E_SERDES1_LANE0_SGMII_LANE0 0x3
#define J721E_SERDES1_LANE1_QSGMII_LANE4 0x0
#define J721E_SERDES1_LANE1_PCIE1_LANE1 0x1
#define J721E_SERDES1_LANE1_USB3_1 0x2
#define J721E_SERDES1_LANE1_SGMII_LANE1 0x3
#define J721E_SERDES2_LANE0_IP1_UNUSED 0x0
#define J721E_SERDES2_LANE0_PCIE2_LANE0 0x1
#define J721E_SERDES2_LANE0_USB3_1_SWAP 0x2
#define J721E_SERDES2_LANE0_SGMII_LANE0 0x3
#define J721E_SERDES2_LANE1_IP1_UNUSED 0x0
#define J721E_SERDES2_LANE1_PCIE2_LANE1 0x1
#define J721E_SERDES2_LANE1_USB3_1 0x2
#define J721E_SERDES2_LANE1_SGMII_LANE1 0x3
#define J721E_SERDES3_LANE0_IP1_UNUSED 0x0
#define J721E_SERDES3_LANE0_PCIE3_LANE0 0x1
#define J721E_SERDES3_LANE0_USB3_0_SWAP 0x2
#define J721E_SERDES3_LANE0_IP4_UNUSED 0x3
#define J721E_SERDES3_LANE1_IP1_UNUSED 0x0
#define J721E_SERDES3_LANE1_PCIE3_LANE1 0x1
#define J721E_SERDES3_LANE1_USB3_0 0x2
#define J721E_SERDES3_LANE1_IP4_UNUSED 0x3
#define J721E_SERDES4_LANE0_EDP_LANE0 0x0
#define J721E_SERDES4_LANE0_IP2_UNUSED 0x1
#define J721E_SERDES4_LANE0_QSGMII_LANE5 0x2
#define J721E_SERDES4_LANE0_IP4_UNUSED 0x3
#define J721E_SERDES4_LANE1_EDP_LANE1 0x0
#define J721E_SERDES4_LANE1_IP2_UNUSED 0x1
#define J721E_SERDES4_LANE1_QSGMII_LANE6 0x2
#define J721E_SERDES4_LANE1_IP4_UNUSED 0x3
#define J721E_SERDES4_LANE2_EDP_LANE2 0x0
#define J721E_SERDES4_LANE2_IP2_UNUSED 0x1
#define J721E_SERDES4_LANE2_QSGMII_LANE7 0x2
#define J721E_SERDES4_LANE2_IP4_UNUSED 0x3
#define J721E_SERDES4_LANE3_EDP_LANE3 0x0
#define J721E_SERDES4_LANE3_IP2_UNUSED 0x1
#define J721E_SERDES4_LANE3_QSGMII_LANE8 0x2
#define J721E_SERDES4_LANE3_IP4_UNUSED 0x3
/* J7200 */
#define J7200_SERDES0_LANE0_QSGMII_LANE3 0x0
#define J7200_SERDES0_LANE0_PCIE1_LANE0 0x1
#define J7200_SERDES0_LANE0_IP3_UNUSED 0x2
#define J7200_SERDES0_LANE0_IP4_UNUSED 0x3
#define J7200_SERDES0_LANE1_QSGMII_LANE4 0x0
#define J7200_SERDES0_LANE1_PCIE1_LANE1 0x1
#define J7200_SERDES0_LANE1_IP3_UNUSED 0x2
#define J7200_SERDES0_LANE1_IP4_UNUSED 0x3
#define J7200_SERDES0_LANE2_QSGMII_LANE1 0x0
#define J7200_SERDES0_LANE2_PCIE1_LANE2 0x1
#define J7200_SERDES0_LANE2_IP3_UNUSED 0x2
#define J7200_SERDES0_LANE2_IP4_UNUSED 0x3
#define J7200_SERDES0_LANE3_QSGMII_LANE2 0x0
#define J7200_SERDES0_LANE3_PCIE1_LANE3 0x1
#define J7200_SERDES0_LANE3_USB 0x2
#define J7200_SERDES0_LANE3_IP4_UNUSED 0x3
/* AM64 */
#define AM64_SERDES0_LANE0_PCIE0 0x0
#define AM64_SERDES0_LANE0_USB 0x1
/* J721S2 */
#define J721S2_SERDES0_LANE0_EDP_LANE0 0x0
#define J721S2_SERDES0_LANE0_PCIE1_LANE0 0x1
#define J721S2_SERDES0_LANE0_IP3_UNUSED 0x2
#define J721S2_SERDES0_LANE0_IP4_UNUSED 0x3
#define J721S2_SERDES0_LANE1_EDP_LANE1 0x0
#define J721S2_SERDES0_LANE1_PCIE1_LANE1 0x1
#define J721S2_SERDES0_LANE1_USB 0x2
#define J721S2_SERDES0_LANE1_IP4_UNUSED 0x3
#define J721S2_SERDES0_LANE2_EDP_LANE2 0x0
#define J721S2_SERDES0_LANE2_PCIE1_LANE2 0x1
#define J721S2_SERDES0_LANE2_IP3_UNUSED 0x2
#define J721S2_SERDES0_LANE2_IP4_UNUSED 0x3
#define J721S2_SERDES0_LANE3_EDP_LANE3 0x0
#define J721S2_SERDES0_LANE3_PCIE1_LANE3 0x1
#define J721S2_SERDES0_LANE3_USB 0x2
#define J721S2_SERDES0_LANE3_IP4_UNUSED 0x3
/* J784S4 */
#define J784S4_SERDES0_LANE0_IP1_UNUSED 0x0
#define J784S4_SERDES0_LANE0_PCIE1_LANE0 0x1
#define J784S4_SERDES0_LANE0_IP3_UNUSED 0x2
#define J784S4_SERDES0_LANE0_IP4_UNUSED 0x3
#define J784S4_SERDES0_LANE1_IP1_UNUSED 0x0
#define J784S4_SERDES0_LANE1_PCIE1_LANE1 0x1
#define J784S4_SERDES0_LANE1_IP3_UNUSED 0x2
#define J784S4_SERDES0_LANE1_IP4_UNUSED 0x3
#define J784S4_SERDES0_LANE2_PCIE3_LANE0 0x0
#define J784S4_SERDES0_LANE2_PCIE1_LANE2 0x1
#define J784S4_SERDES0_LANE2_IP3_UNUSED 0x2
#define J784S4_SERDES0_LANE2_IP4_UNUSED 0x3
#define J784S4_SERDES0_LANE3_PCIE3_LANE1 0x0
#define J784S4_SERDES0_LANE3_PCIE1_LANE3 0x1
#define J784S4_SERDES0_LANE3_USB 0x2
#define J784S4_SERDES0_LANE3_IP4_UNUSED 0x3
#define J784S4_SERDES1_LANE0_QSGMII_LANE3 0x0
#define J784S4_SERDES1_LANE0_PCIE0_LANE0 0x1
#define J784S4_SERDES1_LANE0_IP3_UNUSED 0x2
#define J784S4_SERDES1_LANE0_IP4_UNUSED 0x3
#define J784S4_SERDES1_LANE1_QSGMII_LANE4 0x0
#define J784S4_SERDES1_LANE1_PCIE0_LANE1 0x1
#define J784S4_SERDES1_LANE1_IP3_UNUSED 0x2
#define J784S4_SERDES1_LANE1_IP4_UNUSED 0x3
#define J784S4_SERDES1_LANE2_QSGMII_LANE1 0x0
#define J784S4_SERDES1_LANE2_PCIE0_LANE2 0x1
#define J784S4_SERDES1_LANE2_PCIE2_LANE0 0x2
#define J784S4_SERDES1_LANE2_IP4_UNUSED 0x3
#define J784S4_SERDES1_LANE3_QSGMII_LANE2 0x0
#define J784S4_SERDES1_LANE3_PCIE0_LANE3 0x1
#define J784S4_SERDES1_LANE3_PCIE2_LANE1 0x2
#define J784S4_SERDES1_LANE3_IP4_UNUSED 0x3
#define J784S4_SERDES2_LANE0_QSGMII_LANE5 0x0
#define J784S4_SERDES2_LANE0_IP2_UNUSED 0x1
#define J784S4_SERDES2_LANE0_IP3_UNUSED 0x2
#define J784S4_SERDES2_LANE0_IP4_UNUSED 0x3
#define J784S4_SERDES2_LANE1_QSGMII_LANE6 0x0
#define J784S4_SERDES2_LANE1_IP2_UNUSED 0x1
#define J784S4_SERDES2_LANE1_IP3_UNUSED 0x2
#define J784S4_SERDES2_LANE1_IP4_UNUSED 0x3
#define J784S4_SERDES2_LANE2_QSGMII_LANE7 0x0
#define J784S4_SERDES2_LANE2_QSGMII_LANE1 0x1
#define J784S4_SERDES2_LANE2_IP3_UNUSED 0x2
#define J784S4_SERDES2_LANE2_IP4_UNUSED 0x3
#define J784S4_SERDES2_LANE3_QSGMII_LANE8 0x0
#define J784S4_SERDES2_LANE3_QSGMII_LANE2 0x1
#define J784S4_SERDES2_LANE3_IP3_UNUSED 0x2
#define J784S4_SERDES2_LANE3_IP4_UNUSED 0x3
#endif /* _DT_BINDINGS_MUX_TI_SERDES */

View file

@ -1,257 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __DTS_MT6397_PINFUNC_H
#define __DTS_MT6397_PINFUNC_H
#include <dt-bindings/pinctrl/mt65xx.h>
#define MT6397_PIN_0_INT__FUNC_GPIO0 (MTK_PIN_NO(0) | 0)
#define MT6397_PIN_0_INT__FUNC_INT (MTK_PIN_NO(0) | 1)
#define MT6397_PIN_1_SRCVOLTEN__FUNC_GPIO1 (MTK_PIN_NO(1) | 0)
#define MT6397_PIN_1_SRCVOLTEN__FUNC_SRCVOLTEN (MTK_PIN_NO(1) | 1)
#define MT6397_PIN_1_SRCVOLTEN__FUNC_TEST_CK1 (MTK_PIN_NO(1) | 6)
#define MT6397_PIN_2_SRCLKEN_PERI__FUNC_GPIO2 (MTK_PIN_NO(2) | 0)
#define MT6397_PIN_2_SRCLKEN_PERI__FUNC_SRCLKEN_PERI (MTK_PIN_NO(2) | 1)
#define MT6397_PIN_2_SRCLKEN_PERI__FUNC_TEST_CK2 (MTK_PIN_NO(2) | 6)
#define MT6397_PIN_3_RTC_32K1V8__FUNC_GPIO3 (MTK_PIN_NO(3) | 0)
#define MT6397_PIN_3_RTC_32K1V8__FUNC_RTC_32K1V8 (MTK_PIN_NO(3) | 1)
#define MT6397_PIN_3_RTC_32K1V8__FUNC_TEST_CK3 (MTK_PIN_NO(3) | 6)
#define MT6397_PIN_4_WRAP_EVENT__FUNC_GPIO4 (MTK_PIN_NO(4) | 0)
#define MT6397_PIN_4_WRAP_EVENT__FUNC_WRAP_EVENT (MTK_PIN_NO(4) | 1)
#define MT6397_PIN_5_SPI_CLK__FUNC_GPIO5 (MTK_PIN_NO(5) | 0)
#define MT6397_PIN_5_SPI_CLK__FUNC_SPI_CLK (MTK_PIN_NO(5) | 1)
#define MT6397_PIN_6_SPI_CSN__FUNC_GPIO6 (MTK_PIN_NO(6) | 0)
#define MT6397_PIN_6_SPI_CSN__FUNC_SPI_CSN (MTK_PIN_NO(6) | 1)
#define MT6397_PIN_7_SPI_MOSI__FUNC_GPIO7 (MTK_PIN_NO(7) | 0)
#define MT6397_PIN_7_SPI_MOSI__FUNC_SPI_MOSI (MTK_PIN_NO(7) | 1)
#define MT6397_PIN_8_SPI_MISO__FUNC_GPIO8 (MTK_PIN_NO(8) | 0)
#define MT6397_PIN_8_SPI_MISO__FUNC_SPI_MISO (MTK_PIN_NO(8) | 1)
#define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_GPIO9 (MTK_PIN_NO(9) | 0)
#define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_AUD_CLK (MTK_PIN_NO(9) | 1)
#define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_TEST_IN0 (MTK_PIN_NO(9) | 6)
#define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_TEST_OUT0 (MTK_PIN_NO(9) | 7)
#define MT6397_PIN_10_AUD_DAT_MISO__FUNC_GPIO10 (MTK_PIN_NO(10) | 0)
#define MT6397_PIN_10_AUD_DAT_MISO__FUNC_AUD_MISO (MTK_PIN_NO(10) | 1)
#define MT6397_PIN_10_AUD_DAT_MISO__FUNC_TEST_IN1 (MTK_PIN_NO(10) | 6)
#define MT6397_PIN_10_AUD_DAT_MISO__FUNC_TEST_OUT1 (MTK_PIN_NO(10) | 7)
#define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_GPIO11 (MTK_PIN_NO(11) | 0)
#define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_AUD_MOSI (MTK_PIN_NO(11) | 1)
#define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_TEST_IN2 (MTK_PIN_NO(11) | 6)
#define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_TEST_OUT2 (MTK_PIN_NO(11) | 7)
#define MT6397_PIN_12_COL0__FUNC_GPIO12 (MTK_PIN_NO(12) | 0)
#define MT6397_PIN_12_COL0__FUNC_COL0_USBDL (MTK_PIN_NO(12) | 1)
#define MT6397_PIN_12_COL0__FUNC_EINT10_1X (MTK_PIN_NO(12) | 2)
#define MT6397_PIN_12_COL0__FUNC_PWM1_3X (MTK_PIN_NO(12) | 3)
#define MT6397_PIN_12_COL0__FUNC_TEST_IN3 (MTK_PIN_NO(12) | 6)
#define MT6397_PIN_12_COL0__FUNC_TEST_OUT3 (MTK_PIN_NO(12) | 7)
#define MT6397_PIN_13_COL1__FUNC_GPIO13 (MTK_PIN_NO(13) | 0)
#define MT6397_PIN_13_COL1__FUNC_COL1 (MTK_PIN_NO(13) | 1)
#define MT6397_PIN_13_COL1__FUNC_EINT11_1X (MTK_PIN_NO(13) | 2)
#define MT6397_PIN_13_COL1__FUNC_SCL0_2X (MTK_PIN_NO(13) | 3)
#define MT6397_PIN_13_COL1__FUNC_TEST_IN4 (MTK_PIN_NO(13) | 6)
#define MT6397_PIN_13_COL1__FUNC_TEST_OUT4 (MTK_PIN_NO(13) | 7)
#define MT6397_PIN_14_COL2__FUNC_GPIO14 (MTK_PIN_NO(14) | 0)
#define MT6397_PIN_14_COL2__FUNC_COL2 (MTK_PIN_NO(14) | 1)
#define MT6397_PIN_14_COL2__FUNC_EINT12_1X (MTK_PIN_NO(14) | 2)
#define MT6397_PIN_14_COL2__FUNC_SDA0_2X (MTK_PIN_NO(14) | 3)
#define MT6397_PIN_14_COL2__FUNC_TEST_IN5 (MTK_PIN_NO(14) | 6)
#define MT6397_PIN_14_COL2__FUNC_TEST_OUT5 (MTK_PIN_NO(14) | 7)
#define MT6397_PIN_15_COL3__FUNC_GPIO15 (MTK_PIN_NO(15) | 0)
#define MT6397_PIN_15_COL3__FUNC_COL3 (MTK_PIN_NO(15) | 1)
#define MT6397_PIN_15_COL3__FUNC_EINT13_1X (MTK_PIN_NO(15) | 2)
#define MT6397_PIN_15_COL3__FUNC_SCL1_2X (MTK_PIN_NO(15) | 3)
#define MT6397_PIN_15_COL3__FUNC_TEST_IN6 (MTK_PIN_NO(15) | 6)
#define MT6397_PIN_15_COL3__FUNC_TEST_OUT6 (MTK_PIN_NO(15) | 7)
#define MT6397_PIN_16_COL4__FUNC_GPIO16 (MTK_PIN_NO(16) | 0)
#define MT6397_PIN_16_COL4__FUNC_COL4 (MTK_PIN_NO(16) | 1)
#define MT6397_PIN_16_COL4__FUNC_EINT14_1X (MTK_PIN_NO(16) | 2)
#define MT6397_PIN_16_COL4__FUNC_SDA1_2X (MTK_PIN_NO(16) | 3)
#define MT6397_PIN_16_COL4__FUNC_TEST_IN7 (MTK_PIN_NO(16) | 6)
#define MT6397_PIN_16_COL4__FUNC_TEST_OUT7 (MTK_PIN_NO(16) | 7)
#define MT6397_PIN_17_COL5__FUNC_GPIO17 (MTK_PIN_NO(17) | 0)
#define MT6397_PIN_17_COL5__FUNC_COL5 (MTK_PIN_NO(17) | 1)
#define MT6397_PIN_17_COL5__FUNC_EINT15_1X (MTK_PIN_NO(17) | 2)
#define MT6397_PIN_17_COL5__FUNC_SCL2_2X (MTK_PIN_NO(17) | 3)
#define MT6397_PIN_17_COL5__FUNC_TEST_IN8 (MTK_PIN_NO(17) | 6)
#define MT6397_PIN_17_COL5__FUNC_TEST_OUT8 (MTK_PIN_NO(17) | 7)
#define MT6397_PIN_18_COL6__FUNC_GPIO18 (MTK_PIN_NO(18) | 0)
#define MT6397_PIN_18_COL6__FUNC_COL6 (MTK_PIN_NO(18) | 1)
#define MT6397_PIN_18_COL6__FUNC_EINT16_1X (MTK_PIN_NO(18) | 2)
#define MT6397_PIN_18_COL6__FUNC_SDA2_2X (MTK_PIN_NO(18) | 3)
#define MT6397_PIN_18_COL6__FUNC_GPIO32K_0 (MTK_PIN_NO(18) | 4)
#define MT6397_PIN_18_COL6__FUNC_GPIO26M_0 (MTK_PIN_NO(18) | 5)
#define MT6397_PIN_18_COL6__FUNC_TEST_IN9 (MTK_PIN_NO(18) | 6)
#define MT6397_PIN_18_COL6__FUNC_TEST_OUT9 (MTK_PIN_NO(18) | 7)
#define MT6397_PIN_19_COL7__FUNC_GPIO19 (MTK_PIN_NO(19) | 0)
#define MT6397_PIN_19_COL7__FUNC_COL7 (MTK_PIN_NO(19) | 1)
#define MT6397_PIN_19_COL7__FUNC_EINT17_1X (MTK_PIN_NO(19) | 2)
#define MT6397_PIN_19_COL7__FUNC_PWM2_3X (MTK_PIN_NO(19) | 3)
#define MT6397_PIN_19_COL7__FUNC_GPIO32K_1 (MTK_PIN_NO(19) | 4)
#define MT6397_PIN_19_COL7__FUNC_GPIO26M_1 (MTK_PIN_NO(19) | 5)
#define MT6397_PIN_19_COL7__FUNC_TEST_IN10 (MTK_PIN_NO(19) | 6)
#define MT6397_PIN_19_COL7__FUNC_TEST_OUT10 (MTK_PIN_NO(19) | 7)
#define MT6397_PIN_20_ROW0__FUNC_GPIO20 (MTK_PIN_NO(20) | 0)
#define MT6397_PIN_20_ROW0__FUNC_ROW0 (MTK_PIN_NO(20) | 1)
#define MT6397_PIN_20_ROW0__FUNC_EINT18_1X (MTK_PIN_NO(20) | 2)
#define MT6397_PIN_20_ROW0__FUNC_SCL0_3X (MTK_PIN_NO(20) | 3)
#define MT6397_PIN_20_ROW0__FUNC_TEST_IN11 (MTK_PIN_NO(20) | 6)
#define MT6397_PIN_20_ROW0__FUNC_TEST_OUT11 (MTK_PIN_NO(20) | 7)
#define MT6397_PIN_21_ROW1__FUNC_GPIO21 (MTK_PIN_NO(21) | 0)
#define MT6397_PIN_21_ROW1__FUNC_ROW1 (MTK_PIN_NO(21) | 1)
#define MT6397_PIN_21_ROW1__FUNC_EINT19_1X (MTK_PIN_NO(21) | 2)
#define MT6397_PIN_21_ROW1__FUNC_SDA0_3X (MTK_PIN_NO(21) | 3)
#define MT6397_PIN_21_ROW1__FUNC_AUD_TSTCK (MTK_PIN_NO(21) | 4)
#define MT6397_PIN_21_ROW1__FUNC_TEST_IN12 (MTK_PIN_NO(21) | 6)
#define MT6397_PIN_21_ROW1__FUNC_TEST_OUT12 (MTK_PIN_NO(21) | 7)
#define MT6397_PIN_22_ROW2__FUNC_GPIO22 (MTK_PIN_NO(22) | 0)
#define MT6397_PIN_22_ROW2__FUNC_ROW2 (MTK_PIN_NO(22) | 1)
#define MT6397_PIN_22_ROW2__FUNC_EINT20_1X (MTK_PIN_NO(22) | 2)
#define MT6397_PIN_22_ROW2__FUNC_SCL1_3X (MTK_PIN_NO(22) | 3)
#define MT6397_PIN_22_ROW2__FUNC_TEST_IN13 (MTK_PIN_NO(22) | 6)
#define MT6397_PIN_22_ROW2__FUNC_TEST_OUT13 (MTK_PIN_NO(22) | 7)
#define MT6397_PIN_23_ROW3__FUNC_GPIO23 (MTK_PIN_NO(23) | 0)
#define MT6397_PIN_23_ROW3__FUNC_ROW3 (MTK_PIN_NO(23) | 1)
#define MT6397_PIN_23_ROW3__FUNC_EINT21_1X (MTK_PIN_NO(23) | 2)
#define MT6397_PIN_23_ROW3__FUNC_SDA1_3X (MTK_PIN_NO(23) | 3)
#define MT6397_PIN_23_ROW3__FUNC_TEST_IN14 (MTK_PIN_NO(23) | 6)
#define MT6397_PIN_23_ROW3__FUNC_TEST_OUT14 (MTK_PIN_NO(23) | 7)
#define MT6397_PIN_24_ROW4__FUNC_GPIO24 (MTK_PIN_NO(24) | 0)
#define MT6397_PIN_24_ROW4__FUNC_ROW4 (MTK_PIN_NO(24) | 1)
#define MT6397_PIN_24_ROW4__FUNC_EINT22_1X (MTK_PIN_NO(24) | 2)
#define MT6397_PIN_24_ROW4__FUNC_SCL2_3X (MTK_PIN_NO(24) | 3)
#define MT6397_PIN_24_ROW4__FUNC_TEST_IN15 (MTK_PIN_NO(24) | 6)
#define MT6397_PIN_24_ROW4__FUNC_TEST_OUT15 (MTK_PIN_NO(24) | 7)
#define MT6397_PIN_25_ROW5__FUNC_GPIO25 (MTK_PIN_NO(25) | 0)
#define MT6397_PIN_25_ROW5__FUNC_ROW5 (MTK_PIN_NO(25) | 1)
#define MT6397_PIN_25_ROW5__FUNC_EINT23_1X (MTK_PIN_NO(25) | 2)
#define MT6397_PIN_25_ROW5__FUNC_SDA2_3X (MTK_PIN_NO(25) | 3)
#define MT6397_PIN_25_ROW5__FUNC_TEST_IN16 (MTK_PIN_NO(25) | 6)
#define MT6397_PIN_25_ROW5__FUNC_TEST_OUT16 (MTK_PIN_NO(25) | 7)
#define MT6397_PIN_26_ROW6__FUNC_GPIO26 (MTK_PIN_NO(26) | 0)
#define MT6397_PIN_26_ROW6__FUNC_ROW6 (MTK_PIN_NO(26) | 1)
#define MT6397_PIN_26_ROW6__FUNC_EINT24_1X (MTK_PIN_NO(26) | 2)
#define MT6397_PIN_26_ROW6__FUNC_PWM3_3X (MTK_PIN_NO(26) | 3)
#define MT6397_PIN_26_ROW6__FUNC_GPIO32K_2 (MTK_PIN_NO(26) | 4)
#define MT6397_PIN_26_ROW6__FUNC_GPIO26M_2 (MTK_PIN_NO(26) | 5)
#define MT6397_PIN_26_ROW6__FUNC_TEST_IN17 (MTK_PIN_NO(26) | 6)
#define MT6397_PIN_26_ROW6__FUNC_TEST_OUT17 (MTK_PIN_NO(26) | 7)
#define MT6397_PIN_27_ROW7__FUNC_GPIO27 (MTK_PIN_NO(27) | 0)
#define MT6397_PIN_27_ROW7__FUNC_ROW7 (MTK_PIN_NO(27) | 1)
#define MT6397_PIN_27_ROW7__FUNC_EINT3_1X (MTK_PIN_NO(27) | 2)
#define MT6397_PIN_27_ROW7__FUNC_CBUS (MTK_PIN_NO(27) | 3)
#define MT6397_PIN_27_ROW7__FUNC_GPIO32K_3 (MTK_PIN_NO(27) | 4)
#define MT6397_PIN_27_ROW7__FUNC_GPIO26M_3 (MTK_PIN_NO(27) | 5)
#define MT6397_PIN_27_ROW7__FUNC_TEST_IN18 (MTK_PIN_NO(27) | 6)
#define MT6397_PIN_27_ROW7__FUNC_TEST_OUT18 (MTK_PIN_NO(27) | 7)
#define MT6397_PIN_28_PWM1__FUNC_GPIO28 (MTK_PIN_NO(28) | 0)
#define MT6397_PIN_28_PWM1__FUNC_PWM1 (MTK_PIN_NO(28) | 1)
#define MT6397_PIN_28_PWM1__FUNC_EINT4_1X (MTK_PIN_NO(28) | 2)
#define MT6397_PIN_28_PWM1__FUNC_GPIO32K_4 (MTK_PIN_NO(28) | 4)
#define MT6397_PIN_28_PWM1__FUNC_GPIO26M_4 (MTK_PIN_NO(28) | 5)
#define MT6397_PIN_28_PWM1__FUNC_TEST_IN19 (MTK_PIN_NO(28) | 6)
#define MT6397_PIN_28_PWM1__FUNC_TEST_OUT19 (MTK_PIN_NO(28) | 7)
#define MT6397_PIN_29_PWM2__FUNC_GPIO29 (MTK_PIN_NO(29) | 0)
#define MT6397_PIN_29_PWM2__FUNC_PWM2 (MTK_PIN_NO(29) | 1)
#define MT6397_PIN_29_PWM2__FUNC_EINT5_1X (MTK_PIN_NO(29) | 2)
#define MT6397_PIN_29_PWM2__FUNC_GPIO32K_5 (MTK_PIN_NO(29) | 4)
#define MT6397_PIN_29_PWM2__FUNC_GPIO26M_5 (MTK_PIN_NO(29) | 5)
#define MT6397_PIN_29_PWM2__FUNC_TEST_IN20 (MTK_PIN_NO(29) | 6)
#define MT6397_PIN_29_PWM2__FUNC_TEST_OUT20 (MTK_PIN_NO(29) | 7)
#define MT6397_PIN_30_PWM3__FUNC_GPIO30 (MTK_PIN_NO(30) | 0)
#define MT6397_PIN_30_PWM3__FUNC_PWM3 (MTK_PIN_NO(30) | 1)
#define MT6397_PIN_30_PWM3__FUNC_EINT6_1X (MTK_PIN_NO(30) | 2)
#define MT6397_PIN_30_PWM3__FUNC_COL0 (MTK_PIN_NO(30) | 3)
#define MT6397_PIN_30_PWM3__FUNC_GPIO32K_6 (MTK_PIN_NO(30) | 4)
#define MT6397_PIN_30_PWM3__FUNC_GPIO26M_6 (MTK_PIN_NO(30) | 5)
#define MT6397_PIN_30_PWM3__FUNC_TEST_IN21 (MTK_PIN_NO(30) | 6)
#define MT6397_PIN_30_PWM3__FUNC_TEST_OUT21 (MTK_PIN_NO(30) | 7)
#define MT6397_PIN_31_SCL0__FUNC_GPIO31 (MTK_PIN_NO(31) | 0)
#define MT6397_PIN_31_SCL0__FUNC_SCL0 (MTK_PIN_NO(31) | 1)
#define MT6397_PIN_31_SCL0__FUNC_EINT7_1X (MTK_PIN_NO(31) | 2)
#define MT6397_PIN_31_SCL0__FUNC_PWM1_2X (MTK_PIN_NO(31) | 3)
#define MT6397_PIN_31_SCL0__FUNC_TEST_IN22 (MTK_PIN_NO(31) | 6)
#define MT6397_PIN_31_SCL0__FUNC_TEST_OUT22 (MTK_PIN_NO(31) | 7)
#define MT6397_PIN_32_SDA0__FUNC_GPIO32 (MTK_PIN_NO(32) | 0)
#define MT6397_PIN_32_SDA0__FUNC_SDA0 (MTK_PIN_NO(32) | 1)
#define MT6397_PIN_32_SDA0__FUNC_EINT8_1X (MTK_PIN_NO(32) | 2)
#define MT6397_PIN_32_SDA0__FUNC_TEST_IN23 (MTK_PIN_NO(32) | 6)
#define MT6397_PIN_32_SDA0__FUNC_TEST_OUT23 (MTK_PIN_NO(32) | 7)
#define MT6397_PIN_33_SCL1__FUNC_GPIO33 (MTK_PIN_NO(33) | 0)
#define MT6397_PIN_33_SCL1__FUNC_SCL1 (MTK_PIN_NO(33) | 1)
#define MT6397_PIN_33_SCL1__FUNC_EINT9_1X (MTK_PIN_NO(33) | 2)
#define MT6397_PIN_33_SCL1__FUNC_PWM2_2X (MTK_PIN_NO(33) | 3)
#define MT6397_PIN_33_SCL1__FUNC_TEST_IN24 (MTK_PIN_NO(33) | 6)
#define MT6397_PIN_33_SCL1__FUNC_TEST_OUT24 (MTK_PIN_NO(33) | 7)
#define MT6397_PIN_34_SDA1__FUNC_GPIO34 (MTK_PIN_NO(34) | 0)
#define MT6397_PIN_34_SDA1__FUNC_SDA1 (MTK_PIN_NO(34) | 1)
#define MT6397_PIN_34_SDA1__FUNC_EINT0_1X (MTK_PIN_NO(34) | 2)
#define MT6397_PIN_34_SDA1__FUNC_TEST_IN25 (MTK_PIN_NO(34) | 6)
#define MT6397_PIN_34_SDA1__FUNC_TEST_OUT25 (MTK_PIN_NO(34) | 7)
#define MT6397_PIN_35_SCL2__FUNC_GPIO35 (MTK_PIN_NO(35) | 0)
#define MT6397_PIN_35_SCL2__FUNC_SCL2 (MTK_PIN_NO(35) | 1)
#define MT6397_PIN_35_SCL2__FUNC_EINT1_1X (MTK_PIN_NO(35) | 2)
#define MT6397_PIN_35_SCL2__FUNC_PWM3_2X (MTK_PIN_NO(35) | 3)
#define MT6397_PIN_35_SCL2__FUNC_TEST_IN26 (MTK_PIN_NO(35) | 6)
#define MT6397_PIN_35_SCL2__FUNC_TEST_OUT26 (MTK_PIN_NO(35) | 7)
#define MT6397_PIN_36_SDA2__FUNC_GPIO36 (MTK_PIN_NO(36) | 0)
#define MT6397_PIN_36_SDA2__FUNC_SDA2 (MTK_PIN_NO(36) | 1)
#define MT6397_PIN_36_SDA2__FUNC_EINT2_1X (MTK_PIN_NO(36) | 2)
#define MT6397_PIN_36_SDA2__FUNC_TEST_IN27 (MTK_PIN_NO(36) | 6)
#define MT6397_PIN_36_SDA2__FUNC_TEST_OUT27 (MTK_PIN_NO(36) | 7)
#define MT6397_PIN_37_HDMISD__FUNC_GPIO37 (MTK_PIN_NO(37) | 0)
#define MT6397_PIN_37_HDMISD__FUNC_HDMISD (MTK_PIN_NO(37) | 1)
#define MT6397_PIN_37_HDMISD__FUNC_TEST_IN28 (MTK_PIN_NO(37) | 6)
#define MT6397_PIN_37_HDMISD__FUNC_TEST_OUT28 (MTK_PIN_NO(37) | 7)
#define MT6397_PIN_38_HDMISCK__FUNC_GPIO38 (MTK_PIN_NO(38) | 0)
#define MT6397_PIN_38_HDMISCK__FUNC_HDMISCK (MTK_PIN_NO(38) | 1)
#define MT6397_PIN_38_HDMISCK__FUNC_TEST_IN29 (MTK_PIN_NO(38) | 6)
#define MT6397_PIN_38_HDMISCK__FUNC_TEST_OUT29 (MTK_PIN_NO(38) | 7)
#define MT6397_PIN_39_HTPLG__FUNC_GPIO39 (MTK_PIN_NO(39) | 0)
#define MT6397_PIN_39_HTPLG__FUNC_HTPLG (MTK_PIN_NO(39) | 1)
#define MT6397_PIN_39_HTPLG__FUNC_TEST_IN30 (MTK_PIN_NO(39) | 6)
#define MT6397_PIN_39_HTPLG__FUNC_TEST_OUT30 (MTK_PIN_NO(39) | 7)
#define MT6397_PIN_40_CEC__FUNC_GPIO40 (MTK_PIN_NO(40) | 0)
#define MT6397_PIN_40_CEC__FUNC_CEC (MTK_PIN_NO(40) | 1)
#define MT6397_PIN_40_CEC__FUNC_TEST_IN31 (MTK_PIN_NO(40) | 6)
#define MT6397_PIN_40_CEC__FUNC_TEST_OUT31 (MTK_PIN_NO(40) | 7)
#endif /* __DTS_MT6397_PINFUNC_H */

View file

@ -1,20 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0+ */
#ifndef __DT_BINDINGS_RESET_BCM6318_H
#define __DT_BINDINGS_RESET_BCM6318_H
#define BCM6318_RST_SPI 0
#define BCM6318_RST_EPHY 1
#define BCM6318_RST_SAR 2
#define BCM6318_RST_ENETSW 3
#define BCM6318_RST_USBD 4
#define BCM6318_RST_USBH 5
#define BCM6318_RST_PCIE_CORE 6
#define BCM6318_RST_PCIE 7
#define BCM6318_RST_PCIE_EXT 8
#define BCM6318_RST_PCIE_HARD 9
#define BCM6318_RST_ADSL 10
#define BCM6318_RST_PHYMIPS 11
#define BCM6318_RST_HOSTMIPS 12
#endif /* __DT_BINDINGS_RESET_BCM6318_H */

View file

@ -1,59 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright 2021 NXP
*/
#ifndef DT_BINDING_PCC_RESET_IMX8ULP_H
#define DT_BINDING_PCC_RESET_IMX8ULP_H
/* PCC3 */
#define PCC3_WDOG3_SWRST 0
#define PCC3_WDOG4_SWRST 1
#define PCC3_LPIT1_SWRST 2
#define PCC3_TPM4_SWRST 3
#define PCC3_TPM5_SWRST 4
#define PCC3_FLEXIO1_SWRST 5
#define PCC3_I3C2_SWRST 6
#define PCC3_LPI2C4_SWRST 7
#define PCC3_LPI2C5_SWRST 8
#define PCC3_LPUART4_SWRST 9
#define PCC3_LPUART5_SWRST 10
#define PCC3_LPSPI4_SWRST 11
#define PCC3_LPSPI5_SWRST 12
/* PCC4 */
#define PCC4_FLEXSPI2_SWRST 0
#define PCC4_TPM6_SWRST 1
#define PCC4_TPM7_SWRST 2
#define PCC4_LPI2C6_SWRST 3
#define PCC4_LPI2C7_SWRST 4
#define PCC4_LPUART6_SWRST 5
#define PCC4_LPUART7_SWRST 6
#define PCC4_SAI4_SWRST 7
#define PCC4_SAI5_SWRST 8
#define PCC4_USDHC0_SWRST 9
#define PCC4_USDHC1_SWRST 10
#define PCC4_USDHC2_SWRST 11
#define PCC4_USB0_SWRST 12
#define PCC4_USB0_PHY_SWRST 13
#define PCC4_USB1_SWRST 14
#define PCC4_USB1_PHY_SWRST 15
#define PCC4_ENET_SWRST 16
/* PCC5 */
#define PCC5_TPM8_SWRST 0
#define PCC5_SAI6_SWRST 1
#define PCC5_SAI7_SWRST 2
#define PCC5_SPDIF_SWRST 3
#define PCC5_ISI_SWRST 4
#define PCC5_CSI_REGS_SWRST 5
#define PCC5_CSI_SWRST 6
#define PCC5_DSI_SWRST 7
#define PCC5_WDOG5_SWRST 8
#define PCC5_EPDC_SWRST 9
#define PCC5_PXP_SWRST 10
#define PCC5_GPU2D_SWRST 11
#define PCC5_GPU3D_SWRST 12
#define PCC5_DC_NANO_SWRST 13
#endif /*DT_BINDING_RESET_IMX8ULP_H */

View file

@ -1,42 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com>
*/
#ifndef DT_RESET_OXSEMI_OX810SE_H
#define DT_RESET_OXSEMI_OX810SE_H
#define RESET_ARM 0
#define RESET_COPRO 1
/* Reserved 2 */
/* Reserved 3 */
#define RESET_USBHS 4
#define RESET_USBHSPHY 5
#define RESET_MAC 6
#define RESET_PCI 7
#define RESET_DMA 8
#define RESET_DPE 9
#define RESET_DDR 10
#define RESET_SATA 11
#define RESET_SATA_LINK 12
#define RESET_SATA_PHY 13
/* Reserved 14 */
#define RESET_NAND 15
#define RESET_GPIO 16
#define RESET_UART1 17
#define RESET_UART2 18
#define RESET_MISC 19
#define RESET_I2S 20
#define RESET_AHB_MON 21
#define RESET_UART3 22
#define RESET_UART4 23
#define RESET_SGDMA 24
/* Reserved 25 */
/* Reserved 26 */
/* Reserved 27 */
/* Reserved 28 */
/* Reserved 29 */
/* Reserved 30 */
#define RESET_BUS 31
#endif /* DT_RESET_OXSEMI_OX810SE_H */

View file

@ -1,42 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com>
*/
#ifndef DT_RESET_OXSEMI_OX820_H
#define DT_RESET_OXSEMI_OX820_H
#define RESET_SCU 0
#define RESET_LEON 1
#define RESET_ARM0 2
#define RESET_ARM1 3
#define RESET_USBHS 4
#define RESET_USBPHYA 5
#define RESET_MAC 6
#define RESET_PCIEA 7
#define RESET_SGDMA 8
#define RESET_CIPHER 9
#define RESET_DDR 10
#define RESET_SATA 11
#define RESET_SATA_LINK 12
#define RESET_SATA_PHY 13
#define RESET_PCIEPHY 14
#define RESET_NAND 15
#define RESET_GPIO 16
#define RESET_UART1 17
#define RESET_UART2 18
#define RESET_MISC 19
#define RESET_I2S 20
#define RESET_SD 21
#define RESET_MAC_2 22
#define RESET_PCIEB 23
#define RESET_VIDEO 24
#define RESET_DDR_PHY 25
#define RESET_USBPHYB 26
#define RESET_USBDEV 27
/* Reserved 29 */
#define RESET_ARMDBG 29
#define RESET_PLLA 30
#define RESET_PLLB 31
#endif /* DT_RESET_OXSEMI_OX820_H */

View file

@ -1,10 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __AUDIO_JACK_EVENTS_H
#define __AUDIO_JACK_EVENTS_H
#define JACK_HEADPHONE 1
#define JACK_MICROPHONE 2
#define JACK_LINEOUT 3
#define JACK_LINEIN 4
#endif /* __AUDIO_JACK_EVENTS_H */

View file

@ -1485,6 +1485,13 @@ static inline int of_property_read_s32(const struct device_node *np,
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
#define for_each_compatible_node_scoped(dn, type, compatible) \
for (struct device_node *dn __free(device_node) = \
of_find_compatible_node(NULL, type, compatible); \
dn; \
dn = of_find_compatible_node(dn, type, compatible))
#define for_each_matching_node(dn, matches) \
for (dn = of_find_matching_node(NULL, matches); dn; \
dn = of_find_matching_node(dn, matches))

View file

@ -105,7 +105,6 @@ ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
-Wno-graph_child_address \
-Wno-interrupt_map \
-Wno-simple_bus_reg
else

View file

@ -340,6 +340,14 @@ static void check_node_name_format(struct check *c, struct dt_info *dti,
}
ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars);
static void check_node_name_not_empty(struct check *c, struct dt_info *dti,
struct node *node)
{
if (node->basenamelen == 0 && node->parent != NULL)
FAIL(c, dti, node, "Empty node name");
}
ERROR(node_name_not_empty, check_node_name_not_empty, NULL, &node_name_chars);
static void check_node_name_vs_property_name(struct check *c,
struct dt_info *dti,
struct node *node)
@ -718,11 +726,14 @@ static void check_alias_paths(struct check *c, struct dt_info *dti,
continue;
}
if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) {
/* This check does not work for overlays with external paths */
if (!(dti->dtsflags & DTSF_PLUGIN) &&
(!prop->val.val || !get_node_by_path(dti->dt, prop->val.val))) {
FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)",
prop->val.val);
continue;
}
if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name))
FAIL(c, dti, node, "aliases property name must include only lowercase and '-'");
}
@ -1894,34 +1905,9 @@ static void check_graph_endpoint(struct check *c, struct dt_info *dti,
}
WARNING(graph_endpoint, check_graph_endpoint, NULL, &graph_nodes);
static void check_graph_child_address(struct check *c, struct dt_info *dti,
struct node *node)
{
int cnt = 0;
struct node *child;
if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus)
return;
for_each_child(node, child) {
struct property *prop = get_property(child, "reg");
/* No error if we have any non-zero unit address */
if (prop && propval_cell(prop) != 0 )
return;
cnt++;
}
if (cnt == 1 && node->addr_cells != -1)
FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not necessary",
node->children->name);
}
WARNING(graph_child_address, check_graph_child_address, NULL, &graph_nodes, &graph_port, &graph_endpoint);
static struct check *check_table[] = {
&duplicate_node_names, &duplicate_property_names,
&node_name_chars, &node_name_format, &property_name_chars,
&node_name_chars, &node_name_format, &node_name_not_empty, &property_name_chars,
&name_is_string, &name_properties, &node_name_vs_property_name,
&duplicate_label,
@ -2005,7 +1991,7 @@ static struct check *check_table[] = {
&alias_paths,
&graph_nodes, &graph_child_address, &graph_port, &graph_endpoint,
&graph_nodes, &graph_port, &graph_endpoint,
&always_fail,
};

View file

@ -72,6 +72,7 @@ def parse_compatibles(file, compat_ignore_list):
compat_list += parse_of_functions(data, "_is_compatible")
compat_list += parse_of_functions(data, "of_find_compatible_node")
compat_list += parse_of_functions(data, "for_each_compatible_node")
compat_list += parse_of_functions(data, "for_each_compatible_node_scoped")
compat_list += parse_of_functions(data, "of_get_compatible_child")
return compat_list

View file

@ -338,9 +338,14 @@ int main(int argc, char *argv[])
if (auto_label_aliases)
generate_label_tree(dti, "aliases", false);
generate_labels_from_tree(dti, "__symbols__");
if (generate_symbols)
generate_label_tree(dti, "__symbols__", true);
fixup_phandles(dti, "__fixups__");
local_fixup_phandles(dti, "__local_fixups__");
if (generate_fixups) {
generate_fixups_tree(dti, "__fixups__");
generate_local_fixups_tree(dti, "__local_fixups__");

View file

@ -339,9 +339,12 @@ struct dt_info *build_dt_info(unsigned int dtsflags,
struct reserve_info *reservelist,
struct node *tree, uint32_t boot_cpuid_phys);
void sort_tree(struct dt_info *dti);
void generate_labels_from_tree(struct dt_info *dti, const char *name);
void generate_label_tree(struct dt_info *dti, const char *name, bool allocph);
void generate_fixups_tree(struct dt_info *dti, const char *name);
void fixup_phandles(struct dt_info *dti, const char *name);
void generate_local_fixups_tree(struct dt_info *dti, const char *name);
void local_fixup_phandles(struct dt_info *dti, const char *name);
/* Checks */
@ -357,6 +360,9 @@ struct dt_info *dt_from_blob(const char *fname);
/* Tree source */
void property_add_marker(struct property *prop,
enum markertype type, unsigned int offset, char *ref);
void add_phandle_marker(struct dt_info *dti, struct property *prop, unsigned int offset);
void dt_to_source(FILE *f, struct dt_info *dti);
struct dt_info *dt_from_source(const char *f);

View file

@ -807,6 +807,7 @@ struct dt_info *dt_from_blob(const char *fname)
struct node *tree;
uint32_t val;
int flags = 0;
unsigned int dtsflags = DTSF_V1;
f = srcfile_relative_open(fname, NULL);
@ -919,5 +920,8 @@ struct dt_info *dt_from_blob(const char *fname)
fclose(f);
return build_dt_info(DTSF_V1, reservelist, tree, boot_cpuid_phys);
if (get_subnode(tree, "__fixups__") || get_subnode(tree, "__local_fixups__"))
dtsflags |= DTSF_PLUGIN;
return build_dt_info(dtsflags, reservelist, tree, boot_cpuid_phys);
}

View file

@ -407,7 +407,8 @@ static int overlay_fixup_phandle(void *fdt, void *fdto, int symbols_off,
const char *fixup_str = value;
uint32_t path_len, name_len;
uint32_t fixup_len;
char *sep, *endptr;
const char *sep;
char *endptr;
int poffset, ret;
fixup_end = memchr(value, '\0', len);

View file

@ -306,8 +306,8 @@ const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
const char *nameptr;
int err;
if (((err = fdt_ro_probe_(fdt)) < 0)
|| ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
if (!can_assume(VALID_DTB) && (((err = fdt_ro_probe_(fdt)) < 0)
|| ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0)))
goto fail;
nameptr = nh->name;

View file

@ -116,6 +116,20 @@ extern "C" {
/* Low-level functions (you probably don't need these) */
/**********************************************************************/
/**
* fdt_offset_ptr - safely get a byte range within the device tree blob
* @fdt: Pointer to the device tree blob
* @offset: Offset within the blob to the desired byte range
* @checklen: Required length of the byte range
*
* fdt_offset_ptr() returns a pointer to the byte range of length @checklen at
* the given @offset within the device tree blob, after verifying that the byte
* range fits entirely within the blob and does not overflow.
*
* returns:
* pointer to the byte range, on success
* NULL, if the requested range does not fit within the blob
*/
#ifndef SWIG /* This function is not useful in Python */
const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
#endif
@ -124,6 +138,20 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
}
/**
* fdt_next_tag - get next tag in the device tree
* @fdt: Pointer to the device tree blob
* @offset: Offset within the blob to start searching
* @nextoffset: Pointer to variable to store the offset of the next tag
*
* fdt_next_tag() returns the tag type of the next tag in the device tree
* blob starting from the given @offset. If @nextoffset is non-NULL, it will
* be set to the offset immediately following the tag.
*
* returns:
* the tag type (FDT_BEGIN_NODE, FDT_END_NODE, FDT_PROP, FDT_NOP, FDT_END),
* FDT_END, if offset is out of bounds
*/
uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
/*
@ -334,6 +362,23 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
/* Read-only functions */
/**********************************************************************/
/**
* fdt_check_full - check device tree validity
* @fdt: pointer to the device tree blob
* @bufsize: size of the buffer containing the device tree
*
* fdt_check_full() checks that the given buffer contains a valid
* flattened device tree and that the tree structure is internally
* consistent. This is a more thorough check than fdt_check_header().
*
* returns:
* 0, on success
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_check_full(const void *fdt, size_t bufsize);
/**
@ -1540,10 +1585,90 @@ int fdt_create_with_flags(void *buf, int bufsize, uint32_t flags);
*/
int fdt_create(void *buf, int bufsize);
/**
* fdt_resize - move and resize a device tree in sequential write state
* @fdt: Pointer to the device tree to resize
* @buf: Buffer where resized tree should be placed
* @bufsize: Size of the buffer at @buf
*
* fdt_resize() moves the device tree blob from @fdt to @buf and
* resizes it to fit in the new buffer size.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if @bufsize is too small
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
int fdt_resize(void *fdt, void *buf, int bufsize);
/**
* fdt_add_reservemap_entry - add an entry to the memory reserve map
* @fdt: Pointer to the device tree blob
* @addr: Start address of the reserve map entry
* @size: Size of the reserved region
*
* fdt_add_reservemap_entry() adds a memory reserve map entry to the
* device tree blob during the sequential write process. This function
* can only be called after fdt_create() and before fdt_finish_reservemap().
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if there is insufficient space in the blob
* -FDT_ERR_BADSTATE, if not in the correct sequential write state
*/
int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
/**
* fdt_finish_reservemap - complete the memory reserve map
* @fdt: Pointer to the device tree blob
*
* fdt_finish_reservemap() completes the memory reserve map section
* of the device tree blob during sequential write. After calling this
* function, no more reserve map entries can be added and the blob
* moves to the structure creation phase.
*
* returns:
* 0, on success
* -FDT_ERR_BADSTATE, if not in the correct sequential write state
*/
int fdt_finish_reservemap(void *fdt);
/**
* fdt_begin_node - start creation of a new node
* @fdt: Pointer to the device tree blob
* @name: Name of the node to create
*
* fdt_begin_node() starts the creation of a new node with the given
* @name during sequential write. After calling this function, properties
* can be added with fdt_property() and subnodes can be created with
* additional fdt_begin_node() calls. The node must be completed with
* fdt_end_node().
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if there is insufficient space in the blob
* -FDT_ERR_BADSTATE, if not in the correct sequential write state
*/
int fdt_begin_node(void *fdt, const char *name);
/**
* fdt_property - add a property to the current node
* @fdt: Pointer to the device tree blob
* @name: Name of the property to add
* @val: Pointer to the property value
* @len: Length of the property value in bytes
*
* fdt_property() adds a property with the given @name and value to
* the current node during sequential write. This function can only
* be called between fdt_begin_node() and fdt_end_node().
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if there is insufficient space in the blob
* -FDT_ERR_BADSTATE, if not currently within a node
*/
int fdt_property(void *fdt, const char *name, const void *val, int len);
static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
{
@ -1580,15 +1705,94 @@ int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
#define fdt_property_string(fdt, name, str) \
fdt_property(fdt, name, str, strlen(str)+1)
/**
* fdt_end_node - complete the current node
* @fdt: Pointer to the device tree blob
*
* fdt_end_node() completes the current node during sequential write. This
* function must be called to close each node started with
* fdt_begin_node(). After calling this function, no more properties or subnodes
* can be added to the node.
*
* returns:
* 0, on success
* -FDT_ERR_BADSTATE, if not currently within a node
*/
int fdt_end_node(void *fdt);
/**
* fdt_finish - complete device tree creation
* @fdt: Pointer to the device tree blob
*
* fdt_finish() completes the device tree creation process started with
* fdt_create(). This function finalizes the device tree blob and makes it ready
* for use. After calling this function, the blob is complete and can be used
* with libfdt read-only and read-write functions, but not with sequential write
* functions.
*
* returns:
* 0, on success
* -FDT_ERR_BADSTATE, if the sequential write process is incomplete
*/
int fdt_finish(void *fdt);
/**********************************************************************/
/* Read-write functions */
/**********************************************************************/
/**
* fdt_create_empty_tree - create an empty device tree
* @buf: Buffer where the empty tree should be created
* @bufsize: Size of the buffer at @buf
*
* fdt_create_empty_tree() creates a minimal empty device tree blob
* in the given buffer. The tree contains only a root node with no
* properties or subnodes.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if @bufsize is too small for even an empty tree
*/
int fdt_create_empty_tree(void *buf, int bufsize);
/**
* fdt_open_into - move a device tree into a new buffer and make editable
* @fdt: Pointer to the device tree to move
* @buf: Buffer where the editable tree should be placed
* @bufsize: Size of the buffer at @buf
*
* fdt_open_into() moves and reorganizes the device tree blob from @fdt
* into @buf, converting it to a format suitable for read-write operations.
* The new buffer should allow space for modifications.
*
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if @bufsize is too small
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
int fdt_open_into(const void *fdt, void *buf, int bufsize);
/**
* fdt_pack - pack a device tree blob
* @fdt: Pointer to the device tree blob
*
* fdt_pack() reorganizes the device tree blob to eliminate any free space
* and pack it into the minimum possible size. This is useful after making
* modifications that might have left gaps in the blob.
*
* returns:
* 0, on success
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_BADLAYOUT, standard meanings
*/
int fdt_pack(void *fdt);
/**
@ -2317,6 +2521,16 @@ int fdt_overlay_target_offset(const void *fdt, const void *fdto,
/* Debugging / informational functions */
/**********************************************************************/
/**
* fdt_strerror - return string description of error code
* @errval: Error code returned by a libfdt function
*
* fdt_strerror() returns a string description of the error code passed
* in @errval.
*
* returns:
* pointer to a string describing the error code
*/
const char *fdt_strerror(int errval);
#ifdef __cplusplus

View file

@ -66,31 +66,4 @@ static inline fdt64_t cpu_to_fdt64(uint64_t x)
#undef CPU_TO_FDT16
#undef EXTRACT_BYTE
#ifdef __APPLE__
#include <AvailabilityMacros.h>
/* strnlen() is not available on Mac OS < 10.7 */
# if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \
MAC_OS_X_VERSION_10_7)
#define strnlen fdt_strnlen
/*
* fdt_strnlen: returns the length of a string or max_count - which ever is
* smallest.
* Input 1 string: the string whose size is to be determined
* Input 2 max_count: the maximum value returned by this function
* Output: length of the string or max_count (the smallest of the two)
*/
static inline size_t fdt_strnlen(const char *string, size_t max_count)
{
const char *p = memchr(string, 0, max_count);
return p ? p - string : max_count;
}
#endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED <
MAC_OS_X_VERSION_10_7) */
#endif /* __APPLE__ */
#endif /* LIBFDT_ENV_H */

View file

@ -11,11 +11,13 @@
#define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE))
int32_t fdt_ro_probe_(const void *fdt);
#define FDT_RO_PROBE(fdt) \
{ \
int32_t totalsize_; \
if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \
return totalsize_; \
#define FDT_RO_PROBE(fdt) \
{ \
if (!can_assume(VALID_DTB)) { \
int32_t totalsize_; \
if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \
return totalsize_; \
} \
}
int fdt_check_node_offset_(const void *fdt, int offset);
@ -92,7 +94,7 @@ static inline uint64_t fdt64_ld_(const fdt64_t *p)
* signature or hash check before using libfdt.
*
* For situations where security is not a concern it may be safe to enable
* ASSUME_SANE.
* ASSUME_PERFECT.
*/
enum {
/*

View file

@ -340,20 +340,73 @@ void append_to_property(struct node *node,
char *name, const void *data, int len,
enum markertype type)
{
struct data d;
struct property *p;
p = get_property(node, name);
if (!p) {
p = build_property(name, empty_data, NULL);
add_property(node, p);
}
p->val = data_add_marker(p->val, type, name);
p->val = data_append_data(p->val, data, len);
}
static int append_unique_str_to_property(struct node *node,
char *name, const char *data, int len)
{
struct property *p;
p = get_property(node, name);
if (p) {
d = data_add_marker(p->val, type, name);
d = data_append_data(d, data, len);
p->val = d;
const char *s;
if (p->val.len && p->val.val[p->val.len - 1] != '\0')
/* The current content doesn't look like a string */
return -1;
for (s = p->val.val; s < p->val.val + p->val.len; s = strchr(s, '\0') + 1) {
if (strcmp(data, s) == 0)
/* data already contained in node.name */
return 0;
}
} else {
d = data_add_marker(empty_data, type, name);
d = data_append_data(d, data, len);
p = build_property(name, d, NULL);
p = build_property(name, empty_data, NULL);
add_property(node, p);
}
p->val = data_add_marker(p->val, TYPE_STRING, name);
p->val = data_append_data(p->val, data, len);
return 0;
}
static int append_unique_u32_to_property(struct node *node, char *name, fdt32_t value)
{
struct property *p;
p = get_property(node, name);
if (p) {
const fdt32_t *v, *val_end = (const fdt32_t *)p->val.val + p->val.len / 4;
if (p->val.len % 4 != 0)
/* The current content doesn't look like a u32 array */
return -1;
for (v = (const void *)p->val.val; v < val_end; v++) {
if (*v == value)
/* value already contained */
return 0;
}
} else {
p = build_property(name, empty_data, NULL);
add_property(node, p);
}
p->val = data_add_marker(p->val, TYPE_UINT32, name);
p->val = data_append_data(p->val, &value, 4);
return 0;
}
struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size)
@ -918,11 +971,12 @@ static bool any_fixup_tree(struct dt_info *dti, struct node *node)
return false;
}
static void add_fixup_entry(struct dt_info *dti, struct node *fn,
struct node *node, struct property *prop,
struct marker *m)
static int add_fixup_entry(struct dt_info *dti, struct node *fn,
struct node *node, struct property *prop,
struct marker *m)
{
char *entry;
int ret;
/* m->ref can only be a REF_PHANDLE, but check anyway */
assert(m->type == REF_PHANDLE);
@ -939,32 +993,39 @@ static void add_fixup_entry(struct dt_info *dti, struct node *fn,
xasprintf(&entry, "%s:%s:%u",
node->fullpath, prop->name, m->offset);
append_to_property(fn, m->ref, entry, strlen(entry) + 1, TYPE_STRING);
ret = append_unique_str_to_property(fn, m->ref, entry, strlen(entry) + 1);
free(entry);
return ret;
}
static void generate_fixups_tree_internal(struct dt_info *dti,
struct node *fn,
struct node *node)
static int generate_fixups_tree_internal(struct dt_info *dti,
struct node *fn,
struct node *node)
{
struct node *dt = dti->dt;
struct node *c;
struct property *prop;
struct marker *m;
struct node *refnode;
int ret = 0;
for_each_property(node, prop) {
m = prop->val.markers;
for_each_marker_of_type(m, REF_PHANDLE) {
refnode = get_node_by_ref(dt, m->ref);
if (!refnode)
add_fixup_entry(dti, fn, node, prop, m);
if (add_fixup_entry(dti, fn, node, prop, m))
ret = -1;
}
}
for_each_child(node, c)
generate_fixups_tree_internal(dti, fn, c);
if (generate_fixups_tree_internal(dti, fn, c))
ret = -1;
return ret;
}
static bool any_local_fixup_tree(struct dt_info *dti, struct node *node)
@ -989,7 +1050,7 @@ static bool any_local_fixup_tree(struct dt_info *dti, struct node *node)
return false;
}
static void add_local_fixup_entry(struct dt_info *dti,
static int add_local_fixup_entry(struct dt_info *dti,
struct node *lfn, struct node *node,
struct property *prop, struct marker *m,
struct node *refnode)
@ -1020,30 +1081,56 @@ static void add_local_fixup_entry(struct dt_info *dti,
free(compp);
value_32 = cpu_to_fdt32(m->offset);
append_to_property(wn, prop->name, &value_32, sizeof(value_32), TYPE_UINT32);
return append_unique_u32_to_property(wn, prop->name, value_32);
}
static void generate_local_fixups_tree_internal(struct dt_info *dti,
struct node *lfn,
struct node *node)
static int generate_local_fixups_tree_internal(struct dt_info *dti,
struct node *lfn,
struct node *node)
{
struct node *dt = dti->dt;
struct node *c;
struct property *prop;
struct marker *m;
struct node *refnode;
int ret = 0;
for_each_property(node, prop) {
m = prop->val.markers;
for_each_marker_of_type(m, REF_PHANDLE) {
refnode = get_node_by_ref(dt, m->ref);
if (refnode)
add_local_fixup_entry(dti, lfn, node, prop, m, refnode);
if (add_local_fixup_entry(dti, lfn, node, prop, m, refnode))
ret = -1;
}
}
for_each_child(node, c)
generate_local_fixups_tree_internal(dti, lfn, c);
if (generate_local_fixups_tree_internal(dti, lfn, c))
ret = -1;
return ret;
}
void generate_labels_from_tree(struct dt_info *dti, const char *name)
{
struct node *an;
struct property *p;
an = get_subnode(dti->dt, name);
if (!an)
return;
for_each_property(an, p) {
struct node *labeled_node;
labeled_node = get_node_by_path(dti->dt, p->val.val);
if (labeled_node)
add_label(&labeled_node->labels, p->name);
else if (quiet < 1)
fprintf(stderr, "Warning: Path %s referenced in property %s/%s missing",
p->val.val, name, p->name);
}
}
void generate_label_tree(struct dt_info *dti, const char *name, bool allocph)
@ -1056,29 +1143,173 @@ void generate_label_tree(struct dt_info *dti, const char *name, bool allocph)
void generate_fixups_tree(struct dt_info *dti, const char *name)
{
struct node *n = get_subnode(dti->dt, name);
/* Start with an empty __fixups__ node to not get duplicates */
if (n)
n->deleted = true;
if (!any_fixup_tree(dti, dti->dt))
return;
generate_fixups_tree_internal(dti,
build_and_name_child_node(dti->dt, name),
dti->dt);
if (generate_fixups_tree_internal(dti, build_root_node(dti->dt, name), dti->dt))
fprintf(stderr,
"Warning: Preexisting data in %s malformed, some content could not be added.\n",
name);
}
void fixup_phandles(struct dt_info *dti, const char *name)
{
struct node *an;
struct property *fp;
an = get_subnode(dti->dt, name);
if (!an)
return;
for_each_property(an, fp) {
char *fnext = fp->val.val;
char *fv;
unsigned int fl;
while ((fl = fp->val.len - (fnext - fp->val.val))) {
char *propname, *soffset;
struct node *n;
struct property *p;
long offset;
fv = fnext;
fnext = memchr(fv, 0, fl);
if (!fnext) {
if (quiet < 1)
fprintf(stderr, "Warning: Malformed fixup entry for label %s\n",
fp->name);
break;
}
fnext += 1;
propname = memchr(fv, ':', fnext - 1 - fv);
if (!propname) {
if (quiet < 1)
fprintf(stderr, "Warning: Malformed fixup entry for label %s\n",
fp->name);
continue;
}
propname++;
soffset = memchr(propname, ':', fnext - 1 - propname);
if (!soffset) {
if (quiet < 1)
fprintf(stderr, "Warning: Malformed fixup entry for label %s\n",
fp->name);
continue;
}
soffset++;
/*
* temporarily modify the property to not have to create
* a copy for the node path.
*/
*(propname - 1) = '\0';
n = get_node_by_path(dti->dt, fv);
if (!n && quiet < 1)
fprintf(stderr, "Warning: Label %s references non-existing node %s\n",
fp->name, fv);
*(propname - 1) = ':';
if (!n)
continue;
/*
* temporarily modify the property to not have to create
* a copy for the property name.
*/
*(soffset - 1) = '\0';
p = get_property(n, propname);
if (!p && quiet < 1)
fprintf(stderr, "Warning: Label %s references non-existing property %s in node %s\n",
fp->name, n->fullpath, propname);
*(soffset - 1) = ':';
if (!p)
continue;
offset = strtol(soffset, NULL, 0);
if (offset < 0 || offset + 4 > p->val.len) {
if (quiet < 1)
fprintf(stderr,
"Warning: Label %s contains invalid offset for property %s in node %s\n",
fp->name, p->name, n->fullpath);
continue;
}
property_add_marker(p, REF_PHANDLE, offset, fp->name);
}
}
}
void generate_local_fixups_tree(struct dt_info *dti, const char *name)
{
struct node *n = get_subnode(dti->dt, name);
/* Start with an empty __local_fixups__ node to not get duplicates */
if (n)
n->deleted = true;
if (!any_local_fixup_tree(dti, dti->dt))
return;
generate_local_fixups_tree_internal(dti,
build_and_name_child_node(dti->dt, name),
dti->dt);
if (generate_local_fixups_tree_internal(dti, build_root_node(dti->dt, name), dti->dt))
fprintf(stderr,
"Warning: Preexisting data in %s malformed, some content could not be added.\n",
name);
}
static void local_fixup_phandles_node(struct dt_info *dti, struct node *lf, struct node *n)
{
struct property *lfp;
struct node *lfsubnode;
for_each_property(lf, lfp) {
struct property *p = get_property(n, lfp->name);
fdt32_t *offsets = (fdt32_t *)lfp->val.val;
size_t i;
if (!p) {
if (quiet < 1)
fprintf(stderr, "Warning: Property %s in %s referenced in __local_fixups__ missing\n",
lfp->name, n->fullpath);
continue;
}
/*
* Each property in the __local_fixups__ tree is a concatenation
* of offsets, so it must be a multiple of sizeof(fdt32_t).
*/
if (lfp->val.len % sizeof(fdt32_t)) {
if (quiet < 1)
fprintf(stderr, "Warning: property %s in /__local_fixups__%s malformed\n",
lfp->name, n->fullpath);
continue;
}
for (i = 0; i < lfp->val.len / sizeof(fdt32_t); i++)
add_phandle_marker(dti, p, dtb_ld32(offsets + i));
}
for_each_child(lf, lfsubnode) {
struct node *subnode = get_subnode(n, lfsubnode->name);
if (!subnode) {
if (quiet < 1)
fprintf(stderr, "Warning: node %s/%s referenced in __local_fixups__ missing\n",
lfsubnode->name, n->fullpath);
continue;
}
local_fixup_phandles_node(dti, lfsubnode, subnode);
}
}
void local_fixup_phandles(struct dt_info *dti, const char *name)
{
struct node *an;
an = get_subnode(dti->dt, name);
if (!an)
return;
local_fixup_phandles_node(dti, an, dti->dt);
}

View file

@ -88,6 +88,26 @@ static char *shorten_to_initial_path(char *fname)
return NULL;
}
/**
* Returns true if the given path is an absolute one.
*
* On Windows, it either needs to begin with a forward slash or with a drive
* letter (e.g. "C:").
* On all other operating systems, it must begin with a forward slash to be
* considered an absolute path.
*/
static bool is_absolute_path(const char *path)
{
#ifdef WIN32
return (
path[0] == '/' ||
(((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':')
);
#else
return (path[0] == '/');
#endif
}
/**
* Try to open a file in a given directory.
*
@ -103,7 +123,7 @@ static char *try_open(const char *dirname, const char *fname, FILE **fp)
{
char *fullname;
if (!dirname || fname[0] == '/')
if (!dirname || is_absolute_path(fname))
fullname = xstrdup(fname);
else
fullname = join_path(dirname, fname);

View file

@ -173,23 +173,59 @@ static struct marker **add_marker(struct marker **mi,
return &nm->next;
}
static void add_string_markers(struct property *prop)
void property_add_marker(struct property *prop,
enum markertype type, unsigned int offset, char *ref)
{
int l, len = prop->val.len;
const char *p = prop->val.val;
add_marker(&prop->val.markers, type, offset, ref);
}
static void add_string_markers(struct property *prop, unsigned int offset, int len)
{
int l;
const char *p = prop->val.val + offset;
struct marker **mi = &prop->val.markers;
for (l = strlen(p) + 1; l < len; l += strlen(p + l) + 1)
mi = add_marker(mi, TYPE_STRING, l, NULL);
mi = add_marker(mi, TYPE_STRING, offset + l, NULL);
}
static enum markertype guess_value_type(struct property *prop)
void add_phandle_marker(struct dt_info *dti, struct property *prop, unsigned int offset)
{
int len = prop->val.len;
const char *p = prop->val.val;
struct marker *m = prop->val.markers;
cell_t phandle;
struct node *refn;
char *ref;
if (prop->val.len < offset + 4) {
if (quiet < 1)
fprintf(stderr,
"Warning: property %s too short to contain a phandle at offset %u\n",
prop->name, offset);
return;
}
phandle = dtb_ld32(prop->val.val + offset);
refn = get_node_by_phandle(dti->dt, phandle);
if (!refn) {
if (quiet < 1)
fprintf(stderr,
"Warning: node referenced by phandle 0x%x in property %s not found\n",
phandle, prop->name);
return;
}
if (refn->labels)
ref = refn->labels->label;
else
ref = refn->fullpath;
add_marker(&prop->val.markers, REF_PHANDLE, offset, ref);
}
static enum markertype guess_value_type(struct property *prop, unsigned int offset, int len)
{
const char *p = prop->val.val + offset;
int nnotstring = 0, nnul = 0;
int nnotstringlbl = 0, nnotcelllbl = 0;
int i;
for (i = 0; i < len; i++) {
@ -199,30 +235,49 @@ static enum markertype guess_value_type(struct property *prop)
nnul++;
}
for_each_marker_of_type(m, LABEL) {
if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
nnotstringlbl++;
if ((m->offset % sizeof(cell_t)) != 0)
nnotcelllbl++;
}
if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= (len-nnul))
&& (nnotstringlbl == 0)) {
if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= len - nnul)) {
if (nnul > 1)
add_string_markers(prop);
add_string_markers(prop, offset, len);
return TYPE_STRING;
} else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
} else if ((len % sizeof(cell_t)) == 0) {
return TYPE_UINT32;
}
return TYPE_UINT8;
}
static void guess_type_markers(struct property *prop)
{
struct marker **m = &prop->val.markers;
unsigned int offset = 0;
for (m = &prop->val.markers; *m; m = &((*m)->next)) {
if (is_type_marker((*m)->type))
/* assume the whole property is already marked */
return;
if ((*m)->offset > offset) {
m = add_marker(m, guess_value_type(prop, offset, (*m)->offset - offset),
offset, NULL);
offset = (*m)->offset;
}
if ((*m)->type == REF_PHANDLE) {
m = add_marker(m, TYPE_UINT32, offset, NULL);
offset += 4;
}
}
if (offset < prop->val.len)
add_marker(m, guess_value_type(prop, offset, prop->val.len - offset),
offset, NULL);
}
static void write_propval(FILE *f, struct property *prop)
{
size_t len = prop->val.len;
struct marker *m = prop->val.markers;
struct marker dummy_marker;
struct marker *m;
enum markertype emit_type = TYPE_NONE;
char *srcstr;
@ -241,14 +296,8 @@ static void write_propval(FILE *f, struct property *prop)
fprintf(f, " =");
if (!next_type_marker(m)) {
/* data type information missing, need to guess */
dummy_marker.type = guess_value_type(prop);
dummy_marker.next = prop->val.markers;
dummy_marker.offset = 0;
dummy_marker.ref = NULL;
m = &dummy_marker;
}
guess_type_markers(prop);
m = prop->val.markers;
for_each_marker(m) {
size_t chunk_len = (m->next ? m->next->offset : len) - m->offset;
@ -369,7 +418,10 @@ void dt_to_source(FILE *f, struct dt_info *dti)
{
struct reserve_info *re;
fprintf(f, "/dts-v1/;\n\n");
fprintf(f, "/dts-v1/;\n");
if (dti->dtsflags & DTSF_PLUGIN)
fprintf(f, "/plugin/;\n");
fprintf(f, "\n");
for (re = dti->reservelist; re; re = re->next) {
struct label *l;

View file

@ -1 +1 @@
#define DTC_VERSION "DTC 1.7.2-g52f07dcc"
#define DTC_VERSION "DTC 1.7.2-ga26ef640"