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

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

+1255 -1838
+1
.clang-format
··· 259 259 - 'for_each_collection' 260 260 - 'for_each_comp_order' 261 261 - 'for_each_compatible_node' 262 + - 'for_each_compatible_node_scoped' 262 263 - 'for_each_component_dais' 263 264 - 'for_each_component_dais_safe' 264 265 - 'for_each_conduit'
+4 -2
Documentation/devicetree/bindings/Makefile
··· 56 56 57 57 override DTC_FLAGS := \ 58 58 -Wno-avoid_unnecessary_addr_size \ 59 - -Wno-graph_child_address \ 60 59 -Wno-unique_unit_address \ 61 60 -Wunique_unit_address_if_enabled 62 61 ··· 81 82 dt_compatible_check: $(obj)/processed-schema.json 82 83 $(Q)$(srctree)/scripts/dtc/dt-extract-compatibles $(srctree) | xargs dt-check-compatible -v -s $< 83 84 85 + PHONY += dt_binding_check_one 86 + dt_binding_check_one: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked 87 + 84 88 PHONY += dt_binding_check 85 - dt_binding_check: $(obj)/.dt-binding.checked $(obj)/.yamllint.checked $(CHK_DT_EXAMPLES) 89 + dt_binding_check: dt_binding_check_one $(CHK_DT_EXAMPLES)
+6
Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml
··· 157 157 - const: simple-bus 158 158 - const: simple-bus 159 159 160 + "#interrupt-cells": 161 + const: 1 162 + 163 + interrupt-map: true 164 + interrupt-map-mask: true 165 + 160 166 patternProperties: 161 167 '^motherboard-bus@': 162 168 type: object
-24
Documentation/devicetree/bindings/arm/bcm/brcm,vulcan-soc.yaml
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - %YAML 1.2 3 - --- 4 - $id: http://devicetree.org/schemas/arm/bcm/brcm,vulcan-soc.yaml# 5 - $schema: http://devicetree.org/meta-schemas/core.yaml# 6 - 7 - title: Broadcom Vulcan 8 - 9 - maintainers: 10 - - Robert Richter <rrichter@marvell.com> 11 - 12 - properties: 13 - $nodename: 14 - const: '/' 15 - compatible: 16 - items: 17 - - enum: 18 - - brcm,vulcan-eval 19 - - cavium,thunderx2-cn9900 20 - - const: brcm,vulcan-soc 21 - 22 - additionalProperties: true 23 - 24 - ...
+8
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
··· 65 65 gpio-line-names: 66 66 minItems: 8 67 67 68 + patternProperties: 69 + '-hog$': 70 + required: 71 + - gpio-hog 72 + 68 73 required: 69 74 - compatible 70 75 - gpio-controller ··· 91 86 required: 92 87 - compatible 93 88 - "#reset-cells" 89 + 90 + power: 91 + $ref: /schemas/power/raspberrypi,bcm2835-power.yaml# 94 92 95 93 pwm: 96 94 type: object
-31
Documentation/devicetree/bindings/arm/omap/prm-inst.txt
··· 1 - OMAP PRM instance bindings 2 - 3 - Power and Reset Manager is an IP block on OMAP family of devices which 4 - handle the power domains and their current state, and provide reset 5 - handling for the domains and/or separate IP blocks under the power domain 6 - hierarchy. 7 - 8 - Required properties: 9 - - compatible: Must contain one of the following: 10 - "ti,am3-prm-inst" 11 - "ti,am4-prm-inst" 12 - "ti,omap4-prm-inst" 13 - "ti,omap5-prm-inst" 14 - "ti,dra7-prm-inst" 15 - and additionally must contain: 16 - "ti,omap-prm-inst" 17 - - reg: Contains PRM instance register address range 18 - (base address and length) 19 - 20 - Optional properties: 21 - - #power-domain-cells: Should be 0 if the instance is a power domain provider. 22 - - #reset-cells: Should be 1 if the PRM instance in question supports resets. 23 - 24 - Example: 25 - 26 - prm_dsp2: prm@1b00 { 27 - compatible = "ti,dra7-prm-inst", "ti,omap-prm-inst"; 28 - reg = <0x1b00 0x40>; 29 - #power-domain-cells = <0>; 30 - #reset-cells = <1>; 31 - };
+55
Documentation/devicetree/bindings/arm/ti/ti,omap-prm-inst.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/ti/ti,omap-prm-inst.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: OMAP PRM instances 8 + 9 + maintainers: 10 + - Aaro Koskinen <aaro.koskinen@iki.fi> 11 + - Andreas Kemnade <andreas@kemnade.info> 12 + - Kevin Hilman <khilman@baylibre.com> 13 + - Roger Quadros <rogerq@kernel.org> 14 + - Tony Lindgren <tony@atomide.com> 15 + 16 + description: 17 + Power and Reset Manager is an IP block on OMAP family of devices which 18 + handle the power domains and their current state, and provide reset 19 + handling for the domains and/or separate IP blocks under the power domain 20 + hierarchy. 21 + 22 + properties: 23 + compatible: 24 + items: 25 + - enum: 26 + - ti,am3-prm-inst 27 + - ti,am4-prm-inst 28 + - ti,omap4-prm-inst 29 + - ti,omap5-prm-inst 30 + - ti,dra7-prm-inst 31 + - const: ti,omap-prm-inst 32 + 33 + reg: 34 + maxItems: 1 35 + 36 + "#power-domain-cells": 37 + const: 0 38 + 39 + "#reset-cells": 40 + const: 1 41 + 42 + required: 43 + - compatible 44 + - reg 45 + 46 + additionalProperties: false 47 + 48 + examples: 49 + - | 50 + reset-controller@1b00 { 51 + compatible = "ti,dra7-prm-inst", "ti,omap-prm-inst"; 52 + reg = <0x1b00 0x40>; 53 + #power-domain-cells = <0>; 54 + #reset-cells = <1>; 55 + };
+3 -3
Documentation/devicetree/bindings/arm/vexpress-config.yaml
··· 103 103 - arm,vexpress,config-bridge 104 104 105 105 patternProperties: 106 - 'clk[0-9]*$': 106 + '^clock-controller.*$': 107 107 type: object 108 108 description: 109 109 clocks ··· 137 137 - arm,vexpress-sysreg,func 138 138 - "#clock-cells" 139 139 140 - "^volt-.+$": 140 + "^regulator-.+$": 141 141 $ref: /schemas/regulator/regulator.yaml# 142 142 properties: 143 143 compatible: ··· 272 272 compatible = "arm,vexpress,config-bus"; 273 273 arm,vexpress,config-bridge = <&v2m_sysreg>; 274 274 275 - clk0 { 275 + clock-controller { 276 276 compatible = "arm,vexpress-osc"; 277 277 arm,vexpress-sysreg,func = <1 0>; 278 278 #clock-cells = <0>;
+5 -3
Documentation/devicetree/bindings/bus/aspeed,ast2600-ahbc.yaml
··· 17 17 18 18 properties: 19 19 compatible: 20 - enum: 21 - - aspeed,ast2600-ahbc 20 + items: 21 + - enum: 22 + - aspeed,ast2600-ahbc 23 + - const: syscon 22 24 23 25 reg: 24 26 maxItems: 1 ··· 34 32 examples: 35 33 - | 36 34 ahbc@1e600000 { 37 - compatible = "aspeed,ast2600-ahbc"; 35 + compatible = "aspeed,ast2600-ahbc", "syscon"; 38 36 reg = <0x1e600000 0x100>; 39 37 };
+11 -3
Documentation/devicetree/bindings/bus/fsl,spba-bus.yaml
··· 19 19 the SDMA can access. There are no special clocks for the bus, because 20 20 the SDMA controller itself has its interrupt and clock assignments. 21 21 22 + EMI (External Memory Interface) for legacy i.MX35. 23 + 22 24 select: 23 25 properties: 24 26 compatible: 25 27 contains: 26 - const: fsl,spba-bus 28 + enum: 29 + - fsl,aips 30 + - fsl,emi 31 + - fsl,spba-bus 27 32 required: 28 33 - compatible 29 34 30 35 properties: 31 36 $nodename: 32 - pattern: "^spba-bus(@[0-9a-f]+)?$" 37 + pattern: "^((spba|emi)-bus|bus)(@[0-9a-f]+)?$" 33 38 34 39 compatible: 35 40 items: 36 - - const: fsl,spba-bus 41 + - enum: 42 + - fsl,aips 43 + - fsl,emi 44 + - fsl,spba-bus 37 45 - const: simple-bus 38 46 39 47 '#address-cells':
+1 -1
Documentation/devicetree/bindings/bus/st,stm32mp25-rifsc.yaml
··· 54 54 const: 1 55 55 56 56 "#size-cells": 57 - const: 1 57 + enum: [ 1, 2 ] 58 58 59 59 ranges: true 60 60
+7
Documentation/devicetree/bindings/crypto/aspeed,ast2600-acry.yaml
··· 30 30 interrupts: 31 31 maxItems: 1 32 32 33 + aspeed,ahbc: 34 + $ref: /schemas/types.yaml#/definitions/phandle 35 + description: 36 + A phandle to the AHB controller node, which must be a syscon 37 + 33 38 required: 34 39 - compatible 35 40 - reg 36 41 - clocks 37 42 - interrupts 43 + - aspeed,ahbc 38 44 39 45 additionalProperties: false 40 46 ··· 52 46 reg = <0x1e6fa000 0x400>, <0x1e710000 0x1800>; 53 47 interrupts = <160>; 54 48 clocks = <&syscon ASPEED_CLK_GATE_RSACLK>; 49 + aspeed,ahbc = <&ahbc>; 55 50 };
+22
Documentation/devicetree/bindings/crypto/inside-secure,safexcel.yaml
··· 12 12 properties: 13 13 compatible: 14 14 oneOf: 15 + - items: 16 + - const: marvell,armada-cp110-crypto 17 + - const: inside-secure,safexcel-eip197b 18 + - items: 19 + - enum: 20 + - marvell,armada-3700-crypto 21 + - mediatek,mt7986-crypto 22 + - const: inside-secure,safexcel-eip97ies 15 23 - const: inside-secure,safexcel-eip197b 16 24 - const: inside-secure,safexcel-eip197d 17 25 - const: inside-secure,safexcel-eip97ies ··· 34 26 maxItems: 1 35 27 36 28 interrupts: 29 + minItems: 4 37 30 maxItems: 6 38 31 39 32 interrupt-names: 33 + minItems: 4 40 34 items: 41 35 - const: ring0 42 36 - const: ring1 ··· 75 65 minItems: 2 76 66 required: 77 67 - clock-names 68 + - if: 69 + properties: 70 + compatible: 71 + not: 72 + contains: 73 + const: mediatek,mt7986-crypto 74 + then: 75 + properties: 76 + interrupts: 77 + minItems: 6 78 + interrupt-names: 79 + minItems: 6 78 80 79 81 additionalProperties: false 80 82
+10
Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml
··· 59 59 - compatible 60 60 - clocks 61 61 - ports 62 + - reg 62 63 63 64 allOf: 64 65 - if: ··· 74 73 ports: 75 74 properties: 76 75 port@2: false 76 + - if: 77 + not: 78 + properties: 79 + compatible: 80 + contains: 81 + const: fsl,imx6sx-ldb 82 + then: 83 + required: 84 + - reg-names 77 85 78 86 additionalProperties: false 79 87
-1
Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml
··· 79 79 required: 80 80 - compatible 81 81 - reg 82 - - reset-gpios 83 82 - ports 84 83 85 84 additionalProperties: false
+1
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml
··· 33 33 oneOf: 34 34 - items: 35 35 - enum: 36 + - onnn,fin3385 # OnSemi FIN3385 36 37 - ti,ds90c185 # For the TI DS90C185 FPD-Link Serializer 37 38 - ti,ds90c187 # For the TI DS90C187 FPD-Link Serializer 38 39 - ti,sn75lvds83 # For the TI SN75LVDS83 FlatLink transmitter
+3
Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml
··· 19 19 interrupts: 20 20 maxItems: 1 21 21 22 + clocks: 23 + maxItems: 1 24 + 22 25 video-ports: 23 26 $ref: /schemas/types.yaml#/definitions/uint32 24 27 default: 0x230145
+1 -1
Documentation/devicetree/bindings/display/bridge/toshiba,tc358767.yaml
··· 117 117 - 1 # 3.5dB pre-emphasis 118 118 - 2 # 6dB pre-emphasis 119 119 120 - oneOf: 120 + anyOf: 121 121 - required: 122 122 - port@0 123 123 - required:
-17
Documentation/devicetree/bindings/display/google,goldfish-fb.txt
··· 1 - Android Goldfish framebuffer 2 - 3 - Android Goldfish framebuffer device used by Android emulator. 4 - 5 - Required properties: 6 - 7 - - compatible : should contain "google,goldfish-fb" 8 - - reg : <registers mapping> 9 - - interrupts : <interrupt mapping> 10 - 11 - Example: 12 - 13 - display-controller@1f008000 { 14 - compatible = "google,goldfish-fb"; 15 - interrupts = <0x10>; 16 - reg = <0x1f008000 0x100>; 17 - };
+38
Documentation/devicetree/bindings/display/google,goldfish-fb.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/google,goldfish-fb.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Android Goldfish Framebuffer 8 + 9 + maintainers: 10 + - Kuan-Wei Chiu <visitorckw@gmail.com> 11 + 12 + description: 13 + Android Goldfish framebuffer device used by Android emulator. 14 + 15 + properties: 16 + compatible: 17 + const: google,goldfish-fb 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + required: 26 + - compatible 27 + - reg 28 + - interrupts 29 + 30 + additionalProperties: false 31 + 32 + examples: 33 + - | 34 + display@1f008000 { 35 + compatible = "google,goldfish-fb"; 36 + reg = <0x1f008000 0x100>; 37 + interrupts = <16>; 38 + };
+1 -1
Documentation/devicetree/bindings/dsp/mediatek,mt8186-dsp.yaml
··· 7 7 title: MediaTek mt8186 DSP core 8 8 9 9 maintainers: 10 - - Tinghan Shen <tinghan.shen@mediatek.com> 10 + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 11 11 12 12 description: | 13 13 MediaTek mt8186 SoC contains a DSP core used for
+1
Documentation/devicetree/bindings/eeprom/at25.yaml
··· 31 31 - fujitsu,mb85rs1mt 32 32 - fujitsu,mb85rs256 33 33 - fujitsu,mb85rs64 34 + - microchip,25aa010a 34 35 - microchip,at25160bn 35 36 - microchip,25lc040 36 37 - st,m95m02
+1 -1
Documentation/devicetree/bindings/embedded-controller/lenovo,yoga-c630-ec.yaml
··· 50 50 examples: 51 51 - |+ 52 52 #include <dt-bindings/interrupt-controller/irq.h> 53 - i2c1 { 53 + i2c { 54 54 clock-frequency = <400000>; 55 55 56 56 #address-cells = <1>;
-19
Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
··· 1 - Turris Mox rWTM firmware driver 2 - 3 - Required properties: 4 - - compatible : Should be "cznic,turris-mox-rwtm" 5 - - mboxes : Must contain a reference to associated mailbox 6 - 7 - This device tree node should be used on Turris Mox, or potentially another A3700 8 - compatible device running the Mox's rWTM firmware in the secure processor (for 9 - example it is possible to flash this firmware into EspressoBin). 10 - 11 - Example: 12 - 13 - firmware { 14 - turris-mox-rwtm { 15 - compatible = "cznic,turris-mox-rwtm"; 16 - mboxes = <&rwtm 0>; 17 - status = "okay"; 18 - }; 19 - };
+40
Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/firmware/cznic,turris-mox-rwtm.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: CZ.NIC Turris Mox rWTM firmware 8 + 9 + maintainers: 10 + - Marek Behún <kabel@kernel.org> 11 + 12 + description: 13 + This device tree node should be used on Turris Mox, or potentially another 14 + A3700 compatible device running the Mox's rWTM firmware in the secure 15 + processor (for example it is possible to flash this firmware into 16 + EspressoBin). 17 + 18 + properties: 19 + compatible: 20 + oneOf: 21 + - items: 22 + - const: marvell,armada-3700-rwtm-firmware 23 + - const: cznic,turris-mox-rwtm 24 + - const: marvell,armada-3700-rwtm-firmware 25 + 26 + mboxes: 27 + maxItems: 1 28 + 29 + required: 30 + - compatible 31 + - mboxes 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + turris-mox-rwtm { 38 + compatible = "marvell,armada-3700-rwtm-firmware", "cznic,turris-mox-rwtm"; 39 + mboxes = <&rwtm 0>; 40 + };
+11 -9
Documentation/devicetree/bindings/firmware/fsl,scu.yaml
··· 76 76 - description: TX0 MU channel 77 77 - description: RX0 MU channel 78 78 - description: optional MU channel for general interrupt 79 - - items: 79 + - deprecated: true 80 + items: 80 81 - description: TX0 MU channel 81 82 - description: TX1 MU channel 82 83 - description: TX2 MU channel ··· 86 85 - description: RX1 MU channel 87 86 - description: RX2 MU channel 88 87 - description: RX3 MU channel 89 - - items: 88 + - deprecated: true 89 + items: 90 90 - description: TX0 MU channel 91 91 - description: TX1 MU channel 92 92 - description: TX2 MU channel ··· 107 105 - const: tx0 108 106 - const: rx0 109 107 - const: gip3 110 - - items: 108 + - deprecated: true 109 + items: 111 110 - const: tx0 112 111 - const: tx1 113 112 - const: tx2 ··· 117 114 - const: rx1 118 115 - const: rx2 119 116 - const: rx3 120 - - items: 117 + - deprecated: true 118 + items: 121 119 - const: tx0 122 120 - const: tx1 123 121 - const: tx2 ··· 171 167 firmware { 172 168 system-controller { 173 169 compatible = "fsl,imx-scu"; 174 - mbox-names = "tx0", "tx1", "tx2", "tx3", 175 - "rx0", "rx1", "rx2", "rx3", 176 - "gip3"; 177 - mboxes = <&lsio_mu1 0 0 &lsio_mu1 0 1 &lsio_mu1 0 2 &lsio_mu1 0 3 178 - &lsio_mu1 1 0 &lsio_mu1 1 1 &lsio_mu1 1 2 &lsio_mu1 1 3 170 + mbox-names = "tx0", "rx0", "gip3"; 171 + mboxes = <&lsio_mu1 0 0 172 + &lsio_mu1 1 0 179 173 &lsio_mu1 3 3>; 180 174 181 175 clock-controller {
+20 -1
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
··· 76 76 type: object 77 77 78 78 pinctrl: 79 - $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# 80 79 description: The pinctrl node provides access to pinconfig and pincontrol 81 80 functionality available in firmware. 82 81 type: object ··· 105 106 type: object 106 107 deprecated: true 107 108 109 + allOf: 110 + - if: 111 + properties: 112 + compatible: 113 + contains: 114 + const: xlnx,zynqmp-firmware 115 + then: 116 + properties: 117 + pinctrl: 118 + $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# 119 + else: 120 + properties: 121 + pinctrl: 122 + $ref: /schemas/pinctrl/xlnx,versal-pinctrl.yaml# 123 + 108 124 required: 109 125 - compatible 110 126 ··· 130 116 #include <dt-bindings/power/xlnx-zynqmp-power.h> 131 117 firmware { 132 118 zynqmp_firmware: zynqmp-firmware { 119 + compatible = "xlnx,zynqmp-firmware"; 133 120 #power-domain-cells = <1>; 134 121 soc-nvmem { 135 122 compatible = "xlnx,zynqmp-nvmem-fw"; ··· 176 161 177 162 versal_fpga: versal-fpga { 178 163 compatible = "xlnx,versal-fpga"; 164 + }; 165 + 166 + pinctrl { 167 + compatible = "xlnx,versal-pinctrl"; 179 168 }; 180 169 181 170 xlnx_aes: zynqmp-aes {
+59
Documentation/devicetree/bindings/hwmon/iei,wt61p803-puzzle-hwmon.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: IEI WT61P803 PUZZLE MCU HWMON module from IEI Integration Corp. 8 + 9 + maintainers: 10 + - Luka Kovacic <luka.kovacic@sartura.hr> 11 + 12 + description: | 13 + This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details 14 + see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml. 15 + 16 + The HWMON module is a sub-node of the MCU node in the Device Tree. 17 + 18 + properties: 19 + compatible: 20 + const: iei,wt61p803-puzzle-hwmon 21 + 22 + '#address-cells': 23 + const: 1 24 + 25 + '#size-cells': 26 + const: 0 27 + 28 + patternProperties: 29 + '^fan-group@[0-1]$': 30 + type: object 31 + additionalProperties: false 32 + 33 + properties: 34 + reg: 35 + minimum: 0 36 + maximum: 1 37 + description: 38 + Fan group ID 39 + 40 + '#cooling-cells': 41 + const: 2 42 + 43 + cooling-levels: 44 + minItems: 1 45 + maxItems: 255 46 + description: 47 + Cooling levels for the fans (PWM value mapping) 48 + 49 + required: 50 + - reg 51 + - '#cooling-cells' 52 + - cooling-levels 53 + 54 + required: 55 + - compatible 56 + - '#address-cells' 57 + - '#size-cells' 58 + 59 + additionalProperties: false
+1 -1
Documentation/devicetree/bindings/hwmon/sensirion,shtc1.yaml
··· 7 7 title: Sensirion SHTC1 Humidity and Temperature Sensor IC 8 8 9 9 maintainers: 10 - - Christopher Ruehl chris.ruehl@gtsys.com.hk 10 + - Christopher Ruehl <chris.ruehl@gtsys.com.hk> 11 11 12 12 description: | 13 13 The SHTC1, SHTW1 and SHTC3 are digital humidity and temperature sensors
+1 -1
Documentation/devicetree/bindings/input/syna,rmi4.yaml
··· 8 8 9 9 maintainers: 10 10 - Jason A. Donenfeld <Jason@zx2c4.com> 11 - - Matthias Schiffer <matthias.schiffer@ew.tq-group.com 11 + - Matthias Schiffer <matthias.schiffer@ew.tq-group.com> 12 12 - Vincent Huang <vincent.huang@tw.synaptics.com> 13 13 14 14 description: |
+8
Documentation/devicetree/bindings/interrupt-controller/fsl,tzic.yaml
··· 14 14 oneOf: 15 15 - items: 16 16 - enum: 17 + - fsl,imx1-aitc 18 + - fsl,imx25-asic 19 + - fsl,imx27-aitc 20 + - fsl,imx31-avic 21 + - fsl,imx35-avic 22 + - const: fsl,avic 23 + - items: 24 + - enum: 17 25 - fsl,imx51-tzic 18 26 - fsl,imx53-tzic 19 27 - const: fsl,tzic
+3
Documentation/devicetree/bindings/interrupt-controller/loongson,eiointc.yaml
··· 29 29 interrupts: 30 30 maxItems: 1 31 31 32 + '#address-cells': 33 + const: 0 34 + 32 35 interrupt-controller: true 33 36 34 37 '#interrupt-cells':
+3
Documentation/devicetree/bindings/interrupt-controller/loongson,liointc.yaml
··· 40 40 - const: isr1 41 41 minItems: 2 42 42 43 + '#address-cells': 44 + const: 0 45 + 43 46 interrupt-controller: true 44 47 45 48 interrupts:
+3
Documentation/devicetree/bindings/interrupt-controller/loongson,pch-pic.yaml
··· 29 29 minimum: 0 30 30 maximum: 192 31 31 32 + '#address-cells': 33 + const: 0 34 + 32 35 interrupt-controller: true 33 36 34 37 '#interrupt-cells':
+41
Documentation/devicetree/bindings/leds/iei,wt61p803-puzzle-leds.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/iei,wt61p803-puzzle-leds.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: IEI WT61P803 PUZZLE MCU LED module from IEI Integration Corp. 8 + 9 + maintainers: 10 + - Luka Kovacic <luka.kovacic@sartura.hr> 11 + 12 + description: | 13 + This module is a part of the IEI WT61P803 PUZZLE MFD device. For more details 14 + see Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml. 15 + 16 + The LED module is a sub-node of the MCU node in the Device Tree. 17 + 18 + properties: 19 + compatible: 20 + const: iei,wt61p803-puzzle-leds 21 + 22 + '#address-cells': 23 + const: 1 24 + 25 + '#size-cells': 26 + const: 0 27 + 28 + led@0: 29 + $ref: common.yaml 30 + unevaluatedProperties: false 31 + 32 + properties: 33 + reg: 34 + const: 0 35 + 36 + required: 37 + - compatible 38 + - '#address-cells' 39 + - '#size-cells' 40 + 41 + additionalProperties: false
+1 -1
Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml
··· 95 95 #include <dt-bindings/gpio/gpio.h> 96 96 #include <dt-bindings/media/video-interfaces.h> 97 97 98 - i2c0 { 98 + i2c { 99 99 #address-cells = <1>; 100 100 #size-cells = <0>; 101 101
+1 -1
Documentation/devicetree/bindings/media/samsung,exynos5250-gsc.yaml
··· 9 9 maintainers: 10 10 - Inki Dae <inki.dae@samsung.com> 11 11 - Krzysztof Kozlowski <krzk@kernel.org> 12 - - Seung-Woo Kim <sw0312.kim@samsung.com 12 + - Seung-Woo Kim <sw0312.kim@samsung.com> 13 13 14 14 description: 15 15 G-Scaler is used for scaling and color space conversion on Samsung Exynos
+80
Documentation/devicetree/bindings/mfd/iei,wt61p803-puzzle.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/iei,wt61p803-puzzle.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: IEI WT61P803 PUZZLE MCU from IEI Integration Corp. 8 + 9 + maintainers: 10 + - Luka Kovacic <luka.kovacic@sartura.hr> 11 + 12 + description: | 13 + IEI WT61P803 PUZZLE MCU is embedded in some IEI Puzzle series boards. 14 + It's used for controlling system power states, fans, LEDs and temperature 15 + sensors. 16 + 17 + For Device Tree bindings of other sub-modules (HWMON, LEDs) refer to the 18 + binding documents under the respective subsystem directories. 19 + 20 + properties: 21 + compatible: 22 + const: iei,wt61p803-puzzle 23 + 24 + current-speed: true 25 + 26 + enable-beep: 27 + type: boolean 28 + 29 + hwmon: 30 + $ref: /schemas/hwmon/iei,wt61p803-puzzle-hwmon.yaml 31 + 32 + leds: 33 + $ref: /schemas/leds/iei,wt61p803-puzzle-leds.yaml 34 + 35 + required: 36 + - compatible 37 + - current-speed 38 + 39 + additionalProperties: false 40 + 41 + examples: 42 + - | 43 + #include <dt-bindings/leds/common.h> 44 + serial { 45 + mcu { 46 + compatible = "iei,wt61p803-puzzle"; 47 + current-speed = <115200>; 48 + enable-beep; 49 + 50 + leds { 51 + compatible = "iei,wt61p803-puzzle-leds"; 52 + #address-cells = <1>; 53 + #size-cells = <0>; 54 + 55 + led@0 { 56 + reg = <0>; 57 + function = LED_FUNCTION_POWER; 58 + color = <LED_COLOR_ID_BLUE>; 59 + }; 60 + }; 61 + 62 + hwmon { 63 + compatible = "iei,wt61p803-puzzle-hwmon"; 64 + #address-cells = <1>; 65 + #size-cells = <0>; 66 + 67 + fan-group@0 { 68 + #cooling-cells = <2>; 69 + reg = <0x00>; 70 + cooling-levels = <64 102 170 230 250>; 71 + }; 72 + 73 + fan-group@1 { 74 + #cooling-cells = <2>; 75 + reg = <0x01>; 76 + cooling-levels = <64 102 170 230 250>; 77 + }; 78 + }; 79 + }; 80 + };
+2 -1
Documentation/devicetree/bindings/mfd/mediatek,mt8195-scpsys.yaml
··· 7 7 title: MediaTek System Control Processor System 8 8 9 9 maintainers: 10 - - MandyJH Liu <mandyjh.liu@mediatek.com> 10 + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 11 + - Matthias Brugger <matthias.bgg@gmail.com> 11 12 12 13 description: 13 14 MediaTek System Control Processor System (SCPSYS) has several
+69
Documentation/devicetree/bindings/mfd/realtek,rtd1xxx.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/realtek,rtd1xxx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Realtek RTD1xxx system controllers 8 + 9 + maintainers: 10 + - Andreas Färber <afaerber@suse.de> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - enum: 16 + - realtek,rtd1293-crt 17 + - realtek,rtd1293-iso 18 + - realtek,rtd1293-misc 19 + - realtek,rtd1293-sb2 20 + - realtek,rtd1293-scpu-wrapper 21 + - realtek,rtd1295-crt 22 + - realtek,rtd1295-iso 23 + - realtek,rtd1295-misc 24 + - realtek,rtd1295-sb2 25 + - realtek,rtd1295-scpu-wrapper 26 + - realtek,rtd1296-crt 27 + - realtek,rtd1296-iso 28 + - realtek,rtd1296-misc 29 + - realtek,rtd1296-sb2 30 + - realtek,rtd1296-scpu-wrapper 31 + - realtek,rtd1395-crt 32 + - realtek,rtd1395-iso 33 + - realtek,rtd1395-misc 34 + - realtek,rtd1395-sb2 35 + - realtek,rtd1395-scpu-wrapper 36 + - realtek,rtd1619-crt 37 + - realtek,rtd1619-iso 38 + - realtek,rtd1619-misc 39 + - realtek,rtd1619-sb2 40 + - realtek,rtd1619-scpu-wrapper 41 + - const: syscon 42 + - const: simple-mfd 43 + 44 + reg: 45 + maxItems: 1 46 + 47 + reg-io-width: 48 + const: 4 49 + 50 + ranges: true 51 + 52 + '#address-cells': 53 + const: 1 54 + 55 + '#size-cells': 56 + const: 1 57 + 58 + patternProperties: 59 + '@[0-9a-f]+$': 60 + type: object 61 + 62 + required: 63 + - compatible 64 + 65 + required: 66 + - compatible 67 + - reg 68 + 69 + additionalProperties: false
+2
Documentation/devicetree/bindings/net/brcm,amac.yaml
··· 73 73 - const: idm_base 74 74 - const: nicpm_base 75 75 76 + dma-coherent: true 77 + 76 78 unevaluatedProperties: false 77 79 78 80 examples:
+1 -1
Documentation/devicetree/bindings/pci/mbvl,gpex40-pcie.yaml
··· 7 7 title: Mobiveil AXI PCIe Host Bridge 8 8 9 9 maintainers: 10 - - Frank Li <Frank Li@nxp.com> 10 + - Frank Li <Frank.Li@nxp.com> 11 11 12 12 description: 13 13 Mobiveil's GPEX 4.0 is a PCIe Gen4 host bridge IP. This configurable IP
+1 -1
Documentation/devicetree/bindings/power/mediatek,power-controller.yaml
··· 7 7 title: Mediatek Power Domains Controller 8 8 9 9 maintainers: 10 - - MandyJH Liu <mandyjh.liu@mediatek.com> 10 + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 11 11 - Matthias Brugger <mbrugger@suse.com> 12 12 13 13 description: |
+7 -1
Documentation/devicetree/bindings/power/reset/syscon-poweroff.yaml
··· 23 23 compatible: 24 24 const: syscon-poweroff 25 25 26 + reg: 27 + maxItems: 1 28 + 26 29 mask: 27 30 $ref: /schemas/types.yaml#/definitions/uint32 28 31 description: Update only the register bits defined by the mask (32 bit). ··· 47 44 48 45 required: 49 46 - compatible 50 - - offset 47 + 48 + anyOf: 49 + - required: [offset] 50 + - required: [reg] 51 51 52 52 additionalProperties: false 53 53
+1 -1
Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml
··· 79 79 required: 80 80 - value 81 81 82 - oneOf: 82 + anyOf: 83 83 - required: [offset] 84 84 - required: [reg] 85 85
+1 -1
Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
··· 7 7 title: Mediatek SCP 8 8 9 9 maintainers: 10 - - Tinghan Shen <tinghan.shen@mediatek.com> 10 + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> 11 11 12 12 description: 13 13 This binding provides support for ARM Cortex M4 Co-processor found on some
+2 -2
Documentation/devicetree/bindings/submitting-patches.rst
··· 15 15 16 16 "dt-bindings: <binding dir>: ..." 17 17 18 - Few subsystems, like ASoC, media, regulators and SPI, expect reverse order 19 - of the prefixes:: 18 + Few subsystems, like ASoC, media, regulators, SCSI, SPI and UFS, expect 19 + reverse order of the prefixes, based on subsystem name:: 20 20 21 21 "<binding dir>: dt-bindings: ..." 22 22
+8
Documentation/devicetree/bindings/trivial-devices.yaml
··· 91 91 - delta,ahe50dc-fan 92 92 # Delta Electronics DPS-650-AB power supply 93 93 - delta,dps650ab 94 + # Delta Electronics DPS-800-AB power supply 95 + - delta,dps800 94 96 # Delta Electronics DPS920AB 920W 54V Power Supply 95 97 - delta,dps920ab 96 98 # 1/4 Brick DC/DC Regulated Power Module ··· 137 135 - ibm,cffps2 138 136 # IBM On-Chip Controller hwmon device 139 137 - ibm,p8-occ-hwmon 138 + # Infineon Digital Multi-phase Controller 139 + - infineon,ir35221 140 140 # Infineon IR36021 digital POL buck controller 141 141 - infineon,ir36021 142 142 # Infineon IRPS5401 Voltage Regulator (PMIC) 143 143 - infineon,irps5401 144 + # Infineon Digital Dual Output 6+1 VR12.5 & VR13 CPU Controller 145 + - infineon,pxe1610 144 146 # Infineon Hot-swap controller xdp710 145 147 - infineon,xdp710 146 148 # Infineon Multi-phase Digital VR Controller xdpe11280 ··· 424 418 - smsc,emc6d103 425 419 # Temperature sensor with integrated fan control 426 420 - smsc,emc6d103s 421 + # Socionext Uniphier SMP control registers 422 + - socionext,uniphier-smpctrl 427 423 # SparkFun Qwiic Joystick (COM-15168) with i2c interface 428 424 - sparkfun,qwiic-joystick 429 425 # STMicroelectronics Hot-swap controller stef48h28
+1 -1
Documentation/devicetree/bindings/usb/ite,it5205.yaml
··· 49 49 examples: 50 50 - | 51 51 #include <dt-bindings/interrupt-controller/irq.h> 52 - i2c2 { 52 + i2c { 53 53 #address-cells = <1>; 54 54 #size-cells = <0>; 55 55
+8 -4
Documentation/devicetree/bindings/writing-schema.rst
··· 214 214 215 215 make dt_binding_check 216 216 217 + Or to validate a single schema and its example:: 218 + 219 + make sram/sram.yaml 220 + 217 221 In order to perform validation of DT source files, use the ``dtbs_check`` target:: 218 222 219 223 make dtbs_check ··· 230 226 231 227 make dt_binding_check dtbs_check 232 228 233 - It is also possible to run checks with a subset of matching schema files by 234 - setting the ``DT_SCHEMA_FILES`` variable to 1 or more specific schema files or 235 - patterns (partial match of a fixed string). Each file or pattern should be 236 - separated by ':'. 229 + It is also possible to combine running the above commands with a subset of 230 + matching schema files by setting the ``DT_SCHEMA_FILES`` variable to 1 or more 231 + specific schema files or patterns (partial match of a fixed string). Each file 232 + or pattern should be separated by ':'. 237 233 238 234 :: 239 235
+2 -8
MAINTAINERS
··· 2728 2728 F: Documentation/ABI/testing/sysfs-bus-moxtet-devices 2729 2729 F: Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm 2730 2730 F: Documentation/devicetree/bindings/bus/cznic,moxtet.yaml 2731 - F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt 2731 + F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml 2732 2732 F: Documentation/devicetree/bindings/firmware/cznic,turris-omnia-mcu.yaml 2733 2733 F: Documentation/devicetree/bindings/interrupt-controller/marvell,mpic.yaml 2734 2734 F: Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml ··· 5775 5775 S: Supported 5776 5776 W: http://www.marvell.com 5777 5777 F: drivers/crypto/cavium/cpt/ 5778 - 5779 - CAVIUM THUNDERX2 ARM64 SOC 5780 - M: Robert Richter <rric@kernel.org> 5781 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 5782 - S: Odd Fixes 5783 - F: Documentation/devicetree/bindings/arm/bcm/brcm,vulcan-soc.yaml 5784 - F: arch/arm64/boot/dts/cavium/thunder2-99xx* 5785 5778 5786 5779 CBS/ETF/TAPRIO QDISCS 5787 5780 M: Vinicius Costa Gomes <vinicius.gomes@intel.com> ··· 19713 19720 F: rust/helpers/of.c 19714 19721 F: rust/kernel/of.rs 19715 19722 F: scripts/dtc/ 19723 + F: scripts/Makefile.dtb* 19716 19724 F: tools/testing/selftests/dt/ 19717 19725 K: of_overlay_notifier_ 19718 19726 K: of_overlay_fdt_apply
+10 -4
Makefile
··· 1529 1529 dtstree := arch/$(SRCARCH)/boot/dts 1530 1530 endif 1531 1531 1532 + dtbindingtree := Documentation/devicetree/bindings 1533 + 1534 + %.yaml: dtbs_prepare 1535 + $(Q)$(MAKE) $(build)=$(dtbindingtree) \ 1536 + $(dtbindingtree)/$(patsubst %.yaml,%.example.dtb,$@) dt_binding_check_one 1537 + 1532 1538 ifneq ($(dtstree),) 1533 1539 1534 1540 %.dtb: dtbs_prepare ··· 1552 1546 # dtbs_install depend on it as dtbs_install may run as root. 1553 1547 dtbs_prepare: include/config/kernel.release scripts_dtc 1554 1548 1555 - ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),) 1549 + ifneq ($(filter dtbs_check %.yaml, $(MAKECMDGOALS)),) 1556 1550 export CHECK_DTBS=y 1557 1551 endif 1558 1552 ··· 1585 1579 1586 1580 PHONY += dt_binding_check dt_binding_schemas 1587 1581 dt_binding_check: dt_binding_schemas scripts_dtc 1588 - $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@ 1582 + $(Q)$(MAKE) $(build)=$(dtbindingtree) $@ 1589 1583 1590 1584 dt_binding_schemas: 1591 - $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings 1585 + $(Q)$(MAKE) $(build)=$(dtbindingtree) 1592 1586 1593 1587 PHONY += dt_compatible_check 1594 1588 dt_compatible_check: dt_binding_schemas 1595 - $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings $@ 1589 + $(Q)$(MAKE) $(build)=$(dtbindingtree) $@ 1596 1590 1597 1591 # --------------------------------------------------------------------------- 1598 1592 # Modules
+2 -5
arch/arm/mach-at91/pm.c
··· 982 982 struct gen_pool *sram_pool; 983 983 phys_addr_t sram_pbase; 984 984 unsigned long sram_base; 985 - struct device_node *node; 986 985 struct platform_device *pdev = NULL; 987 986 988 - for_each_compatible_node(node, NULL, "mmio-sram") { 987 + for_each_compatible_node_scoped(node, NULL, "mmio-sram") { 989 988 pdev = of_find_device_by_node(node); 990 - if (pdev) { 991 - of_node_put(node); 989 + if (pdev) 992 990 break; 993 - } 994 991 } 995 992 996 993 if (!pdev) {
+2 -6
arch/arm/mach-exynos/exynos.c
··· 47 47 48 48 void __init exynos_sysram_init(void) 49 49 { 50 - struct device_node *node; 51 - 52 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { 50 + for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram") { 53 51 struct resource res; 54 52 if (!of_device_is_available(node)) 55 53 continue; ··· 55 57 of_address_to_resource(node, 0, &res); 56 58 sysram_base_addr = ioremap(res.start, resource_size(&res)); 57 59 sysram_base_phys = res.start; 58 - of_node_put(node); 59 60 break; 60 61 } 61 62 62 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { 63 + for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") { 63 64 if (!of_device_is_available(node)) 64 65 continue; 65 66 sysram_ns_base_addr = of_iomap(node, 0); 66 - of_node_put(node); 67 67 break; 68 68 } 69 69 }
+1 -4
arch/powerpc/platforms/44x/fsp2.c
··· 199 199 200 200 static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler) 201 201 { 202 - struct device_node *np; 203 202 unsigned int irq; 204 203 int32_t rc; 205 204 206 - for_each_compatible_node(np, NULL, compat) { 205 + for_each_compatible_node_scoped(np, NULL, compat) { 207 206 irq = irq_of_parse_and_map(np, 0); 208 207 if (!irq) { 209 208 pr_err("device tree node %pOFn is missing a interrupt", 210 209 np); 211 - of_node_put(np); 212 210 return; 213 211 } 214 212 ··· 214 216 if (rc) { 215 217 pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d", 216 218 np, rc); 217 - of_node_put(np); 218 219 return; 219 220 } 220 221 }
+1 -3
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
··· 201 201 void __init hlwd_pic_probe(void) 202 202 { 203 203 struct irq_domain *host; 204 - struct device_node *np; 205 204 const u32 *interrupts; 206 205 int cascade_virq; 207 206 208 - for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") { 207 + for_each_compatible_node_scoped(np, NULL, "nintendo,hollywood-pic") { 209 208 interrupts = of_get_property(np, "interrupts", NULL); 210 209 if (interrupts) { 211 210 host = hlwd_pic_init(np); ··· 214 215 irq_set_chained_handler(cascade_virq, 215 216 hlwd_pic_irq_cascade); 216 217 hlwd_irq_host = host; 217 - of_node_put(np); 218 218 break; 219 219 } 220 220 }
+4 -11
drivers/cdx/cdx.c
··· 608 608 { 609 609 struct cdx_controller *cdx; 610 610 struct platform_device *pd; 611 - struct device_node *np; 612 611 bool val; 613 612 614 613 if (kstrtobool(buf, &val) < 0) ··· 616 617 if (!val) 617 618 return -EINVAL; 618 619 619 - mutex_lock(&cdx_controller_lock); 620 + guard(mutex)(&cdx_controller_lock); 620 621 621 622 /* Unregister all the devices on the bus */ 622 623 cdx_unregister_devices(&cdx_bus_type); 623 624 624 625 /* Rescan all the devices */ 625 - for_each_compatible_node(np, NULL, compat_node_name) { 626 + for_each_compatible_node_scoped(np, NULL, compat_node_name) { 626 627 pd = of_find_device_by_node(np); 627 - if (!pd) { 628 - of_node_put(np); 629 - count = -EINVAL; 630 - goto unlock; 631 - } 628 + if (!pd) 629 + return -EINVAL; 632 630 633 631 cdx = platform_get_drvdata(pd); 634 632 if (cdx && cdx->controller_registered && cdx->ops->scan) ··· 633 637 634 638 put_device(&pd->dev); 635 639 } 636 - 637 - unlock: 638 - mutex_unlock(&cdx_controller_lock); 639 640 640 641 return count; 641 642 }
+2 -5
drivers/clk/imx/clk-imx27.c
··· 171 171 172 172 static void __init mx27_clocks_init_dt(struct device_node *np) 173 173 { 174 - struct device_node *refnp; 175 174 u32 fref = 26000000; /* default */ 176 175 177 - for_each_compatible_node(refnp, NULL, "fixed-clock") { 176 + for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") { 178 177 if (!of_device_is_compatible(refnp, "fsl,imx-osc26m")) 179 178 continue; 180 179 181 - if (!of_property_read_u32(refnp, "clock-frequency", &fref)) { 182 - of_node_put(refnp); 180 + if (!of_property_read_u32(refnp, "clock-frequency", &fref)) 183 181 break; 184 - } 185 182 } 186 183 187 184 ccm = of_iomap(np, 0);
+2 -5
drivers/clk/imx/clk-imx31.c
··· 123 123 124 124 static void __init mx31_clocks_init_dt(struct device_node *np) 125 125 { 126 - struct device_node *osc_np; 127 126 u32 fref = 26000000; /* default */ 128 127 void __iomem *ccm; 129 128 130 - for_each_compatible_node(osc_np, NULL, "fixed-clock") { 129 + for_each_compatible_node_scoped(osc_np, NULL, "fixed-clock") { 131 130 if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m")) 132 131 continue; 133 132 134 - if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) { 135 - of_node_put(osc_np); 133 + if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) 136 134 break; 137 - } 138 135 } 139 136 140 137 ccm = of_iomap(np, 0);
+4 -6
drivers/cpufreq/s5pv210-cpufreq.c
··· 629 629 goto err_clock; 630 630 } 631 631 632 - for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") { 633 - id = of_alias_get_id(np, "dmc"); 632 + for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") { 633 + id = of_alias_get_id(dmc, "dmc"); 634 634 if (id < 0 || id >= ARRAY_SIZE(dmc_base)) { 635 - dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np); 636 - of_node_put(np); 635 + dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc); 637 636 result = id; 638 637 goto err_clk_base; 639 638 } 640 639 641 - dmc_base[id] = of_iomap(np, 0); 640 + dmc_base[id] = of_iomap(dmc, 0); 642 641 if (!dmc_base[id]) { 643 642 dev_err(dev, "failed to map dmc%d registers\n", id); 644 - of_node_put(np); 645 643 result = -EFAULT; 646 644 goto err_dmc; 647 645 }
+1 -3
drivers/dma/fsl_raid.c
··· 746 746 static int fsl_re_probe(struct platform_device *ofdev) 747 747 { 748 748 struct fsl_re_drv_private *re_priv; 749 - struct device_node *np; 750 749 struct device_node *child; 751 750 u32 off; 752 751 u8 ridx = 0; ··· 822 823 dev_set_drvdata(dev, re_priv); 823 824 824 825 /* Parse Device tree to find out the total number of JQs present */ 825 - for_each_compatible_node(np, NULL, "fsl,raideng-v1.0-job-queue") { 826 + for_each_compatible_node_scoped(np, NULL, "fsl,raideng-v1.0-job-queue") { 826 827 rc = of_property_read_u32(np, "reg", &off); 827 828 if (rc) { 828 829 dev_err(dev, "Reg property not found in JQ node\n"); 829 - of_node_put(np); 830 830 return -ENODEV; 831 831 } 832 832 /* Find out the Job Rings present under each JQ */
+1 -2
drivers/of/of_reserved_mem.c
··· 127 127 fdt_init_reserved_mem_node(rmem); 128 128 129 129 reserved_mem_count++; 130 - return; 131 130 } 132 131 133 132 static int __init early_init_dt_reserve_memory(phys_addr_t base, ··· 761 762 if (!np) 762 763 return -EINVAL; 763 764 764 - struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx); 765 + struct device_node *target __free(device_node) = of_parse_phandle(np, "memory-region", idx); 765 766 if (!target || !of_device_is_available(target)) 766 767 return -ENODEV; 767 768
+7 -8
drivers/of/platform.c
··· 394 394 const struct of_device_id *matches, 395 395 struct device *parent) 396 396 { 397 - struct device_node *child; 398 397 int rc = 0; 399 398 400 399 root = root ? of_node_get(root) : of_find_node_by_path("/"); ··· 406 407 /* Do a self check of bus type, if there's a match, create children */ 407 408 if (of_match_node(matches, root)) { 408 409 rc = of_platform_bus_create(root, matches, NULL, parent, false); 409 - } else for_each_child_of_node(root, child) { 410 - if (!of_match_node(matches, child)) 411 - continue; 412 - rc = of_platform_bus_create(child, matches, NULL, parent, false); 413 - if (rc) { 414 - of_node_put(child); 415 - break; 410 + } else { 411 + for_each_child_of_node_scoped(root, child) { 412 + if (!of_match_node(matches, child)) 413 + continue; 414 + rc = of_platform_bus_create(child, matches, NULL, parent, false); 415 + if (rc) 416 + break; 416 417 } 417 418 } 418 419
+18 -31
drivers/of/property.c
··· 21 21 22 22 #define pr_fmt(fmt) "OF: " fmt 23 23 24 + #include <linux/ctype.h> 24 25 #include <linux/of.h> 25 26 #include <linux/of_address.h> 26 27 #include <linux/of_device.h> ··· 1295 1294 return parse_prop_cells(np, prop_name, index, name, cells); \ 1296 1295 } 1297 1296 1298 - static int strcmp_suffix(const char *str, const char *suffix) 1299 - { 1300 - unsigned int len, suffix_len; 1301 - 1302 - len = strlen(str); 1303 - suffix_len = strlen(suffix); 1304 - if (len <= suffix_len) 1305 - return -1; 1306 - return strcmp(str + len - suffix_len, suffix); 1307 - } 1308 - 1309 1297 /** 1310 1298 * parse_suffix_prop_cells - Suffix property parsing function for suppliers 1311 1299 * ··· 1321 1331 { 1322 1332 struct of_phandle_args sup_args; 1323 1333 1324 - if (strcmp_suffix(prop_name, suffix)) 1334 + if (!strends(prop_name, suffix)) 1325 1335 return NULL; 1326 1336 1327 1337 if (of_parse_phandle_with_args(np, prop_name, cells_name, index, ··· 1381 1391 DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells") 1382 1392 DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells") 1383 1393 DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL) 1384 - DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL) 1385 - DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL) 1386 - DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL) 1387 - DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL) 1388 - DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL) 1389 - DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL) 1390 - DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) 1391 - DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) 1392 - DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) 1393 1394 DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") 1394 1395 DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") 1395 1396 DEFINE_SIMPLE_PROP(leds, "leds", NULL) ··· 1391 1410 DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells") 1392 1411 DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells") 1393 1412 DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL) 1413 + DEFINE_SIMPLE_PROP(mmc_pwrseq, "mmc-pwrseq", NULL) 1394 1414 DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) 1395 1415 DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") 1416 + 1417 + static struct device_node *parse_pinctrl_n(struct device_node *np, 1418 + const char *prop_name, int index) 1419 + { 1420 + if (!strstarts(prop_name, "pinctrl-")) 1421 + return NULL; 1422 + 1423 + if (!isdigit(prop_name[strlen("pinctrl-")])) 1424 + return NULL; 1425 + 1426 + return of_parse_phandle(np, prop_name, index); 1427 + } 1396 1428 1397 1429 static struct device_node *parse_gpios(struct device_node *np, 1398 1430 const char *prop_name, int index) 1399 1431 { 1400 - if (!strcmp_suffix(prop_name, ",nr-gpios")) 1432 + if (strends(prop_name, ",nr-gpios")) 1401 1433 return NULL; 1402 1434 1403 1435 return parse_suffix_prop_cells(np, prop_name, index, "-gpios", ··· 1530 1536 { .parse_prop = parse_nvmem_cells, }, 1531 1537 { .parse_prop = parse_phys, }, 1532 1538 { .parse_prop = parse_wakeup_parent, }, 1533 - { .parse_prop = parse_pinctrl0, }, 1534 - { .parse_prop = parse_pinctrl1, }, 1535 - { .parse_prop = parse_pinctrl2, }, 1536 - { .parse_prop = parse_pinctrl3, }, 1537 - { .parse_prop = parse_pinctrl4, }, 1538 - { .parse_prop = parse_pinctrl5, }, 1539 - { .parse_prop = parse_pinctrl6, }, 1540 - { .parse_prop = parse_pinctrl7, }, 1541 - { .parse_prop = parse_pinctrl8, }, 1539 + { .parse_prop = parse_pinctrl_n, }, 1542 1540 { 1543 1541 .parse_prop = parse_remote_endpoint, 1544 1542 .get_con_dev = of_graph_get_port_parent, ··· 1543 1557 { .parse_prop = parse_msi_parent, }, 1544 1558 { .parse_prop = parse_pses, }, 1545 1559 { .parse_prop = parse_power_supplies, }, 1560 + { .parse_prop = parse_mmc_pwrseq, }, 1546 1561 { .parse_prop = parse_gpio_compat, }, 1547 1562 { .parse_prop = parse_interrupts, }, 1548 1563 { .parse_prop = parse_interrupt_map, },
+4 -2
drivers/of/unittest.c
··· 804 804 805 805 new = __of_prop_dup(&p1, GFP_KERNEL); 806 806 unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n"); 807 - __of_prop_free(new); 807 + if (new) 808 + __of_prop_free(new); 808 809 809 810 new = __of_prop_dup(&p2, GFP_KERNEL); 810 811 unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n"); 811 - __of_prop_free(new); 812 + if (new) 813 + __of_prop_free(new); 812 814 #endif 813 815 } 814 816
-19
include/dt-bindings/clock/oxsemi,ox810se.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 4 - */ 5 - 6 - #ifndef DT_CLOCK_OXSEMI_OX810SE_H 7 - #define DT_CLOCK_OXSEMI_OX810SE_H 8 - 9 - #define CLK_810_LEON 0 10 - #define CLK_810_DMA_SGDMA 1 11 - #define CLK_810_CIPHER 2 12 - #define CLK_810_SATA 3 13 - #define CLK_810_AUDIO 4 14 - #define CLK_810_USBMPH 5 15 - #define CLK_810_ETHA 6 16 - #define CLK_810_PCIEA 7 17 - #define CLK_810_NAND 8 18 - 19 - #endif /* DT_CLOCK_OXSEMI_OX810SE_H */
-29
include/dt-bindings/clock/oxsemi,ox820.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 4 - */ 5 - 6 - #ifndef DT_CLOCK_OXSEMI_OX820_H 7 - #define DT_CLOCK_OXSEMI_OX820_H 8 - 9 - /* PLLs */ 10 - #define CLK_820_PLLA 0 11 - #define CLK_820_PLLB 1 12 - 13 - /* Gate Clocks */ 14 - #define CLK_820_LEON 2 15 - #define CLK_820_DMA_SGDMA 3 16 - #define CLK_820_CIPHER 4 17 - #define CLK_820_SD 5 18 - #define CLK_820_SATA 6 19 - #define CLK_820_AUDIO 7 20 - #define CLK_820_USBMPH 8 21 - #define CLK_820_ETHA 9 22 - #define CLK_820_PCIEA 10 23 - #define CLK_820_NAND 11 24 - #define CLK_820_PCIEB 12 25 - #define CLK_820_ETHB 13 26 - #define CLK_820_REF600 14 27 - #define CLK_820_USBDEV 15 28 - 29 - #endif /* DT_CLOCK_OXSEMI_OX820_H */
-12
include/dt-bindings/clock/qcom,mss-sc7180.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (c) 2020, The Linux Foundation. All rights reserved. 4 - */ 5 - 6 - #ifndef _DT_BINDINGS_CLK_QCOM_MSS_SC7180_H 7 - #define _DT_BINDINGS_CLK_QCOM_MSS_SC7180_H 8 - 9 - #define MSS_AXI_CRYPTO_CLK 0 10 - #define MSS_AXI_NAV_CLK 1 11 - 12 - #endif
-123
include/dt-bindings/clock/xlnx-versal-clk.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (C) 2019 Xilinx Inc. 4 - * 5 - */ 6 - 7 - #ifndef _DT_BINDINGS_CLK_VERSAL_H 8 - #define _DT_BINDINGS_CLK_VERSAL_H 9 - 10 - #define PMC_PLL 1 11 - #define APU_PLL 2 12 - #define RPU_PLL 3 13 - #define CPM_PLL 4 14 - #define NOC_PLL 5 15 - #define PLL_MAX 6 16 - #define PMC_PRESRC 7 17 - #define PMC_POSTCLK 8 18 - #define PMC_PLL_OUT 9 19 - #define PPLL 10 20 - #define NOC_PRESRC 11 21 - #define NOC_POSTCLK 12 22 - #define NOC_PLL_OUT 13 23 - #define NPLL 14 24 - #define APU_PRESRC 15 25 - #define APU_POSTCLK 16 26 - #define APU_PLL_OUT 17 27 - #define APLL 18 28 - #define RPU_PRESRC 19 29 - #define RPU_POSTCLK 20 30 - #define RPU_PLL_OUT 21 31 - #define RPLL 22 32 - #define CPM_PRESRC 23 33 - #define CPM_POSTCLK 24 34 - #define CPM_PLL_OUT 25 35 - #define CPLL 26 36 - #define PPLL_TO_XPD 27 37 - #define NPLL_TO_XPD 28 38 - #define APLL_TO_XPD 29 39 - #define RPLL_TO_XPD 30 40 - #define EFUSE_REF 31 41 - #define SYSMON_REF 32 42 - #define IRO_SUSPEND_REF 33 43 - #define USB_SUSPEND 34 44 - #define SWITCH_TIMEOUT 35 45 - #define RCLK_PMC 36 46 - #define RCLK_LPD 37 47 - #define WDT 38 48 - #define TTC0 39 49 - #define TTC1 40 50 - #define TTC2 41 51 - #define TTC3 42 52 - #define GEM_TSU 43 53 - #define GEM_TSU_LB 44 54 - #define MUXED_IRO_DIV2 45 55 - #define MUXED_IRO_DIV4 46 56 - #define PSM_REF 47 57 - #define GEM0_RX 48 58 - #define GEM0_TX 49 59 - #define GEM1_RX 50 60 - #define GEM1_TX 51 61 - #define CPM_CORE_REF 52 62 - #define CPM_LSBUS_REF 53 63 - #define CPM_DBG_REF 54 64 - #define CPM_AUX0_REF 55 65 - #define CPM_AUX1_REF 56 66 - #define QSPI_REF 57 67 - #define OSPI_REF 58 68 - #define SDIO0_REF 59 69 - #define SDIO1_REF 60 70 - #define PMC_LSBUS_REF 61 71 - #define I2C_REF 62 72 - #define TEST_PATTERN_REF 63 73 - #define DFT_OSC_REF 64 74 - #define PMC_PL0_REF 65 75 - #define PMC_PL1_REF 66 76 - #define PMC_PL2_REF 67 77 - #define PMC_PL3_REF 68 78 - #define CFU_REF 69 79 - #define SPARE_REF 70 80 - #define NPI_REF 71 81 - #define HSM0_REF 72 82 - #define HSM1_REF 73 83 - #define SD_DLL_REF 74 84 - #define FPD_TOP_SWITCH 75 85 - #define FPD_LSBUS 76 86 - #define ACPU 77 87 - #define DBG_TRACE 78 88 - #define DBG_FPD 79 89 - #define LPD_TOP_SWITCH 80 90 - #define ADMA 81 91 - #define LPD_LSBUS 82 92 - #define CPU_R5 83 93 - #define CPU_R5_CORE 84 94 - #define CPU_R5_OCM 85 95 - #define CPU_R5_OCM2 86 96 - #define IOU_SWITCH 87 97 - #define GEM0_REF 88 98 - #define GEM1_REF 89 99 - #define GEM_TSU_REF 90 100 - #define USB0_BUS_REF 91 101 - #define UART0_REF 92 102 - #define UART1_REF 93 103 - #define SPI0_REF 94 104 - #define SPI1_REF 95 105 - #define CAN0_REF 96 106 - #define CAN1_REF 97 107 - #define I2C0_REF 98 108 - #define I2C1_REF 99 109 - #define DBG_LPD 100 110 - #define TIMESTAMP_REF 101 111 - #define DBG_TSTMP 102 112 - #define CPM_TOPSW_REF 103 113 - #define USB3_DUAL_REF 104 114 - #define OUTCLK_MAX 105 115 - #define REF_CLK 106 116 - #define PL_ALT_REF_CLK 107 117 - #define MUXED_IRO 108 118 - #define PL_EXT 109 119 - #define PL_LB 110 120 - #define MIO_50_OR_51 111 121 - #define MIO_24_OR_25 112 122 - 123 - #endif
-133
include/dt-bindings/clock/xlnx-zynqmp-clk.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Xilinx Zynq MPSoC Firmware layer 4 - * 5 - * Copyright (C) 2014-2018 Xilinx, Inc. 6 - * 7 - */ 8 - 9 - #ifndef _DT_BINDINGS_CLK_ZYNQMP_H 10 - #define _DT_BINDINGS_CLK_ZYNQMP_H 11 - 12 - /* 13 - * These bindings are deprecated, because they do not match the actual 14 - * concept of bindings but rather contain pure firmware values. 15 - * Instead include the header in the DTS source directory. 16 - */ 17 - #warning "These bindings are deprecated. Instead use the header in the DTS source directory." 18 - 19 - #define IOPLL 0 20 - #define RPLL 1 21 - #define APLL 2 22 - #define DPLL 3 23 - #define VPLL 4 24 - #define IOPLL_TO_FPD 5 25 - #define RPLL_TO_FPD 6 26 - #define APLL_TO_LPD 7 27 - #define DPLL_TO_LPD 8 28 - #define VPLL_TO_LPD 9 29 - #define ACPU 10 30 - #define ACPU_HALF 11 31 - #define DBF_FPD 12 32 - #define DBF_LPD 13 33 - #define DBG_TRACE 14 34 - #define DBG_TSTMP 15 35 - #define DP_VIDEO_REF 16 36 - #define DP_AUDIO_REF 17 37 - #define DP_STC_REF 18 38 - #define GDMA_REF 19 39 - #define DPDMA_REF 20 40 - #define DDR_REF 21 41 - #define SATA_REF 22 42 - #define PCIE_REF 23 43 - #define GPU_REF 24 44 - #define GPU_PP0_REF 25 45 - #define GPU_PP1_REF 26 46 - #define TOPSW_MAIN 27 47 - #define TOPSW_LSBUS 28 48 - #define GTGREF0_REF 29 49 - #define LPD_SWITCH 30 50 - #define LPD_LSBUS 31 51 - #define USB0_BUS_REF 32 52 - #define USB1_BUS_REF 33 53 - #define USB3_DUAL_REF 34 54 - #define USB0 35 55 - #define USB1 36 56 - #define CPU_R5 37 57 - #define CPU_R5_CORE 38 58 - #define CSU_SPB 39 59 - #define CSU_PLL 40 60 - #define PCAP 41 61 - #define IOU_SWITCH 42 62 - #define GEM_TSU_REF 43 63 - #define GEM_TSU 44 64 - #define GEM0_TX 45 65 - #define GEM1_TX 46 66 - #define GEM2_TX 47 67 - #define GEM3_TX 48 68 - #define GEM0_RX 49 69 - #define GEM1_RX 50 70 - #define GEM2_RX 51 71 - #define GEM3_RX 52 72 - #define QSPI_REF 53 73 - #define SDIO0_REF 54 74 - #define SDIO1_REF 55 75 - #define UART0_REF 56 76 - #define UART1_REF 57 77 - #define SPI0_REF 58 78 - #define SPI1_REF 59 79 - #define NAND_REF 60 80 - #define I2C0_REF 61 81 - #define I2C1_REF 62 82 - #define CAN0_REF 63 83 - #define CAN1_REF 64 84 - #define CAN0 65 85 - #define CAN1 66 86 - #define DLL_REF 67 87 - #define ADMA_REF 68 88 - #define TIMESTAMP_REF 69 89 - #define AMS_REF 70 90 - #define PL0_REF 71 91 - #define PL1_REF 72 92 - #define PL2_REF 73 93 - #define PL3_REF 74 94 - #define WDT 75 95 - #define IOPLL_INT 76 96 - #define IOPLL_PRE_SRC 77 97 - #define IOPLL_HALF 78 98 - #define IOPLL_INT_MUX 79 99 - #define IOPLL_POST_SRC 80 100 - #define RPLL_INT 81 101 - #define RPLL_PRE_SRC 82 102 - #define RPLL_HALF 83 103 - #define RPLL_INT_MUX 84 104 - #define RPLL_POST_SRC 85 105 - #define APLL_INT 86 106 - #define APLL_PRE_SRC 87 107 - #define APLL_HALF 88 108 - #define APLL_INT_MUX 89 109 - #define APLL_POST_SRC 90 110 - #define DPLL_INT 91 111 - #define DPLL_PRE_SRC 92 112 - #define DPLL_HALF 93 113 - #define DPLL_INT_MUX 94 114 - #define DPLL_POST_SRC 95 115 - #define VPLL_INT 96 116 - #define VPLL_PRE_SRC 97 117 - #define VPLL_HALF 98 118 - #define VPLL_INT_MUX 99 119 - #define VPLL_POST_SRC 100 120 - #define CAN0_MIO 101 121 - #define CAN1_MIO 102 122 - #define ACPU_FULL 103 123 - #define GEM0_REF 104 124 - #define GEM1_REF 105 125 - #define GEM2_REF 106 126 - #define GEM3_REF 107 127 - #define GEM0_REF_UNG 108 128 - #define GEM1_REF_UNG 109 129 - #define GEM2_REF_UNG 110 130 - #define GEM3_REF_UNG 111 131 - #define LPD_WDT 112 132 - 133 - #endif
-44
include/dt-bindings/dma/jz4775-dma.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * This header provides macros for JZ4775 DMA bindings. 4 - * 5 - * Copyright (c) 2020 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> 6 - */ 7 - 8 - #ifndef __DT_BINDINGS_DMA_JZ4775_DMA_H__ 9 - #define __DT_BINDINGS_DMA_JZ4775_DMA_H__ 10 - 11 - /* 12 - * Request type numbers for the JZ4775 DMA controller (written to the DRTn 13 - * register for the channel). 14 - */ 15 - #define JZ4775_DMA_I2S0_TX 0x6 16 - #define JZ4775_DMA_I2S0_RX 0x7 17 - #define JZ4775_DMA_AUTO 0x8 18 - #define JZ4775_DMA_SADC_RX 0x9 19 - #define JZ4775_DMA_UART3_TX 0x0e 20 - #define JZ4775_DMA_UART3_RX 0x0f 21 - #define JZ4775_DMA_UART2_TX 0x10 22 - #define JZ4775_DMA_UART2_RX 0x11 23 - #define JZ4775_DMA_UART1_TX 0x12 24 - #define JZ4775_DMA_UART1_RX 0x13 25 - #define JZ4775_DMA_UART0_TX 0x14 26 - #define JZ4775_DMA_UART0_RX 0x15 27 - #define JZ4775_DMA_SSI0_TX 0x16 28 - #define JZ4775_DMA_SSI0_RX 0x17 29 - #define JZ4775_DMA_MSC0_TX 0x1a 30 - #define JZ4775_DMA_MSC0_RX 0x1b 31 - #define JZ4775_DMA_MSC1_TX 0x1c 32 - #define JZ4775_DMA_MSC1_RX 0x1d 33 - #define JZ4775_DMA_MSC2_TX 0x1e 34 - #define JZ4775_DMA_MSC2_RX 0x1f 35 - #define JZ4775_DMA_PCM0_TX 0x20 36 - #define JZ4775_DMA_PCM0_RX 0x21 37 - #define JZ4775_DMA_SMB0_TX 0x24 38 - #define JZ4775_DMA_SMB0_RX 0x25 39 - #define JZ4775_DMA_SMB1_TX 0x26 40 - #define JZ4775_DMA_SMB1_RX 0x27 41 - #define JZ4775_DMA_SMB2_TX 0x28 42 - #define JZ4775_DMA_SMB2_RX 0x29 43 - 44 - #endif /* __DT_BINDINGS_DMA_JZ4775_DMA_H__ */
-54
include/dt-bindings/dma/x2000-dma.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * This header provides macros for X2000 DMA bindings. 4 - * 5 - * Copyright (c) 2020 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> 6 - */ 7 - 8 - #ifndef __DT_BINDINGS_DMA_X2000_DMA_H__ 9 - #define __DT_BINDINGS_DMA_X2000_DMA_H__ 10 - 11 - /* 12 - * Request type numbers for the X2000 DMA controller (written to the DRTn 13 - * register for the channel). 14 - */ 15 - #define X2000_DMA_AUTO 0x8 16 - #define X2000_DMA_UART5_TX 0xa 17 - #define X2000_DMA_UART5_RX 0xb 18 - #define X2000_DMA_UART4_TX 0xc 19 - #define X2000_DMA_UART4_RX 0xd 20 - #define X2000_DMA_UART3_TX 0xe 21 - #define X2000_DMA_UART3_RX 0xf 22 - #define X2000_DMA_UART2_TX 0x10 23 - #define X2000_DMA_UART2_RX 0x11 24 - #define X2000_DMA_UART1_TX 0x12 25 - #define X2000_DMA_UART1_RX 0x13 26 - #define X2000_DMA_UART0_TX 0x14 27 - #define X2000_DMA_UART0_RX 0x15 28 - #define X2000_DMA_SSI0_TX 0x16 29 - #define X2000_DMA_SSI0_RX 0x17 30 - #define X2000_DMA_SSI1_TX 0x18 31 - #define X2000_DMA_SSI1_RX 0x19 32 - #define X2000_DMA_I2C0_TX 0x24 33 - #define X2000_DMA_I2C0_RX 0x25 34 - #define X2000_DMA_I2C1_TX 0x26 35 - #define X2000_DMA_I2C1_RX 0x27 36 - #define X2000_DMA_I2C2_TX 0x28 37 - #define X2000_DMA_I2C2_RX 0x29 38 - #define X2000_DMA_I2C3_TX 0x2a 39 - #define X2000_DMA_I2C3_RX 0x2b 40 - #define X2000_DMA_I2C4_TX 0x2c 41 - #define X2000_DMA_I2C4_RX 0x2d 42 - #define X2000_DMA_I2C5_TX 0x2e 43 - #define X2000_DMA_I2C5_RX 0x2f 44 - #define X2000_DMA_UART6_TX 0x30 45 - #define X2000_DMA_UART6_RX 0x31 46 - #define X2000_DMA_UART7_TX 0x32 47 - #define X2000_DMA_UART7_RX 0x33 48 - #define X2000_DMA_UART8_TX 0x34 49 - #define X2000_DMA_UART8_RX 0x35 50 - #define X2000_DMA_UART9_TX 0x36 51 - #define X2000_DMA_UART9_RX 0x37 52 - #define X2000_DMA_SADC_RX 0x38 53 - 54 - #endif /* __DT_BINDINGS_DMA_X2000_DMA_H__ */
-222
include/dt-bindings/gce/mt6779-gce.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (c) 2019 MediaTek Inc. 4 - * Author: Dennis-YC Hsieh <dennis-yc.hsieh@mediatek.com> 5 - */ 6 - 7 - #ifndef _DT_BINDINGS_GCE_MT6779_H 8 - #define _DT_BINDINGS_GCE_MT6779_H 9 - 10 - #define CMDQ_NO_TIMEOUT 0xffffffff 11 - 12 - /* GCE HW thread priority */ 13 - #define CMDQ_THR_PRIO_LOWEST 0 14 - #define CMDQ_THR_PRIO_1 1 15 - #define CMDQ_THR_PRIO_2 2 16 - #define CMDQ_THR_PRIO_3 3 17 - #define CMDQ_THR_PRIO_4 4 18 - #define CMDQ_THR_PRIO_5 5 19 - #define CMDQ_THR_PRIO_6 6 20 - #define CMDQ_THR_PRIO_HIGHEST 7 21 - 22 - /* GCE subsys table */ 23 - #define SUBSYS_1300XXXX 0 24 - #define SUBSYS_1400XXXX 1 25 - #define SUBSYS_1401XXXX 2 26 - #define SUBSYS_1402XXXX 3 27 - #define SUBSYS_1502XXXX 4 28 - #define SUBSYS_1880XXXX 5 29 - #define SUBSYS_1881XXXX 6 30 - #define SUBSYS_1882XXXX 7 31 - #define SUBSYS_1883XXXX 8 32 - #define SUBSYS_1884XXXX 9 33 - #define SUBSYS_1000XXXX 10 34 - #define SUBSYS_1001XXXX 11 35 - #define SUBSYS_1002XXXX 12 36 - #define SUBSYS_1003XXXX 13 37 - #define SUBSYS_1004XXXX 14 38 - #define SUBSYS_1005XXXX 15 39 - #define SUBSYS_1020XXXX 16 40 - #define SUBSYS_1028XXXX 17 41 - #define SUBSYS_1700XXXX 18 42 - #define SUBSYS_1701XXXX 19 43 - #define SUBSYS_1702XXXX 20 44 - #define SUBSYS_1703XXXX 21 45 - #define SUBSYS_1800XXXX 22 46 - #define SUBSYS_1801XXXX 23 47 - #define SUBSYS_1802XXXX 24 48 - #define SUBSYS_1804XXXX 25 49 - #define SUBSYS_1805XXXX 26 50 - #define SUBSYS_1808XXXX 27 51 - #define SUBSYS_180aXXXX 28 52 - #define SUBSYS_180bXXXX 29 53 - #define CMDQ_SUBSYS_OFF 32 54 - 55 - /* GCE hardware events */ 56 - #define CMDQ_EVENT_DISP_RDMA0_SOF 0 57 - #define CMDQ_EVENT_DISP_RDMA1_SOF 1 58 - #define CMDQ_EVENT_MDP_RDMA0_SOF 2 59 - #define CMDQ_EVENT_MDP_RDMA1_SOF 3 60 - #define CMDQ_EVENT_MDP_RSZ0_SOF 4 61 - #define CMDQ_EVENT_MDP_RSZ1_SOF 5 62 - #define CMDQ_EVENT_MDP_TDSHP_SOF 6 63 - #define CMDQ_EVENT_MDP_WROT0_SOF 7 64 - #define CMDQ_EVENT_MDP_WROT1_SOF 8 65 - #define CMDQ_EVENT_DISP_OVL0_SOF 9 66 - #define CMDQ_EVENT_DISP_2L_OVL0_SOF 10 67 - #define CMDQ_EVENT_DISP_2L_OVL1_SOF 11 68 - #define CMDQ_EVENT_DISP_WDMA0_SOF 12 69 - #define CMDQ_EVENT_DISP_COLOR0_SOF 13 70 - #define CMDQ_EVENT_DISP_CCORR0_SOF 14 71 - #define CMDQ_EVENT_DISP_AAL0_SOF 15 72 - #define CMDQ_EVENT_DISP_GAMMA0_SOF 16 73 - #define CMDQ_EVENT_DISP_DITHER0_SOF 17 74 - #define CMDQ_EVENT_DISP_PWM0_SOF 18 75 - #define CMDQ_EVENT_DISP_DSI0_SOF 19 76 - #define CMDQ_EVENT_DISP_DPI0_SOF 20 77 - #define CMDQ_EVENT_DISP_POSTMASK0_SOF 21 78 - #define CMDQ_EVENT_DISP_RSZ0_SOF 22 79 - #define CMDQ_EVENT_MDP_AAL_SOF 23 80 - #define CMDQ_EVENT_MDP_CCORR_SOF 24 81 - #define CMDQ_EVENT_DISP_DBI0_SOF 25 82 - #define CMDQ_EVENT_ISP_RELAY_SOF 26 83 - #define CMDQ_EVENT_IPU_RELAY_SOF 27 84 - #define CMDQ_EVENT_DISP_RDMA0_EOF 28 85 - #define CMDQ_EVENT_DISP_RDMA1_EOF 29 86 - #define CMDQ_EVENT_MDP_RDMA0_EOF 30 87 - #define CMDQ_EVENT_MDP_RDMA1_EOF 31 88 - #define CMDQ_EVENT_MDP_RSZ0_EOF 32 89 - #define CMDQ_EVENT_MDP_RSZ1_EOF 33 90 - #define CMDQ_EVENT_MDP_TDSHP_EOF 34 91 - #define CMDQ_EVENT_MDP_WROT0_W_EOF 35 92 - #define CMDQ_EVENT_MDP_WROT1_W_EOF 36 93 - #define CMDQ_EVENT_DISP_OVL0_EOF 37 94 - #define CMDQ_EVENT_DISP_2L_OVL0_EOF 38 95 - #define CMDQ_EVENT_DISP_2L_OVL1_EOF 39 96 - #define CMDQ_EVENT_DISP_WDMA0_EOF 40 97 - #define CMDQ_EVENT_DISP_COLOR0_EOF 41 98 - #define CMDQ_EVENT_DISP_CCORR0_EOF 42 99 - #define CMDQ_EVENT_DISP_AAL0_EOF 43 100 - #define CMDQ_EVENT_DISP_GAMMA0_EOF 44 101 - #define CMDQ_EVENT_DISP_DITHER0_EOF 45 102 - #define CMDQ_EVENT_DISP_DSI0_EOF 46 103 - #define CMDQ_EVENT_DISP_DPI0_EOF 47 104 - #define CMDQ_EVENT_DISP_RSZ0_EOF 49 105 - #define CMDQ_EVENT_MDP_AAL_FRAME_DONE 50 106 - #define CMDQ_EVENT_MDP_CCORR_FRAME_DONE 51 107 - #define CMDQ_EVENT_DISP_POSTMASK0_FRAME_DONE 52 108 - #define CMDQ_EVENT_MUTEX0_STREAM_EOF 130 109 - #define CMDQ_EVENT_MUTEX1_STREAM_EOF 131 110 - #define CMDQ_EVENT_MUTEX2_STREAM_EOF 132 111 - #define CMDQ_EVENT_MUTEX3_STREAM_EOF 133 112 - #define CMDQ_EVENT_MUTEX4_STREAM_EOF 134 113 - #define CMDQ_EVENT_MUTEX5_STREAM_EOF 135 114 - #define CMDQ_EVENT_MUTEX6_STREAM_EOF 136 115 - #define CMDQ_EVENT_MUTEX7_STREAM_EOF 137 116 - #define CMDQ_EVENT_MUTEX8_STREAM_EOF 138 117 - #define CMDQ_EVENT_MUTEX9_STREAM_EOF 139 118 - #define CMDQ_EVENT_MUTEX10_STREAM_EOF 140 119 - #define CMDQ_EVENT_MUTEX11_STREAM_EOF 141 120 - #define CMDQ_EVENT_DISP_RDMA0_UNDERRUN 142 121 - #define CMDQ_EVENT_DISP_RDMA1_UNDERRUN 143 122 - #define CMDQ_EVENT_DISP_RDMA2_UNDERRUN 144 123 - #define CMDQ_EVENT_DISP_RDMA3_UNDERRUN 145 124 - #define CMDQ_EVENT_DSI0_TE 146 125 - #define CMDQ_EVENT_DSI0_IRQ_EVENT 147 126 - #define CMDQ_EVENT_DSI0_DONE_EVENT 148 127 - #define CMDQ_EVENT_DISP_POSTMASK0_RST_DONE 150 128 - #define CMDQ_EVENT_DISP_WDMA0_RST_DONE 151 129 - #define CMDQ_EVENT_MDP_WROT0_RST_DONE 153 130 - #define CMDQ_EVENT_MDP_RDMA0_RST_DONE 154 131 - #define CMDQ_EVENT_DISP_OVL0_RST_DONE 155 132 - #define CMDQ_EVENT_DISP_OVL0_2L_RST_DONE 156 133 - #define CMDQ_EVENT_DISP_OVL1_2L_RST_DONE 157 134 - #define CMDQ_EVENT_DIP_CQ_THREAD0_EOF 257 135 - #define CMDQ_EVENT_DIP_CQ_THREAD1_EOF 258 136 - #define CMDQ_EVENT_DIP_CQ_THREAD2_EOF 259 137 - #define CMDQ_EVENT_DIP_CQ_THREAD3_EOF 260 138 - #define CMDQ_EVENT_DIP_CQ_THREAD4_EOF 261 139 - #define CMDQ_EVENT_DIP_CQ_THREAD5_EOF 262 140 - #define CMDQ_EVENT_DIP_CQ_THREAD6_EOF 263 141 - #define CMDQ_EVENT_DIP_CQ_THREAD7_EOF 264 142 - #define CMDQ_EVENT_DIP_CQ_THREAD8_EOF 265 143 - #define CMDQ_EVENT_DIP_CQ_THREAD9_EOF 266 144 - #define CMDQ_EVENT_DIP_CQ_THREAD10_EOF 267 145 - #define CMDQ_EVENT_DIP_CQ_THREAD11_EOF 268 146 - #define CMDQ_EVENT_DIP_CQ_THREAD12_EOF 269 147 - #define CMDQ_EVENT_DIP_CQ_THREAD13_EOF 270 148 - #define CMDQ_EVENT_DIP_CQ_THREAD14_EOF 271 149 - #define CMDQ_EVENT_DIP_CQ_THREAD15_EOF 272 150 - #define CMDQ_EVENT_DIP_CQ_THREAD16_EOF 273 151 - #define CMDQ_EVENT_DIP_CQ_THREAD17_EOF 274 152 - #define CMDQ_EVENT_DIP_CQ_THREAD18_EOF 275 153 - #define CMDQ_EVENT_DIP_DMA_ERR_EVENT 276 154 - #define CMDQ_EVENT_AMD_FRAME_DONE 277 155 - #define CMDQ_EVENT_MFB_DONE 278 156 - #define CMDQ_EVENT_WPE_A_EOF 279 157 - #define CMDQ_EVENT_VENC_EOF 289 158 - #define CMDQ_EVENT_VENC_CMDQ_PAUSE_DONE 290 159 - #define CMDQ_EVENT_JPEG_ENC_EOF 291 160 - #define CMDQ_EVENT_VENC_MB_DONE 292 161 - #define CMDQ_EVENT_VENC_128BYTE_CNT_DONE 293 162 - #define CMDQ_EVENT_ISP_FRAME_DONE_A 321 163 - #define CMDQ_EVENT_ISP_FRAME_DONE_B 322 164 - #define CMDQ_EVENT_ISP_FRAME_DONE_C 323 165 - #define CMDQ_EVENT_ISP_CAMSV_0_PASS1_DONE 324 166 - #define CMDQ_EVENT_ISP_CAMSV_0_2_PASS1_DONE 325 167 - #define CMDQ_EVENT_ISP_CAMSV_1_PASS1_DONE 326 168 - #define CMDQ_EVENT_ISP_CAMSV_2_PASS1_DONE 327 169 - #define CMDQ_EVENT_ISP_CAMSV_3_PASS1_DONE 328 170 - #define CMDQ_EVENT_ISP_TSF_DONE 329 171 - #define CMDQ_EVENT_SENINF_0_FIFO_FULL 330 172 - #define CMDQ_EVENT_SENINF_1_FIFO_FULL 331 173 - #define CMDQ_EVENT_SENINF_2_FIFO_FULL 332 174 - #define CMDQ_EVENT_SENINF_3_FIFO_FULL 333 175 - #define CMDQ_EVENT_SENINF_4_FIFO_FULL 334 176 - #define CMDQ_EVENT_SENINF_5_FIFO_FULL 335 177 - #define CMDQ_EVENT_SENINF_6_FIFO_FULL 336 178 - #define CMDQ_EVENT_SENINF_7_FIFO_FULL 337 179 - #define CMDQ_EVENT_TG_OVRUN_A_INT_DLY 338 180 - #define CMDQ_EVENT_TG_OVRUN_B_INT_DLY 339 181 - #define CMDQ_EVENT_TG_OVRUN_C_INT 340 182 - #define CMDQ_EVENT_TG_GRABERR_A_INT_DLY 341 183 - #define CMDQ_EVENT_TG_GRABERR_B_INT_DLY 342 184 - #define CMDQ_EVENT_TG_GRABERR_C_INT 343 185 - #define CMDQ_EVENT_CQ_VR_SNAP_A_INT_DLY 344 186 - #define CMDQ_EVENT_CQ_VR_SNAP_B_INT_DLY 345 187 - #define CMDQ_EVENT_CQ_VR_SNAP_C_INT 346 188 - #define CMDQ_EVENT_DMA_R1_ERROR_A_INT_DLY 347 189 - #define CMDQ_EVENT_DMA_R1_ERROR_B_INT_DLY 348 190 - #define CMDQ_EVENT_DMA_R1_ERROR_C_INT 349 191 - #define CMDQ_EVENT_APU_GCE_CORE0_EVENT_0 353 192 - #define CMDQ_EVENT_APU_GCE_CORE0_EVENT_1 354 193 - #define CMDQ_EVENT_APU_GCE_CORE0_EVENT_2 355 194 - #define CMDQ_EVENT_APU_GCE_CORE0_EVENT_3 356 195 - #define CMDQ_EVENT_APU_GCE_CORE1_EVENT_0 385 196 - #define CMDQ_EVENT_APU_GCE_CORE1_EVENT_1 386 197 - #define CMDQ_EVENT_APU_GCE_CORE1_EVENT_2 387 198 - #define CMDQ_EVENT_APU_GCE_CORE1_EVENT_3 388 199 - #define CMDQ_EVENT_VDEC_EVENT_0 416 200 - #define CMDQ_EVENT_VDEC_EVENT_1 417 201 - #define CMDQ_EVENT_VDEC_EVENT_2 418 202 - #define CMDQ_EVENT_VDEC_EVENT_3 419 203 - #define CMDQ_EVENT_VDEC_EVENT_4 420 204 - #define CMDQ_EVENT_VDEC_EVENT_5 421 205 - #define CMDQ_EVENT_VDEC_EVENT_6 422 206 - #define CMDQ_EVENT_VDEC_EVENT_7 423 207 - #define CMDQ_EVENT_VDEC_EVENT_8 424 208 - #define CMDQ_EVENT_VDEC_EVENT_9 425 209 - #define CMDQ_EVENT_VDEC_EVENT_10 426 210 - #define CMDQ_EVENT_VDEC_EVENT_11 427 211 - #define CMDQ_EVENT_VDEC_EVENT_12 428 212 - #define CMDQ_EVENT_VDEC_EVENT_13 429 213 - #define CMDQ_EVENT_VDEC_EVENT_14 430 214 - #define CMDQ_EVENT_VDEC_EVENT_15 431 215 - #define CMDQ_EVENT_FDVT_DONE 449 216 - #define CMDQ_EVENT_FE_DONE 450 217 - #define CMDQ_EVENT_RSC_EOF 451 218 - #define CMDQ_EVENT_DVS_DONE_ASYNC_SHOT 452 219 - #define CMDQ_EVENT_DVP_DONE_ASYNC_SHOT 453 220 - #define CMDQ_EVENT_DSI0_TE_INFRA 898 221 - 222 - #endif
-206
include/dt-bindings/memory/mt6779-larb-port.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (c) 2019 MediaTek Inc. 4 - * Author: Chao Hao <chao.hao@mediatek.com> 5 - */ 6 - 7 - #ifndef _DT_BINDINGS_MEMORY_MT6779_LARB_PORT_H_ 8 - #define _DT_BINDINGS_MEMORY_MT6779_LARB_PORT_H_ 9 - 10 - #include <dt-bindings/memory/mtk-memory-port.h> 11 - 12 - #define M4U_LARB0_ID 0 13 - #define M4U_LARB1_ID 1 14 - #define M4U_LARB2_ID 2 15 - #define M4U_LARB3_ID 3 16 - #define M4U_LARB4_ID 4 17 - #define M4U_LARB5_ID 5 18 - #define M4U_LARB6_ID 6 19 - #define M4U_LARB7_ID 7 20 - #define M4U_LARB8_ID 8 21 - #define M4U_LARB9_ID 9 22 - #define M4U_LARB10_ID 10 23 - #define M4U_LARB11_ID 11 24 - 25 - /* larb0 */ 26 - #define M4U_PORT_DISP_POSTMASK0 MTK_M4U_ID(M4U_LARB0_ID, 0) 27 - #define M4U_PORT_DISP_OVL0_HDR MTK_M4U_ID(M4U_LARB0_ID, 1) 28 - #define M4U_PORT_DISP_OVL1_HDR MTK_M4U_ID(M4U_LARB0_ID, 2) 29 - #define M4U_PORT_DISP_OVL0 MTK_M4U_ID(M4U_LARB0_ID, 3) 30 - #define M4U_PORT_DISP_OVL1 MTK_M4U_ID(M4U_LARB0_ID, 4) 31 - #define M4U_PORT_DISP_PVRIC0 MTK_M4U_ID(M4U_LARB0_ID, 5) 32 - #define M4U_PORT_DISP_RDMA0 MTK_M4U_ID(M4U_LARB0_ID, 6) 33 - #define M4U_PORT_DISP_WDMA0 MTK_M4U_ID(M4U_LARB0_ID, 7) 34 - #define M4U_PORT_DISP_FAKE0 MTK_M4U_ID(M4U_LARB0_ID, 8) 35 - 36 - /* larb1 */ 37 - #define M4U_PORT_DISP_OVL0_2L_HDR MTK_M4U_ID(M4U_LARB1_ID, 0) 38 - #define M4U_PORT_DISP_OVL1_2L_HDR MTK_M4U_ID(M4U_LARB1_ID, 1) 39 - #define M4U_PORT_DISP_OVL0_2L MTK_M4U_ID(M4U_LARB1_ID, 2) 40 - #define M4U_PORT_DISP_OVL1_2L MTK_M4U_ID(M4U_LARB1_ID, 3) 41 - #define M4U_PORT_DISP_RDMA1 MTK_M4U_ID(M4U_LARB1_ID, 4) 42 - #define M4U_PORT_MDP_PVRIC0 MTK_M4U_ID(M4U_LARB1_ID, 5) 43 - #define M4U_PORT_MDP_PVRIC1 MTK_M4U_ID(M4U_LARB1_ID, 6) 44 - #define M4U_PORT_MDP_RDMA0 MTK_M4U_ID(M4U_LARB1_ID, 7) 45 - #define M4U_PORT_MDP_RDMA1 MTK_M4U_ID(M4U_LARB1_ID, 8) 46 - #define M4U_PORT_MDP_WROT0_R MTK_M4U_ID(M4U_LARB1_ID, 9) 47 - #define M4U_PORT_MDP_WROT0_W MTK_M4U_ID(M4U_LARB1_ID, 10) 48 - #define M4U_PORT_MDP_WROT1_R MTK_M4U_ID(M4U_LARB1_ID, 11) 49 - #define M4U_PORT_MDP_WROT1_W MTK_M4U_ID(M4U_LARB1_ID, 12) 50 - #define M4U_PORT_DISP_FAKE1 MTK_M4U_ID(M4U_LARB1_ID, 13) 51 - 52 - /* larb2-VDEC */ 53 - #define M4U_PORT_HW_VDEC_MC_EXT MTK_M4U_ID(M4U_LARB2_ID, 0) 54 - #define M4U_PORT_HW_VDEC_UFO_EXT MTK_M4U_ID(M4U_LARB2_ID, 1) 55 - #define M4U_PORT_HW_VDEC_PP_EXT MTK_M4U_ID(M4U_LARB2_ID, 2) 56 - #define M4U_PORT_HW_VDEC_PRED_RD_EXT MTK_M4U_ID(M4U_LARB2_ID, 3) 57 - #define M4U_PORT_HW_VDEC_PRED_WR_EXT MTK_M4U_ID(M4U_LARB2_ID, 4) 58 - #define M4U_PORT_HW_VDEC_PPWRAP_EXT MTK_M4U_ID(M4U_LARB2_ID, 5) 59 - #define M4U_PORT_HW_VDEC_TILE_EXT MTK_M4U_ID(M4U_LARB2_ID, 6) 60 - #define M4U_PORT_HW_VDEC_VLD_EXT MTK_M4U_ID(M4U_LARB2_ID, 7) 61 - #define M4U_PORT_HW_VDEC_VLD2_EXT MTK_M4U_ID(M4U_LARB2_ID, 8) 62 - #define M4U_PORT_HW_VDEC_AVC_MV_EXT MTK_M4U_ID(M4U_LARB2_ID, 9) 63 - #define M4U_PORT_HW_VDEC_UFO_ENC_EXT MTK_M4U_ID(M4U_LARB2_ID, 10) 64 - #define M4U_PORT_HW_VDEC_RG_CTRL_DMA_EXT MTK_M4U_ID(M4U_LARB2_ID, 11) 65 - 66 - /* larb3-VENC */ 67 - #define M4U_PORT_VENC_RCPU MTK_M4U_ID(M4U_LARB3_ID, 0) 68 - #define M4U_PORT_VENC_REC MTK_M4U_ID(M4U_LARB3_ID, 1) 69 - #define M4U_PORT_VENC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 2) 70 - #define M4U_PORT_VENC_SV_COMV MTK_M4U_ID(M4U_LARB3_ID, 3) 71 - #define M4U_PORT_VENC_RD_COMV MTK_M4U_ID(M4U_LARB3_ID, 4) 72 - #define M4U_PORT_VENC_NBM_RDMA MTK_M4U_ID(M4U_LARB3_ID, 5) 73 - #define M4U_PORT_VENC_NBM_RDMA_LITE MTK_M4U_ID(M4U_LARB3_ID, 6) 74 - #define M4U_PORT_JPGENC_Y_RDMA MTK_M4U_ID(M4U_LARB3_ID, 7) 75 - #define M4U_PORT_JPGENC_C_RDMA MTK_M4U_ID(M4U_LARB3_ID, 8) 76 - #define M4U_PORT_JPGENC_Q_TABLE MTK_M4U_ID(M4U_LARB3_ID, 9) 77 - #define M4U_PORT_JPGENC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 10) 78 - #define M4U_PORT_JPGDEC_WDMA MTK_M4U_ID(M4U_LARB3_ID, 11) 79 - #define M4U_PORT_JPGDEC_BSDMA MTK_M4U_ID(M4U_LARB3_ID, 12) 80 - #define M4U_PORT_VENC_NBM_WDMA MTK_M4U_ID(M4U_LARB3_ID, 13) 81 - #define M4U_PORT_VENC_NBM_WDMA_LITE MTK_M4U_ID(M4U_LARB3_ID, 14) 82 - #define M4U_PORT_VENC_CUR_LUMA MTK_M4U_ID(M4U_LARB3_ID, 15) 83 - #define M4U_PORT_VENC_CUR_CHROMA MTK_M4U_ID(M4U_LARB3_ID, 16) 84 - #define M4U_PORT_VENC_REF_LUMA MTK_M4U_ID(M4U_LARB3_ID, 17) 85 - #define M4U_PORT_VENC_REF_CHROMA MTK_M4U_ID(M4U_LARB3_ID, 18) 86 - 87 - /* larb4-dummy */ 88 - 89 - /* larb5-IMG */ 90 - #define M4U_PORT_IMGI_D1 MTK_M4U_ID(M4U_LARB5_ID, 0) 91 - #define M4U_PORT_IMGBI_D1 MTK_M4U_ID(M4U_LARB5_ID, 1) 92 - #define M4U_PORT_DMGI_D1 MTK_M4U_ID(M4U_LARB5_ID, 2) 93 - #define M4U_PORT_DEPI_D1 MTK_M4U_ID(M4U_LARB5_ID, 3) 94 - #define M4U_PORT_LCEI_D1 MTK_M4U_ID(M4U_LARB5_ID, 4) 95 - #define M4U_PORT_SMTI_D1 MTK_M4U_ID(M4U_LARB5_ID, 5) 96 - #define M4U_PORT_SMTO_D2 MTK_M4U_ID(M4U_LARB5_ID, 6) 97 - #define M4U_PORT_SMTO_D1 MTK_M4U_ID(M4U_LARB5_ID, 7) 98 - #define M4U_PORT_CRZO_D1 MTK_M4U_ID(M4U_LARB5_ID, 8) 99 - #define M4U_PORT_IMG3O_D1 MTK_M4U_ID(M4U_LARB5_ID, 9) 100 - #define M4U_PORT_VIPI_D1 MTK_M4U_ID(M4U_LARB5_ID, 10) 101 - #define M4U_PORT_WPE_RDMA1 MTK_M4U_ID(M4U_LARB5_ID, 11) 102 - #define M4U_PORT_WPE_RDMA0 MTK_M4U_ID(M4U_LARB5_ID, 12) 103 - #define M4U_PORT_WPE_WDMA MTK_M4U_ID(M4U_LARB5_ID, 13) 104 - #define M4U_PORT_TIMGO_D1 MTK_M4U_ID(M4U_LARB5_ID, 14) 105 - #define M4U_PORT_MFB_RDMA0 MTK_M4U_ID(M4U_LARB5_ID, 15) 106 - #define M4U_PORT_MFB_RDMA1 MTK_M4U_ID(M4U_LARB5_ID, 16) 107 - #define M4U_PORT_MFB_RDMA2 MTK_M4U_ID(M4U_LARB5_ID, 17) 108 - #define M4U_PORT_MFB_RDMA3 MTK_M4U_ID(M4U_LARB5_ID, 18) 109 - #define M4U_PORT_MFB_WDMA MTK_M4U_ID(M4U_LARB5_ID, 19) 110 - #define M4U_PORT_RESERVE1 MTK_M4U_ID(M4U_LARB5_ID, 20) 111 - #define M4U_PORT_RESERVE2 MTK_M4U_ID(M4U_LARB5_ID, 21) 112 - #define M4U_PORT_RESERVE3 MTK_M4U_ID(M4U_LARB5_ID, 22) 113 - #define M4U_PORT_RESERVE4 MTK_M4U_ID(M4U_LARB5_ID, 23) 114 - #define M4U_PORT_RESERVE5 MTK_M4U_ID(M4U_LARB5_ID, 24) 115 - #define M4U_PORT_RESERVE6 MTK_M4U_ID(M4U_LARB5_ID, 25) 116 - 117 - /* larb6-IMG-VPU */ 118 - #define M4U_PORT_IMG_IPUO MTK_M4U_ID(M4U_LARB6_ID, 0) 119 - #define M4U_PORT_IMG_IPU3O MTK_M4U_ID(M4U_LARB6_ID, 1) 120 - #define M4U_PORT_IMG_IPUI MTK_M4U_ID(M4U_LARB6_ID, 2) 121 - 122 - /* larb7-DVS */ 123 - #define M4U_PORT_DVS_RDMA MTK_M4U_ID(M4U_LARB7_ID, 0) 124 - #define M4U_PORT_DVS_WDMA MTK_M4U_ID(M4U_LARB7_ID, 1) 125 - #define M4U_PORT_DVP_RDMA MTK_M4U_ID(M4U_LARB7_ID, 2) 126 - #define M4U_PORT_DVP_WDMA MTK_M4U_ID(M4U_LARB7_ID, 3) 127 - 128 - /* larb8-IPESYS */ 129 - #define M4U_PORT_FDVT_RDA MTK_M4U_ID(M4U_LARB8_ID, 0) 130 - #define M4U_PORT_FDVT_RDB MTK_M4U_ID(M4U_LARB8_ID, 1) 131 - #define M4U_PORT_FDVT_WRA MTK_M4U_ID(M4U_LARB8_ID, 2) 132 - #define M4U_PORT_FDVT_WRB MTK_M4U_ID(M4U_LARB8_ID, 3) 133 - #define M4U_PORT_FE_RD0 MTK_M4U_ID(M4U_LARB8_ID, 4) 134 - #define M4U_PORT_FE_RD1 MTK_M4U_ID(M4U_LARB8_ID, 5) 135 - #define M4U_PORT_FE_WR0 MTK_M4U_ID(M4U_LARB8_ID, 6) 136 - #define M4U_PORT_FE_WR1 MTK_M4U_ID(M4U_LARB8_ID, 7) 137 - #define M4U_PORT_RSC_RDMA0 MTK_M4U_ID(M4U_LARB8_ID, 8) 138 - #define M4U_PORT_RSC_WDMA MTK_M4U_ID(M4U_LARB8_ID, 9) 139 - 140 - /* larb9-CAM */ 141 - #define M4U_PORT_CAM_IMGO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 0) 142 - #define M4U_PORT_CAM_RRZO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 1) 143 - #define M4U_PORT_CAM_LSCI_R1_C MTK_M4U_ID(M4U_LARB9_ID, 2) 144 - #define M4U_PORT_CAM_BPCI_R1_C MTK_M4U_ID(M4U_LARB9_ID, 3) 145 - #define M4U_PORT_CAM_YUVO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 4) 146 - #define M4U_PORT_CAM_UFDI_R2_C MTK_M4U_ID(M4U_LARB9_ID, 5) 147 - #define M4U_PORT_CAM_RAWI_R2_C MTK_M4U_ID(M4U_LARB9_ID, 6) 148 - #define M4U_PORT_CAM_RAWI_R5_C MTK_M4U_ID(M4U_LARB9_ID, 7) 149 - #define M4U_PORT_CAM_CAMSV_1 MTK_M4U_ID(M4U_LARB9_ID, 8) 150 - #define M4U_PORT_CAM_CAMSV_2 MTK_M4U_ID(M4U_LARB9_ID, 9) 151 - #define M4U_PORT_CAM_CAMSV_3 MTK_M4U_ID(M4U_LARB9_ID, 10) 152 - #define M4U_PORT_CAM_CAMSV_4 MTK_M4U_ID(M4U_LARB9_ID, 11) 153 - #define M4U_PORT_CAM_CAMSV_5 MTK_M4U_ID(M4U_LARB9_ID, 12) 154 - #define M4U_PORT_CAM_CAMSV_6 MTK_M4U_ID(M4U_LARB9_ID, 13) 155 - #define M4U_PORT_CAM_AAO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 14) 156 - #define M4U_PORT_CAM_AFO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 15) 157 - #define M4U_PORT_CAM_FLKO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 16) 158 - #define M4U_PORT_CAM_LCESO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 17) 159 - #define M4U_PORT_CAM_CRZO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 18) 160 - #define M4U_PORT_CAM_LTMSO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 19) 161 - #define M4U_PORT_CAM_RSSO_R1_C MTK_M4U_ID(M4U_LARB9_ID, 20) 162 - #define M4U_PORT_CAM_CCUI MTK_M4U_ID(M4U_LARB9_ID, 21) 163 - #define M4U_PORT_CAM_CCUO MTK_M4U_ID(M4U_LARB9_ID, 22) 164 - #define M4U_PORT_CAM_FAKE MTK_M4U_ID(M4U_LARB9_ID, 23) 165 - 166 - /* larb10-CAM_A */ 167 - #define M4U_PORT_CAM_IMGO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 0) 168 - #define M4U_PORT_CAM_RRZO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 1) 169 - #define M4U_PORT_CAM_LSCI_R1_A MTK_M4U_ID(M4U_LARB10_ID, 2) 170 - #define M4U_PORT_CAM_BPCI_R1_A MTK_M4U_ID(M4U_LARB10_ID, 3) 171 - #define M4U_PORT_CAM_YUVO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 4) 172 - #define M4U_PORT_CAM_UFDI_R2_A MTK_M4U_ID(M4U_LARB10_ID, 5) 173 - #define M4U_PORT_CAM_RAWI_R2_A MTK_M4U_ID(M4U_LARB10_ID, 6) 174 - #define M4U_PORT_CAM_RAWI_R5_A MTK_M4U_ID(M4U_LARB10_ID, 7) 175 - #define M4U_PORT_CAM_IMGO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 8) 176 - #define M4U_PORT_CAM_RRZO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 9) 177 - #define M4U_PORT_CAM_LSCI_R1_B MTK_M4U_ID(M4U_LARB10_ID, 10) 178 - #define M4U_PORT_CAM_BPCI_R1_B MTK_M4U_ID(M4U_LARB10_ID, 11) 179 - #define M4U_PORT_CAM_YUVO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 12) 180 - #define M4U_PORT_CAM_UFDI_R2_B MTK_M4U_ID(M4U_LARB10_ID, 13) 181 - #define M4U_PORT_CAM_RAWI_R2_B MTK_M4U_ID(M4U_LARB10_ID, 14) 182 - #define M4U_PORT_CAM_RAWI_R5_B MTK_M4U_ID(M4U_LARB10_ID, 15) 183 - #define M4U_PORT_CAM_CAMSV_0 MTK_M4U_ID(M4U_LARB10_ID, 16) 184 - #define M4U_PORT_CAM_AAO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 17) 185 - #define M4U_PORT_CAM_AFO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 18) 186 - #define M4U_PORT_CAM_FLKO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 19) 187 - #define M4U_PORT_CAM_LCESO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 20) 188 - #define M4U_PORT_CAM_CRZO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 21) 189 - #define M4U_PORT_CAM_AAO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 22) 190 - #define M4U_PORT_CAM_AFO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 23) 191 - #define M4U_PORT_CAM_FLKO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 24) 192 - #define M4U_PORT_CAM_LCESO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 25) 193 - #define M4U_PORT_CAM_CRZO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 26) 194 - #define M4U_PORT_CAM_LTMSO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 27) 195 - #define M4U_PORT_CAM_RSSO_R1_A MTK_M4U_ID(M4U_LARB10_ID, 28) 196 - #define M4U_PORT_CAM_LTMSO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 29) 197 - #define M4U_PORT_CAM_RSSO_R1_B MTK_M4U_ID(M4U_LARB10_ID, 30) 198 - 199 - /* larb11-CAM-VPU */ 200 - #define M4U_PORT_CAM_IPUO MTK_M4U_ID(M4U_LARB11_ID, 0) 201 - #define M4U_PORT_CAM_IPU2O MTK_M4U_ID(M4U_LARB11_ID, 1) 202 - #define M4U_PORT_CAM_IPU3O MTK_M4U_ID(M4U_LARB11_ID, 2) 203 - #define M4U_PORT_CAM_IPUI MTK_M4U_ID(M4U_LARB11_ID, 3) 204 - #define M4U_PORT_CAM_IPU2I MTK_M4U_ID(M4U_LARB11_ID, 4) 205 - 206 - #endif
-190
include/dt-bindings/mux/ti-serdes.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * This header provides constants for SERDES MUX for TI SoCs 4 - */ 5 - 6 - #ifndef _DT_BINDINGS_MUX_TI_SERDES 7 - #define _DT_BINDINGS_MUX_TI_SERDES 8 - 9 - /* 10 - * These bindings are deprecated, because they do not match the actual 11 - * concept of bindings but rather contain pure constants values used only 12 - * in DTS board files. 13 - * Instead include the header in the DTS source directory. 14 - */ 15 - #warning "These bindings are deprecated. Instead, use the header in the DTS source directory." 16 - 17 - /* J721E */ 18 - 19 - #define J721E_SERDES0_LANE0_QSGMII_LANE1 0x0 20 - #define J721E_SERDES0_LANE0_PCIE0_LANE0 0x1 21 - #define J721E_SERDES0_LANE0_USB3_0_SWAP 0x2 22 - #define J721E_SERDES0_LANE0_IP4_UNUSED 0x3 23 - 24 - #define J721E_SERDES0_LANE1_QSGMII_LANE2 0x0 25 - #define J721E_SERDES0_LANE1_PCIE0_LANE1 0x1 26 - #define J721E_SERDES0_LANE1_USB3_0 0x2 27 - #define J721E_SERDES0_LANE1_IP4_UNUSED 0x3 28 - 29 - #define J721E_SERDES1_LANE0_QSGMII_LANE3 0x0 30 - #define J721E_SERDES1_LANE0_PCIE1_LANE0 0x1 31 - #define J721E_SERDES1_LANE0_USB3_1_SWAP 0x2 32 - #define J721E_SERDES1_LANE0_SGMII_LANE0 0x3 33 - 34 - #define J721E_SERDES1_LANE1_QSGMII_LANE4 0x0 35 - #define J721E_SERDES1_LANE1_PCIE1_LANE1 0x1 36 - #define J721E_SERDES1_LANE1_USB3_1 0x2 37 - #define J721E_SERDES1_LANE1_SGMII_LANE1 0x3 38 - 39 - #define J721E_SERDES2_LANE0_IP1_UNUSED 0x0 40 - #define J721E_SERDES2_LANE0_PCIE2_LANE0 0x1 41 - #define J721E_SERDES2_LANE0_USB3_1_SWAP 0x2 42 - #define J721E_SERDES2_LANE0_SGMII_LANE0 0x3 43 - 44 - #define J721E_SERDES2_LANE1_IP1_UNUSED 0x0 45 - #define J721E_SERDES2_LANE1_PCIE2_LANE1 0x1 46 - #define J721E_SERDES2_LANE1_USB3_1 0x2 47 - #define J721E_SERDES2_LANE1_SGMII_LANE1 0x3 48 - 49 - #define J721E_SERDES3_LANE0_IP1_UNUSED 0x0 50 - #define J721E_SERDES3_LANE0_PCIE3_LANE0 0x1 51 - #define J721E_SERDES3_LANE0_USB3_0_SWAP 0x2 52 - #define J721E_SERDES3_LANE0_IP4_UNUSED 0x3 53 - 54 - #define J721E_SERDES3_LANE1_IP1_UNUSED 0x0 55 - #define J721E_SERDES3_LANE1_PCIE3_LANE1 0x1 56 - #define J721E_SERDES3_LANE1_USB3_0 0x2 57 - #define J721E_SERDES3_LANE1_IP4_UNUSED 0x3 58 - 59 - #define J721E_SERDES4_LANE0_EDP_LANE0 0x0 60 - #define J721E_SERDES4_LANE0_IP2_UNUSED 0x1 61 - #define J721E_SERDES4_LANE0_QSGMII_LANE5 0x2 62 - #define J721E_SERDES4_LANE0_IP4_UNUSED 0x3 63 - 64 - #define J721E_SERDES4_LANE1_EDP_LANE1 0x0 65 - #define J721E_SERDES4_LANE1_IP2_UNUSED 0x1 66 - #define J721E_SERDES4_LANE1_QSGMII_LANE6 0x2 67 - #define J721E_SERDES4_LANE1_IP4_UNUSED 0x3 68 - 69 - #define J721E_SERDES4_LANE2_EDP_LANE2 0x0 70 - #define J721E_SERDES4_LANE2_IP2_UNUSED 0x1 71 - #define J721E_SERDES4_LANE2_QSGMII_LANE7 0x2 72 - #define J721E_SERDES4_LANE2_IP4_UNUSED 0x3 73 - 74 - #define J721E_SERDES4_LANE3_EDP_LANE3 0x0 75 - #define J721E_SERDES4_LANE3_IP2_UNUSED 0x1 76 - #define J721E_SERDES4_LANE3_QSGMII_LANE8 0x2 77 - #define J721E_SERDES4_LANE3_IP4_UNUSED 0x3 78 - 79 - /* J7200 */ 80 - 81 - #define J7200_SERDES0_LANE0_QSGMII_LANE3 0x0 82 - #define J7200_SERDES0_LANE0_PCIE1_LANE0 0x1 83 - #define J7200_SERDES0_LANE0_IP3_UNUSED 0x2 84 - #define J7200_SERDES0_LANE0_IP4_UNUSED 0x3 85 - 86 - #define J7200_SERDES0_LANE1_QSGMII_LANE4 0x0 87 - #define J7200_SERDES0_LANE1_PCIE1_LANE1 0x1 88 - #define J7200_SERDES0_LANE1_IP3_UNUSED 0x2 89 - #define J7200_SERDES0_LANE1_IP4_UNUSED 0x3 90 - 91 - #define J7200_SERDES0_LANE2_QSGMII_LANE1 0x0 92 - #define J7200_SERDES0_LANE2_PCIE1_LANE2 0x1 93 - #define J7200_SERDES0_LANE2_IP3_UNUSED 0x2 94 - #define J7200_SERDES0_LANE2_IP4_UNUSED 0x3 95 - 96 - #define J7200_SERDES0_LANE3_QSGMII_LANE2 0x0 97 - #define J7200_SERDES0_LANE3_PCIE1_LANE3 0x1 98 - #define J7200_SERDES0_LANE3_USB 0x2 99 - #define J7200_SERDES0_LANE3_IP4_UNUSED 0x3 100 - 101 - /* AM64 */ 102 - 103 - #define AM64_SERDES0_LANE0_PCIE0 0x0 104 - #define AM64_SERDES0_LANE0_USB 0x1 105 - 106 - /* J721S2 */ 107 - 108 - #define J721S2_SERDES0_LANE0_EDP_LANE0 0x0 109 - #define J721S2_SERDES0_LANE0_PCIE1_LANE0 0x1 110 - #define J721S2_SERDES0_LANE0_IP3_UNUSED 0x2 111 - #define J721S2_SERDES0_LANE0_IP4_UNUSED 0x3 112 - 113 - #define J721S2_SERDES0_LANE1_EDP_LANE1 0x0 114 - #define J721S2_SERDES0_LANE1_PCIE1_LANE1 0x1 115 - #define J721S2_SERDES0_LANE1_USB 0x2 116 - #define J721S2_SERDES0_LANE1_IP4_UNUSED 0x3 117 - 118 - #define J721S2_SERDES0_LANE2_EDP_LANE2 0x0 119 - #define J721S2_SERDES0_LANE2_PCIE1_LANE2 0x1 120 - #define J721S2_SERDES0_LANE2_IP3_UNUSED 0x2 121 - #define J721S2_SERDES0_LANE2_IP4_UNUSED 0x3 122 - 123 - #define J721S2_SERDES0_LANE3_EDP_LANE3 0x0 124 - #define J721S2_SERDES0_LANE3_PCIE1_LANE3 0x1 125 - #define J721S2_SERDES0_LANE3_USB 0x2 126 - #define J721S2_SERDES0_LANE3_IP4_UNUSED 0x3 127 - 128 - /* J784S4 */ 129 - 130 - #define J784S4_SERDES0_LANE0_IP1_UNUSED 0x0 131 - #define J784S4_SERDES0_LANE0_PCIE1_LANE0 0x1 132 - #define J784S4_SERDES0_LANE0_IP3_UNUSED 0x2 133 - #define J784S4_SERDES0_LANE0_IP4_UNUSED 0x3 134 - 135 - #define J784S4_SERDES0_LANE1_IP1_UNUSED 0x0 136 - #define J784S4_SERDES0_LANE1_PCIE1_LANE1 0x1 137 - #define J784S4_SERDES0_LANE1_IP3_UNUSED 0x2 138 - #define J784S4_SERDES0_LANE1_IP4_UNUSED 0x3 139 - 140 - #define J784S4_SERDES0_LANE2_PCIE3_LANE0 0x0 141 - #define J784S4_SERDES0_LANE2_PCIE1_LANE2 0x1 142 - #define J784S4_SERDES0_LANE2_IP3_UNUSED 0x2 143 - #define J784S4_SERDES0_LANE2_IP4_UNUSED 0x3 144 - 145 - #define J784S4_SERDES0_LANE3_PCIE3_LANE1 0x0 146 - #define J784S4_SERDES0_LANE3_PCIE1_LANE3 0x1 147 - #define J784S4_SERDES0_LANE3_USB 0x2 148 - #define J784S4_SERDES0_LANE3_IP4_UNUSED 0x3 149 - 150 - #define J784S4_SERDES1_LANE0_QSGMII_LANE3 0x0 151 - #define J784S4_SERDES1_LANE0_PCIE0_LANE0 0x1 152 - #define J784S4_SERDES1_LANE0_IP3_UNUSED 0x2 153 - #define J784S4_SERDES1_LANE0_IP4_UNUSED 0x3 154 - 155 - #define J784S4_SERDES1_LANE1_QSGMII_LANE4 0x0 156 - #define J784S4_SERDES1_LANE1_PCIE0_LANE1 0x1 157 - #define J784S4_SERDES1_LANE1_IP3_UNUSED 0x2 158 - #define J784S4_SERDES1_LANE1_IP4_UNUSED 0x3 159 - 160 - #define J784S4_SERDES1_LANE2_QSGMII_LANE1 0x0 161 - #define J784S4_SERDES1_LANE2_PCIE0_LANE2 0x1 162 - #define J784S4_SERDES1_LANE2_PCIE2_LANE0 0x2 163 - #define J784S4_SERDES1_LANE2_IP4_UNUSED 0x3 164 - 165 - #define J784S4_SERDES1_LANE3_QSGMII_LANE2 0x0 166 - #define J784S4_SERDES1_LANE3_PCIE0_LANE3 0x1 167 - #define J784S4_SERDES1_LANE3_PCIE2_LANE1 0x2 168 - #define J784S4_SERDES1_LANE3_IP4_UNUSED 0x3 169 - 170 - #define J784S4_SERDES2_LANE0_QSGMII_LANE5 0x0 171 - #define J784S4_SERDES2_LANE0_IP2_UNUSED 0x1 172 - #define J784S4_SERDES2_LANE0_IP3_UNUSED 0x2 173 - #define J784S4_SERDES2_LANE0_IP4_UNUSED 0x3 174 - 175 - #define J784S4_SERDES2_LANE1_QSGMII_LANE6 0x0 176 - #define J784S4_SERDES2_LANE1_IP2_UNUSED 0x1 177 - #define J784S4_SERDES2_LANE1_IP3_UNUSED 0x2 178 - #define J784S4_SERDES2_LANE1_IP4_UNUSED 0x3 179 - 180 - #define J784S4_SERDES2_LANE2_QSGMII_LANE7 0x0 181 - #define J784S4_SERDES2_LANE2_QSGMII_LANE1 0x1 182 - #define J784S4_SERDES2_LANE2_IP3_UNUSED 0x2 183 - #define J784S4_SERDES2_LANE2_IP4_UNUSED 0x3 184 - 185 - #define J784S4_SERDES2_LANE3_QSGMII_LANE8 0x0 186 - #define J784S4_SERDES2_LANE3_QSGMII_LANE2 0x1 187 - #define J784S4_SERDES2_LANE3_IP3_UNUSED 0x2 188 - #define J784S4_SERDES2_LANE3_IP4_UNUSED 0x3 189 - 190 - #endif /* _DT_BINDINGS_MUX_TI_SERDES */
-257
include/dt-bindings/pinctrl/mt6397-pinfunc.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __DTS_MT6397_PINFUNC_H 3 - #define __DTS_MT6397_PINFUNC_H 4 - 5 - #include <dt-bindings/pinctrl/mt65xx.h> 6 - 7 - #define MT6397_PIN_0_INT__FUNC_GPIO0 (MTK_PIN_NO(0) | 0) 8 - #define MT6397_PIN_0_INT__FUNC_INT (MTK_PIN_NO(0) | 1) 9 - 10 - #define MT6397_PIN_1_SRCVOLTEN__FUNC_GPIO1 (MTK_PIN_NO(1) | 0) 11 - #define MT6397_PIN_1_SRCVOLTEN__FUNC_SRCVOLTEN (MTK_PIN_NO(1) | 1) 12 - #define MT6397_PIN_1_SRCVOLTEN__FUNC_TEST_CK1 (MTK_PIN_NO(1) | 6) 13 - 14 - #define MT6397_PIN_2_SRCLKEN_PERI__FUNC_GPIO2 (MTK_PIN_NO(2) | 0) 15 - #define MT6397_PIN_2_SRCLKEN_PERI__FUNC_SRCLKEN_PERI (MTK_PIN_NO(2) | 1) 16 - #define MT6397_PIN_2_SRCLKEN_PERI__FUNC_TEST_CK2 (MTK_PIN_NO(2) | 6) 17 - 18 - #define MT6397_PIN_3_RTC_32K1V8__FUNC_GPIO3 (MTK_PIN_NO(3) | 0) 19 - #define MT6397_PIN_3_RTC_32K1V8__FUNC_RTC_32K1V8 (MTK_PIN_NO(3) | 1) 20 - #define MT6397_PIN_3_RTC_32K1V8__FUNC_TEST_CK3 (MTK_PIN_NO(3) | 6) 21 - 22 - #define MT6397_PIN_4_WRAP_EVENT__FUNC_GPIO4 (MTK_PIN_NO(4) | 0) 23 - #define MT6397_PIN_4_WRAP_EVENT__FUNC_WRAP_EVENT (MTK_PIN_NO(4) | 1) 24 - 25 - #define MT6397_PIN_5_SPI_CLK__FUNC_GPIO5 (MTK_PIN_NO(5) | 0) 26 - #define MT6397_PIN_5_SPI_CLK__FUNC_SPI_CLK (MTK_PIN_NO(5) | 1) 27 - 28 - #define MT6397_PIN_6_SPI_CSN__FUNC_GPIO6 (MTK_PIN_NO(6) | 0) 29 - #define MT6397_PIN_6_SPI_CSN__FUNC_SPI_CSN (MTK_PIN_NO(6) | 1) 30 - 31 - #define MT6397_PIN_7_SPI_MOSI__FUNC_GPIO7 (MTK_PIN_NO(7) | 0) 32 - #define MT6397_PIN_7_SPI_MOSI__FUNC_SPI_MOSI (MTK_PIN_NO(7) | 1) 33 - 34 - #define MT6397_PIN_8_SPI_MISO__FUNC_GPIO8 (MTK_PIN_NO(8) | 0) 35 - #define MT6397_PIN_8_SPI_MISO__FUNC_SPI_MISO (MTK_PIN_NO(8) | 1) 36 - 37 - #define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_GPIO9 (MTK_PIN_NO(9) | 0) 38 - #define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_AUD_CLK (MTK_PIN_NO(9) | 1) 39 - #define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_TEST_IN0 (MTK_PIN_NO(9) | 6) 40 - #define MT6397_PIN_9_AUD_CLK_MOSI__FUNC_TEST_OUT0 (MTK_PIN_NO(9) | 7) 41 - 42 - #define MT6397_PIN_10_AUD_DAT_MISO__FUNC_GPIO10 (MTK_PIN_NO(10) | 0) 43 - #define MT6397_PIN_10_AUD_DAT_MISO__FUNC_AUD_MISO (MTK_PIN_NO(10) | 1) 44 - #define MT6397_PIN_10_AUD_DAT_MISO__FUNC_TEST_IN1 (MTK_PIN_NO(10) | 6) 45 - #define MT6397_PIN_10_AUD_DAT_MISO__FUNC_TEST_OUT1 (MTK_PIN_NO(10) | 7) 46 - 47 - #define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_GPIO11 (MTK_PIN_NO(11) | 0) 48 - #define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_AUD_MOSI (MTK_PIN_NO(11) | 1) 49 - #define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_TEST_IN2 (MTK_PIN_NO(11) | 6) 50 - #define MT6397_PIN_11_AUD_DAT_MOSI__FUNC_TEST_OUT2 (MTK_PIN_NO(11) | 7) 51 - 52 - #define MT6397_PIN_12_COL0__FUNC_GPIO12 (MTK_PIN_NO(12) | 0) 53 - #define MT6397_PIN_12_COL0__FUNC_COL0_USBDL (MTK_PIN_NO(12) | 1) 54 - #define MT6397_PIN_12_COL0__FUNC_EINT10_1X (MTK_PIN_NO(12) | 2) 55 - #define MT6397_PIN_12_COL0__FUNC_PWM1_3X (MTK_PIN_NO(12) | 3) 56 - #define MT6397_PIN_12_COL0__FUNC_TEST_IN3 (MTK_PIN_NO(12) | 6) 57 - #define MT6397_PIN_12_COL0__FUNC_TEST_OUT3 (MTK_PIN_NO(12) | 7) 58 - 59 - #define MT6397_PIN_13_COL1__FUNC_GPIO13 (MTK_PIN_NO(13) | 0) 60 - #define MT6397_PIN_13_COL1__FUNC_COL1 (MTK_PIN_NO(13) | 1) 61 - #define MT6397_PIN_13_COL1__FUNC_EINT11_1X (MTK_PIN_NO(13) | 2) 62 - #define MT6397_PIN_13_COL1__FUNC_SCL0_2X (MTK_PIN_NO(13) | 3) 63 - #define MT6397_PIN_13_COL1__FUNC_TEST_IN4 (MTK_PIN_NO(13) | 6) 64 - #define MT6397_PIN_13_COL1__FUNC_TEST_OUT4 (MTK_PIN_NO(13) | 7) 65 - 66 - #define MT6397_PIN_14_COL2__FUNC_GPIO14 (MTK_PIN_NO(14) | 0) 67 - #define MT6397_PIN_14_COL2__FUNC_COL2 (MTK_PIN_NO(14) | 1) 68 - #define MT6397_PIN_14_COL2__FUNC_EINT12_1X (MTK_PIN_NO(14) | 2) 69 - #define MT6397_PIN_14_COL2__FUNC_SDA0_2X (MTK_PIN_NO(14) | 3) 70 - #define MT6397_PIN_14_COL2__FUNC_TEST_IN5 (MTK_PIN_NO(14) | 6) 71 - #define MT6397_PIN_14_COL2__FUNC_TEST_OUT5 (MTK_PIN_NO(14) | 7) 72 - 73 - #define MT6397_PIN_15_COL3__FUNC_GPIO15 (MTK_PIN_NO(15) | 0) 74 - #define MT6397_PIN_15_COL3__FUNC_COL3 (MTK_PIN_NO(15) | 1) 75 - #define MT6397_PIN_15_COL3__FUNC_EINT13_1X (MTK_PIN_NO(15) | 2) 76 - #define MT6397_PIN_15_COL3__FUNC_SCL1_2X (MTK_PIN_NO(15) | 3) 77 - #define MT6397_PIN_15_COL3__FUNC_TEST_IN6 (MTK_PIN_NO(15) | 6) 78 - #define MT6397_PIN_15_COL3__FUNC_TEST_OUT6 (MTK_PIN_NO(15) | 7) 79 - 80 - #define MT6397_PIN_16_COL4__FUNC_GPIO16 (MTK_PIN_NO(16) | 0) 81 - #define MT6397_PIN_16_COL4__FUNC_COL4 (MTK_PIN_NO(16) | 1) 82 - #define MT6397_PIN_16_COL4__FUNC_EINT14_1X (MTK_PIN_NO(16) | 2) 83 - #define MT6397_PIN_16_COL4__FUNC_SDA1_2X (MTK_PIN_NO(16) | 3) 84 - #define MT6397_PIN_16_COL4__FUNC_TEST_IN7 (MTK_PIN_NO(16) | 6) 85 - #define MT6397_PIN_16_COL4__FUNC_TEST_OUT7 (MTK_PIN_NO(16) | 7) 86 - 87 - #define MT6397_PIN_17_COL5__FUNC_GPIO17 (MTK_PIN_NO(17) | 0) 88 - #define MT6397_PIN_17_COL5__FUNC_COL5 (MTK_PIN_NO(17) | 1) 89 - #define MT6397_PIN_17_COL5__FUNC_EINT15_1X (MTK_PIN_NO(17) | 2) 90 - #define MT6397_PIN_17_COL5__FUNC_SCL2_2X (MTK_PIN_NO(17) | 3) 91 - #define MT6397_PIN_17_COL5__FUNC_TEST_IN8 (MTK_PIN_NO(17) | 6) 92 - #define MT6397_PIN_17_COL5__FUNC_TEST_OUT8 (MTK_PIN_NO(17) | 7) 93 - 94 - #define MT6397_PIN_18_COL6__FUNC_GPIO18 (MTK_PIN_NO(18) | 0) 95 - #define MT6397_PIN_18_COL6__FUNC_COL6 (MTK_PIN_NO(18) | 1) 96 - #define MT6397_PIN_18_COL6__FUNC_EINT16_1X (MTK_PIN_NO(18) | 2) 97 - #define MT6397_PIN_18_COL6__FUNC_SDA2_2X (MTK_PIN_NO(18) | 3) 98 - #define MT6397_PIN_18_COL6__FUNC_GPIO32K_0 (MTK_PIN_NO(18) | 4) 99 - #define MT6397_PIN_18_COL6__FUNC_GPIO26M_0 (MTK_PIN_NO(18) | 5) 100 - #define MT6397_PIN_18_COL6__FUNC_TEST_IN9 (MTK_PIN_NO(18) | 6) 101 - #define MT6397_PIN_18_COL6__FUNC_TEST_OUT9 (MTK_PIN_NO(18) | 7) 102 - 103 - #define MT6397_PIN_19_COL7__FUNC_GPIO19 (MTK_PIN_NO(19) | 0) 104 - #define MT6397_PIN_19_COL7__FUNC_COL7 (MTK_PIN_NO(19) | 1) 105 - #define MT6397_PIN_19_COL7__FUNC_EINT17_1X (MTK_PIN_NO(19) | 2) 106 - #define MT6397_PIN_19_COL7__FUNC_PWM2_3X (MTK_PIN_NO(19) | 3) 107 - #define MT6397_PIN_19_COL7__FUNC_GPIO32K_1 (MTK_PIN_NO(19) | 4) 108 - #define MT6397_PIN_19_COL7__FUNC_GPIO26M_1 (MTK_PIN_NO(19) | 5) 109 - #define MT6397_PIN_19_COL7__FUNC_TEST_IN10 (MTK_PIN_NO(19) | 6) 110 - #define MT6397_PIN_19_COL7__FUNC_TEST_OUT10 (MTK_PIN_NO(19) | 7) 111 - 112 - #define MT6397_PIN_20_ROW0__FUNC_GPIO20 (MTK_PIN_NO(20) | 0) 113 - #define MT6397_PIN_20_ROW0__FUNC_ROW0 (MTK_PIN_NO(20) | 1) 114 - #define MT6397_PIN_20_ROW0__FUNC_EINT18_1X (MTK_PIN_NO(20) | 2) 115 - #define MT6397_PIN_20_ROW0__FUNC_SCL0_3X (MTK_PIN_NO(20) | 3) 116 - #define MT6397_PIN_20_ROW0__FUNC_TEST_IN11 (MTK_PIN_NO(20) | 6) 117 - #define MT6397_PIN_20_ROW0__FUNC_TEST_OUT11 (MTK_PIN_NO(20) | 7) 118 - 119 - #define MT6397_PIN_21_ROW1__FUNC_GPIO21 (MTK_PIN_NO(21) | 0) 120 - #define MT6397_PIN_21_ROW1__FUNC_ROW1 (MTK_PIN_NO(21) | 1) 121 - #define MT6397_PIN_21_ROW1__FUNC_EINT19_1X (MTK_PIN_NO(21) | 2) 122 - #define MT6397_PIN_21_ROW1__FUNC_SDA0_3X (MTK_PIN_NO(21) | 3) 123 - #define MT6397_PIN_21_ROW1__FUNC_AUD_TSTCK (MTK_PIN_NO(21) | 4) 124 - #define MT6397_PIN_21_ROW1__FUNC_TEST_IN12 (MTK_PIN_NO(21) | 6) 125 - #define MT6397_PIN_21_ROW1__FUNC_TEST_OUT12 (MTK_PIN_NO(21) | 7) 126 - 127 - #define MT6397_PIN_22_ROW2__FUNC_GPIO22 (MTK_PIN_NO(22) | 0) 128 - #define MT6397_PIN_22_ROW2__FUNC_ROW2 (MTK_PIN_NO(22) | 1) 129 - #define MT6397_PIN_22_ROW2__FUNC_EINT20_1X (MTK_PIN_NO(22) | 2) 130 - #define MT6397_PIN_22_ROW2__FUNC_SCL1_3X (MTK_PIN_NO(22) | 3) 131 - #define MT6397_PIN_22_ROW2__FUNC_TEST_IN13 (MTK_PIN_NO(22) | 6) 132 - #define MT6397_PIN_22_ROW2__FUNC_TEST_OUT13 (MTK_PIN_NO(22) | 7) 133 - 134 - #define MT6397_PIN_23_ROW3__FUNC_GPIO23 (MTK_PIN_NO(23) | 0) 135 - #define MT6397_PIN_23_ROW3__FUNC_ROW3 (MTK_PIN_NO(23) | 1) 136 - #define MT6397_PIN_23_ROW3__FUNC_EINT21_1X (MTK_PIN_NO(23) | 2) 137 - #define MT6397_PIN_23_ROW3__FUNC_SDA1_3X (MTK_PIN_NO(23) | 3) 138 - #define MT6397_PIN_23_ROW3__FUNC_TEST_IN14 (MTK_PIN_NO(23) | 6) 139 - #define MT6397_PIN_23_ROW3__FUNC_TEST_OUT14 (MTK_PIN_NO(23) | 7) 140 - 141 - #define MT6397_PIN_24_ROW4__FUNC_GPIO24 (MTK_PIN_NO(24) | 0) 142 - #define MT6397_PIN_24_ROW4__FUNC_ROW4 (MTK_PIN_NO(24) | 1) 143 - #define MT6397_PIN_24_ROW4__FUNC_EINT22_1X (MTK_PIN_NO(24) | 2) 144 - #define MT6397_PIN_24_ROW4__FUNC_SCL2_3X (MTK_PIN_NO(24) | 3) 145 - #define MT6397_PIN_24_ROW4__FUNC_TEST_IN15 (MTK_PIN_NO(24) | 6) 146 - #define MT6397_PIN_24_ROW4__FUNC_TEST_OUT15 (MTK_PIN_NO(24) | 7) 147 - 148 - #define MT6397_PIN_25_ROW5__FUNC_GPIO25 (MTK_PIN_NO(25) | 0) 149 - #define MT6397_PIN_25_ROW5__FUNC_ROW5 (MTK_PIN_NO(25) | 1) 150 - #define MT6397_PIN_25_ROW5__FUNC_EINT23_1X (MTK_PIN_NO(25) | 2) 151 - #define MT6397_PIN_25_ROW5__FUNC_SDA2_3X (MTK_PIN_NO(25) | 3) 152 - #define MT6397_PIN_25_ROW5__FUNC_TEST_IN16 (MTK_PIN_NO(25) | 6) 153 - #define MT6397_PIN_25_ROW5__FUNC_TEST_OUT16 (MTK_PIN_NO(25) | 7) 154 - 155 - #define MT6397_PIN_26_ROW6__FUNC_GPIO26 (MTK_PIN_NO(26) | 0) 156 - #define MT6397_PIN_26_ROW6__FUNC_ROW6 (MTK_PIN_NO(26) | 1) 157 - #define MT6397_PIN_26_ROW6__FUNC_EINT24_1X (MTK_PIN_NO(26) | 2) 158 - #define MT6397_PIN_26_ROW6__FUNC_PWM3_3X (MTK_PIN_NO(26) | 3) 159 - #define MT6397_PIN_26_ROW6__FUNC_GPIO32K_2 (MTK_PIN_NO(26) | 4) 160 - #define MT6397_PIN_26_ROW6__FUNC_GPIO26M_2 (MTK_PIN_NO(26) | 5) 161 - #define MT6397_PIN_26_ROW6__FUNC_TEST_IN17 (MTK_PIN_NO(26) | 6) 162 - #define MT6397_PIN_26_ROW6__FUNC_TEST_OUT17 (MTK_PIN_NO(26) | 7) 163 - 164 - #define MT6397_PIN_27_ROW7__FUNC_GPIO27 (MTK_PIN_NO(27) | 0) 165 - #define MT6397_PIN_27_ROW7__FUNC_ROW7 (MTK_PIN_NO(27) | 1) 166 - #define MT6397_PIN_27_ROW7__FUNC_EINT3_1X (MTK_PIN_NO(27) | 2) 167 - #define MT6397_PIN_27_ROW7__FUNC_CBUS (MTK_PIN_NO(27) | 3) 168 - #define MT6397_PIN_27_ROW7__FUNC_GPIO32K_3 (MTK_PIN_NO(27) | 4) 169 - #define MT6397_PIN_27_ROW7__FUNC_GPIO26M_3 (MTK_PIN_NO(27) | 5) 170 - #define MT6397_PIN_27_ROW7__FUNC_TEST_IN18 (MTK_PIN_NO(27) | 6) 171 - #define MT6397_PIN_27_ROW7__FUNC_TEST_OUT18 (MTK_PIN_NO(27) | 7) 172 - 173 - #define MT6397_PIN_28_PWM1__FUNC_GPIO28 (MTK_PIN_NO(28) | 0) 174 - #define MT6397_PIN_28_PWM1__FUNC_PWM1 (MTK_PIN_NO(28) | 1) 175 - #define MT6397_PIN_28_PWM1__FUNC_EINT4_1X (MTK_PIN_NO(28) | 2) 176 - #define MT6397_PIN_28_PWM1__FUNC_GPIO32K_4 (MTK_PIN_NO(28) | 4) 177 - #define MT6397_PIN_28_PWM1__FUNC_GPIO26M_4 (MTK_PIN_NO(28) | 5) 178 - #define MT6397_PIN_28_PWM1__FUNC_TEST_IN19 (MTK_PIN_NO(28) | 6) 179 - #define MT6397_PIN_28_PWM1__FUNC_TEST_OUT19 (MTK_PIN_NO(28) | 7) 180 - 181 - #define MT6397_PIN_29_PWM2__FUNC_GPIO29 (MTK_PIN_NO(29) | 0) 182 - #define MT6397_PIN_29_PWM2__FUNC_PWM2 (MTK_PIN_NO(29) | 1) 183 - #define MT6397_PIN_29_PWM2__FUNC_EINT5_1X (MTK_PIN_NO(29) | 2) 184 - #define MT6397_PIN_29_PWM2__FUNC_GPIO32K_5 (MTK_PIN_NO(29) | 4) 185 - #define MT6397_PIN_29_PWM2__FUNC_GPIO26M_5 (MTK_PIN_NO(29) | 5) 186 - #define MT6397_PIN_29_PWM2__FUNC_TEST_IN20 (MTK_PIN_NO(29) | 6) 187 - #define MT6397_PIN_29_PWM2__FUNC_TEST_OUT20 (MTK_PIN_NO(29) | 7) 188 - 189 - #define MT6397_PIN_30_PWM3__FUNC_GPIO30 (MTK_PIN_NO(30) | 0) 190 - #define MT6397_PIN_30_PWM3__FUNC_PWM3 (MTK_PIN_NO(30) | 1) 191 - #define MT6397_PIN_30_PWM3__FUNC_EINT6_1X (MTK_PIN_NO(30) | 2) 192 - #define MT6397_PIN_30_PWM3__FUNC_COL0 (MTK_PIN_NO(30) | 3) 193 - #define MT6397_PIN_30_PWM3__FUNC_GPIO32K_6 (MTK_PIN_NO(30) | 4) 194 - #define MT6397_PIN_30_PWM3__FUNC_GPIO26M_6 (MTK_PIN_NO(30) | 5) 195 - #define MT6397_PIN_30_PWM3__FUNC_TEST_IN21 (MTK_PIN_NO(30) | 6) 196 - #define MT6397_PIN_30_PWM3__FUNC_TEST_OUT21 (MTK_PIN_NO(30) | 7) 197 - 198 - #define MT6397_PIN_31_SCL0__FUNC_GPIO31 (MTK_PIN_NO(31) | 0) 199 - #define MT6397_PIN_31_SCL0__FUNC_SCL0 (MTK_PIN_NO(31) | 1) 200 - #define MT6397_PIN_31_SCL0__FUNC_EINT7_1X (MTK_PIN_NO(31) | 2) 201 - #define MT6397_PIN_31_SCL0__FUNC_PWM1_2X (MTK_PIN_NO(31) | 3) 202 - #define MT6397_PIN_31_SCL0__FUNC_TEST_IN22 (MTK_PIN_NO(31) | 6) 203 - #define MT6397_PIN_31_SCL0__FUNC_TEST_OUT22 (MTK_PIN_NO(31) | 7) 204 - 205 - #define MT6397_PIN_32_SDA0__FUNC_GPIO32 (MTK_PIN_NO(32) | 0) 206 - #define MT6397_PIN_32_SDA0__FUNC_SDA0 (MTK_PIN_NO(32) | 1) 207 - #define MT6397_PIN_32_SDA0__FUNC_EINT8_1X (MTK_PIN_NO(32) | 2) 208 - #define MT6397_PIN_32_SDA0__FUNC_TEST_IN23 (MTK_PIN_NO(32) | 6) 209 - #define MT6397_PIN_32_SDA0__FUNC_TEST_OUT23 (MTK_PIN_NO(32) | 7) 210 - 211 - #define MT6397_PIN_33_SCL1__FUNC_GPIO33 (MTK_PIN_NO(33) | 0) 212 - #define MT6397_PIN_33_SCL1__FUNC_SCL1 (MTK_PIN_NO(33) | 1) 213 - #define MT6397_PIN_33_SCL1__FUNC_EINT9_1X (MTK_PIN_NO(33) | 2) 214 - #define MT6397_PIN_33_SCL1__FUNC_PWM2_2X (MTK_PIN_NO(33) | 3) 215 - #define MT6397_PIN_33_SCL1__FUNC_TEST_IN24 (MTK_PIN_NO(33) | 6) 216 - #define MT6397_PIN_33_SCL1__FUNC_TEST_OUT24 (MTK_PIN_NO(33) | 7) 217 - 218 - #define MT6397_PIN_34_SDA1__FUNC_GPIO34 (MTK_PIN_NO(34) | 0) 219 - #define MT6397_PIN_34_SDA1__FUNC_SDA1 (MTK_PIN_NO(34) | 1) 220 - #define MT6397_PIN_34_SDA1__FUNC_EINT0_1X (MTK_PIN_NO(34) | 2) 221 - #define MT6397_PIN_34_SDA1__FUNC_TEST_IN25 (MTK_PIN_NO(34) | 6) 222 - #define MT6397_PIN_34_SDA1__FUNC_TEST_OUT25 (MTK_PIN_NO(34) | 7) 223 - 224 - #define MT6397_PIN_35_SCL2__FUNC_GPIO35 (MTK_PIN_NO(35) | 0) 225 - #define MT6397_PIN_35_SCL2__FUNC_SCL2 (MTK_PIN_NO(35) | 1) 226 - #define MT6397_PIN_35_SCL2__FUNC_EINT1_1X (MTK_PIN_NO(35) | 2) 227 - #define MT6397_PIN_35_SCL2__FUNC_PWM3_2X (MTK_PIN_NO(35) | 3) 228 - #define MT6397_PIN_35_SCL2__FUNC_TEST_IN26 (MTK_PIN_NO(35) | 6) 229 - #define MT6397_PIN_35_SCL2__FUNC_TEST_OUT26 (MTK_PIN_NO(35) | 7) 230 - 231 - #define MT6397_PIN_36_SDA2__FUNC_GPIO36 (MTK_PIN_NO(36) | 0) 232 - #define MT6397_PIN_36_SDA2__FUNC_SDA2 (MTK_PIN_NO(36) | 1) 233 - #define MT6397_PIN_36_SDA2__FUNC_EINT2_1X (MTK_PIN_NO(36) | 2) 234 - #define MT6397_PIN_36_SDA2__FUNC_TEST_IN27 (MTK_PIN_NO(36) | 6) 235 - #define MT6397_PIN_36_SDA2__FUNC_TEST_OUT27 (MTK_PIN_NO(36) | 7) 236 - 237 - #define MT6397_PIN_37_HDMISD__FUNC_GPIO37 (MTK_PIN_NO(37) | 0) 238 - #define MT6397_PIN_37_HDMISD__FUNC_HDMISD (MTK_PIN_NO(37) | 1) 239 - #define MT6397_PIN_37_HDMISD__FUNC_TEST_IN28 (MTK_PIN_NO(37) | 6) 240 - #define MT6397_PIN_37_HDMISD__FUNC_TEST_OUT28 (MTK_PIN_NO(37) | 7) 241 - 242 - #define MT6397_PIN_38_HDMISCK__FUNC_GPIO38 (MTK_PIN_NO(38) | 0) 243 - #define MT6397_PIN_38_HDMISCK__FUNC_HDMISCK (MTK_PIN_NO(38) | 1) 244 - #define MT6397_PIN_38_HDMISCK__FUNC_TEST_IN29 (MTK_PIN_NO(38) | 6) 245 - #define MT6397_PIN_38_HDMISCK__FUNC_TEST_OUT29 (MTK_PIN_NO(38) | 7) 246 - 247 - #define MT6397_PIN_39_HTPLG__FUNC_GPIO39 (MTK_PIN_NO(39) | 0) 248 - #define MT6397_PIN_39_HTPLG__FUNC_HTPLG (MTK_PIN_NO(39) | 1) 249 - #define MT6397_PIN_39_HTPLG__FUNC_TEST_IN30 (MTK_PIN_NO(39) | 6) 250 - #define MT6397_PIN_39_HTPLG__FUNC_TEST_OUT30 (MTK_PIN_NO(39) | 7) 251 - 252 - #define MT6397_PIN_40_CEC__FUNC_GPIO40 (MTK_PIN_NO(40) | 0) 253 - #define MT6397_PIN_40_CEC__FUNC_CEC (MTK_PIN_NO(40) | 1) 254 - #define MT6397_PIN_40_CEC__FUNC_TEST_IN31 (MTK_PIN_NO(40) | 6) 255 - #define MT6397_PIN_40_CEC__FUNC_TEST_OUT31 (MTK_PIN_NO(40) | 7) 256 - 257 - #endif /* __DTS_MT6397_PINFUNC_H */
-20
include/dt-bindings/reset/bcm6318-reset.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0+ */ 2 - 3 - #ifndef __DT_BINDINGS_RESET_BCM6318_H 4 - #define __DT_BINDINGS_RESET_BCM6318_H 5 - 6 - #define BCM6318_RST_SPI 0 7 - #define BCM6318_RST_EPHY 1 8 - #define BCM6318_RST_SAR 2 9 - #define BCM6318_RST_ENETSW 3 10 - #define BCM6318_RST_USBD 4 11 - #define BCM6318_RST_USBH 5 12 - #define BCM6318_RST_PCIE_CORE 6 13 - #define BCM6318_RST_PCIE 7 14 - #define BCM6318_RST_PCIE_EXT 8 15 - #define BCM6318_RST_PCIE_HARD 9 16 - #define BCM6318_RST_ADSL 10 17 - #define BCM6318_RST_PHYMIPS 11 18 - #define BCM6318_RST_HOSTMIPS 12 19 - 20 - #endif /* __DT_BINDINGS_RESET_BCM6318_H */
-59
include/dt-bindings/reset/imx8ulp-pcc-reset.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright 2021 NXP 4 - */ 5 - 6 - #ifndef DT_BINDING_PCC_RESET_IMX8ULP_H 7 - #define DT_BINDING_PCC_RESET_IMX8ULP_H 8 - 9 - /* PCC3 */ 10 - #define PCC3_WDOG3_SWRST 0 11 - #define PCC3_WDOG4_SWRST 1 12 - #define PCC3_LPIT1_SWRST 2 13 - #define PCC3_TPM4_SWRST 3 14 - #define PCC3_TPM5_SWRST 4 15 - #define PCC3_FLEXIO1_SWRST 5 16 - #define PCC3_I3C2_SWRST 6 17 - #define PCC3_LPI2C4_SWRST 7 18 - #define PCC3_LPI2C5_SWRST 8 19 - #define PCC3_LPUART4_SWRST 9 20 - #define PCC3_LPUART5_SWRST 10 21 - #define PCC3_LPSPI4_SWRST 11 22 - #define PCC3_LPSPI5_SWRST 12 23 - 24 - /* PCC4 */ 25 - #define PCC4_FLEXSPI2_SWRST 0 26 - #define PCC4_TPM6_SWRST 1 27 - #define PCC4_TPM7_SWRST 2 28 - #define PCC4_LPI2C6_SWRST 3 29 - #define PCC4_LPI2C7_SWRST 4 30 - #define PCC4_LPUART6_SWRST 5 31 - #define PCC4_LPUART7_SWRST 6 32 - #define PCC4_SAI4_SWRST 7 33 - #define PCC4_SAI5_SWRST 8 34 - #define PCC4_USDHC0_SWRST 9 35 - #define PCC4_USDHC1_SWRST 10 36 - #define PCC4_USDHC2_SWRST 11 37 - #define PCC4_USB0_SWRST 12 38 - #define PCC4_USB0_PHY_SWRST 13 39 - #define PCC4_USB1_SWRST 14 40 - #define PCC4_USB1_PHY_SWRST 15 41 - #define PCC4_ENET_SWRST 16 42 - 43 - /* PCC5 */ 44 - #define PCC5_TPM8_SWRST 0 45 - #define PCC5_SAI6_SWRST 1 46 - #define PCC5_SAI7_SWRST 2 47 - #define PCC5_SPDIF_SWRST 3 48 - #define PCC5_ISI_SWRST 4 49 - #define PCC5_CSI_REGS_SWRST 5 50 - #define PCC5_CSI_SWRST 6 51 - #define PCC5_DSI_SWRST 7 52 - #define PCC5_WDOG5_SWRST 8 53 - #define PCC5_EPDC_SWRST 9 54 - #define PCC5_PXP_SWRST 10 55 - #define PCC5_GPU2D_SWRST 11 56 - #define PCC5_GPU3D_SWRST 12 57 - #define PCC5_DC_NANO_SWRST 13 58 - 59 - #endif /*DT_BINDING_RESET_IMX8ULP_H */
-42
include/dt-bindings/reset/oxsemi,ox810se.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 4 - */ 5 - 6 - #ifndef DT_RESET_OXSEMI_OX810SE_H 7 - #define DT_RESET_OXSEMI_OX810SE_H 8 - 9 - #define RESET_ARM 0 10 - #define RESET_COPRO 1 11 - /* Reserved 2 */ 12 - /* Reserved 3 */ 13 - #define RESET_USBHS 4 14 - #define RESET_USBHSPHY 5 15 - #define RESET_MAC 6 16 - #define RESET_PCI 7 17 - #define RESET_DMA 8 18 - #define RESET_DPE 9 19 - #define RESET_DDR 10 20 - #define RESET_SATA 11 21 - #define RESET_SATA_LINK 12 22 - #define RESET_SATA_PHY 13 23 - /* Reserved 14 */ 24 - #define RESET_NAND 15 25 - #define RESET_GPIO 16 26 - #define RESET_UART1 17 27 - #define RESET_UART2 18 28 - #define RESET_MISC 19 29 - #define RESET_I2S 20 30 - #define RESET_AHB_MON 21 31 - #define RESET_UART3 22 32 - #define RESET_UART4 23 33 - #define RESET_SGDMA 24 34 - /* Reserved 25 */ 35 - /* Reserved 26 */ 36 - /* Reserved 27 */ 37 - /* Reserved 28 */ 38 - /* Reserved 29 */ 39 - /* Reserved 30 */ 40 - #define RESET_BUS 31 41 - 42 - #endif /* DT_RESET_OXSEMI_OX810SE_H */
-42
include/dt-bindings/reset/oxsemi,ox820.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 4 - */ 5 - 6 - #ifndef DT_RESET_OXSEMI_OX820_H 7 - #define DT_RESET_OXSEMI_OX820_H 8 - 9 - #define RESET_SCU 0 10 - #define RESET_LEON 1 11 - #define RESET_ARM0 2 12 - #define RESET_ARM1 3 13 - #define RESET_USBHS 4 14 - #define RESET_USBPHYA 5 15 - #define RESET_MAC 6 16 - #define RESET_PCIEA 7 17 - #define RESET_SGDMA 8 18 - #define RESET_CIPHER 9 19 - #define RESET_DDR 10 20 - #define RESET_SATA 11 21 - #define RESET_SATA_LINK 12 22 - #define RESET_SATA_PHY 13 23 - #define RESET_PCIEPHY 14 24 - #define RESET_NAND 15 25 - #define RESET_GPIO 16 26 - #define RESET_UART1 17 27 - #define RESET_UART2 18 28 - #define RESET_MISC 19 29 - #define RESET_I2S 20 30 - #define RESET_SD 21 31 - #define RESET_MAC_2 22 32 - #define RESET_PCIEB 23 33 - #define RESET_VIDEO 24 34 - #define RESET_DDR_PHY 25 35 - #define RESET_USBPHYB 26 36 - #define RESET_USBDEV 27 37 - /* Reserved 29 */ 38 - #define RESET_ARMDBG 29 39 - #define RESET_PLLA 30 40 - #define RESET_PLLB 31 41 - 42 - #endif /* DT_RESET_OXSEMI_OX820_H */
-10
include/dt-bindings/sound/audio-jack-events.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __AUDIO_JACK_EVENTS_H 3 - #define __AUDIO_JACK_EVENTS_H 4 - 5 - #define JACK_HEADPHONE 1 6 - #define JACK_MICROPHONE 2 7 - #define JACK_LINEOUT 3 8 - #define JACK_LINEIN 4 9 - 10 - #endif /* __AUDIO_JACK_EVENTS_H */
+7
include/linux/of.h
··· 1485 1485 #define for_each_compatible_node(dn, type, compatible) \ 1486 1486 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ 1487 1487 dn = of_find_compatible_node(dn, type, compatible)) 1488 + 1489 + #define for_each_compatible_node_scoped(dn, type, compatible) \ 1490 + for (struct device_node *dn __free(device_node) = \ 1491 + of_find_compatible_node(NULL, type, compatible); \ 1492 + dn; \ 1493 + dn = of_find_compatible_node(dn, type, compatible)) 1494 + 1488 1495 #define for_each_matching_node(dn, matches) \ 1489 1496 for (dn = of_find_matching_node(NULL, matches); dn; \ 1490 1497 dn = of_find_matching_node(dn, matches))
-1
scripts/Makefile.dtbs
··· 105 105 DTC_FLAGS += -Wno-unit_address_vs_reg \ 106 106 -Wno-avoid_unnecessary_addr_size \ 107 107 -Wno-alias_paths \ 108 - -Wno-graph_child_address \ 109 108 -Wno-interrupt_map \ 110 109 -Wno-simple_bus_reg 111 110 else
+14 -28
scripts/dtc/checks.c
··· 340 340 } 341 341 ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars); 342 342 343 + static void check_node_name_not_empty(struct check *c, struct dt_info *dti, 344 + struct node *node) 345 + { 346 + if (node->basenamelen == 0 && node->parent != NULL) 347 + FAIL(c, dti, node, "Empty node name"); 348 + } 349 + ERROR(node_name_not_empty, check_node_name_not_empty, NULL, &node_name_chars); 350 + 343 351 static void check_node_name_vs_property_name(struct check *c, 344 352 struct dt_info *dti, 345 353 struct node *node) ··· 726 718 continue; 727 719 } 728 720 729 - if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) { 721 + /* This check does not work for overlays with external paths */ 722 + if (!(dti->dtsflags & DTSF_PLUGIN) && 723 + (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val))) { 730 724 FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)", 731 725 prop->val.val); 732 726 continue; 733 727 } 728 + 734 729 if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) 735 730 FAIL(c, dti, node, "aliases property name must include only lowercase and '-'"); 736 731 } ··· 1905 1894 } 1906 1895 WARNING(graph_endpoint, check_graph_endpoint, NULL, &graph_nodes); 1907 1896 1908 - static void check_graph_child_address(struct check *c, struct dt_info *dti, 1909 - struct node *node) 1910 - { 1911 - int cnt = 0; 1912 - struct node *child; 1913 - 1914 - if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus) 1915 - return; 1916 - 1917 - for_each_child(node, child) { 1918 - struct property *prop = get_property(child, "reg"); 1919 - 1920 - /* No error if we have any non-zero unit address */ 1921 - if (prop && propval_cell(prop) != 0 ) 1922 - return; 1923 - 1924 - cnt++; 1925 - } 1926 - 1927 - if (cnt == 1 && node->addr_cells != -1) 1928 - FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not necessary", 1929 - node->children->name); 1930 - } 1931 - WARNING(graph_child_address, check_graph_child_address, NULL, &graph_nodes, &graph_port, &graph_endpoint); 1932 - 1933 1897 static struct check *check_table[] = { 1934 1898 &duplicate_node_names, &duplicate_property_names, 1935 - &node_name_chars, &node_name_format, &property_name_chars, 1899 + &node_name_chars, &node_name_format, &node_name_not_empty, &property_name_chars, 1936 1900 &name_is_string, &name_properties, &node_name_vs_property_name, 1937 1901 1938 1902 &duplicate_label, ··· 1991 2005 1992 2006 &alias_paths, 1993 2007 1994 - &graph_nodes, &graph_child_address, &graph_port, &graph_endpoint, 2008 + &graph_nodes, &graph_port, &graph_endpoint, 1995 2009 1996 2010 &always_fail, 1997 2011 };
+1
scripts/dtc/dt-extract-compatibles
··· 72 72 compat_list += parse_of_functions(data, "_is_compatible") 73 73 compat_list += parse_of_functions(data, "of_find_compatible_node") 74 74 compat_list += parse_of_functions(data, "for_each_compatible_node") 75 + compat_list += parse_of_functions(data, "for_each_compatible_node_scoped") 75 76 compat_list += parse_of_functions(data, "of_get_compatible_child") 76 77 77 78 return compat_list
+5
scripts/dtc/dtc.c
··· 338 338 if (auto_label_aliases) 339 339 generate_label_tree(dti, "aliases", false); 340 340 341 + generate_labels_from_tree(dti, "__symbols__"); 342 + 341 343 if (generate_symbols) 342 344 generate_label_tree(dti, "__symbols__", true); 345 + 346 + fixup_phandles(dti, "__fixups__"); 347 + local_fixup_phandles(dti, "__local_fixups__"); 343 348 344 349 if (generate_fixups) { 345 350 generate_fixups_tree(dti, "__fixups__");
+6
scripts/dtc/dtc.h
··· 339 339 struct reserve_info *reservelist, 340 340 struct node *tree, uint32_t boot_cpuid_phys); 341 341 void sort_tree(struct dt_info *dti); 342 + void generate_labels_from_tree(struct dt_info *dti, const char *name); 342 343 void generate_label_tree(struct dt_info *dti, const char *name, bool allocph); 343 344 void generate_fixups_tree(struct dt_info *dti, const char *name); 345 + void fixup_phandles(struct dt_info *dti, const char *name); 344 346 void generate_local_fixups_tree(struct dt_info *dti, const char *name); 347 + void local_fixup_phandles(struct dt_info *dti, const char *name); 345 348 346 349 /* Checks */ 347 350 ··· 360 357 361 358 /* Tree source */ 362 359 360 + void property_add_marker(struct property *prop, 361 + enum markertype type, unsigned int offset, char *ref); 362 + void add_phandle_marker(struct dt_info *dti, struct property *prop, unsigned int offset); 363 363 void dt_to_source(FILE *f, struct dt_info *dti); 364 364 struct dt_info *dt_from_source(const char *f); 365 365
+5 -1
scripts/dtc/flattree.c
··· 807 807 struct node *tree; 808 808 uint32_t val; 809 809 int flags = 0; 810 + unsigned int dtsflags = DTSF_V1; 810 811 811 812 f = srcfile_relative_open(fname, NULL); 812 813 ··· 920 919 921 920 fclose(f); 922 921 923 - return build_dt_info(DTSF_V1, reservelist, tree, boot_cpuid_phys); 922 + if (get_subnode(tree, "__fixups__") || get_subnode(tree, "__local_fixups__")) 923 + dtsflags |= DTSF_PLUGIN; 924 + 925 + return build_dt_info(dtsflags, reservelist, tree, boot_cpuid_phys); 924 926 }
+2 -1
scripts/dtc/libfdt/fdt_overlay.c
··· 407 407 const char *fixup_str = value; 408 408 uint32_t path_len, name_len; 409 409 uint32_t fixup_len; 410 - char *sep, *endptr; 410 + const char *sep; 411 + char *endptr; 411 412 int poffset, ret; 412 413 413 414 fixup_end = memchr(value, '\0', len);
+2 -2
scripts/dtc/libfdt/fdt_ro.c
··· 306 306 const char *nameptr; 307 307 int err; 308 308 309 - if (((err = fdt_ro_probe_(fdt)) < 0) 310 - || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0)) 309 + if (!can_assume(VALID_DTB) && (((err = fdt_ro_probe_(fdt)) < 0) 310 + || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))) 311 311 goto fail; 312 312 313 313 nameptr = nh->name;
+214
scripts/dtc/libfdt/libfdt.h
··· 116 116 /* Low-level functions (you probably don't need these) */ 117 117 /**********************************************************************/ 118 118 119 + /** 120 + * fdt_offset_ptr - safely get a byte range within the device tree blob 121 + * @fdt: Pointer to the device tree blob 122 + * @offset: Offset within the blob to the desired byte range 123 + * @checklen: Required length of the byte range 124 + * 125 + * fdt_offset_ptr() returns a pointer to the byte range of length @checklen at 126 + * the given @offset within the device tree blob, after verifying that the byte 127 + * range fits entirely within the blob and does not overflow. 128 + * 129 + * returns: 130 + * pointer to the byte range, on success 131 + * NULL, if the requested range does not fit within the blob 132 + */ 119 133 #ifndef SWIG /* This function is not useful in Python */ 120 134 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen); 121 135 #endif ··· 138 124 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); 139 125 } 140 126 127 + /** 128 + * fdt_next_tag - get next tag in the device tree 129 + * @fdt: Pointer to the device tree blob 130 + * @offset: Offset within the blob to start searching 131 + * @nextoffset: Pointer to variable to store the offset of the next tag 132 + * 133 + * fdt_next_tag() returns the tag type of the next tag in the device tree 134 + * blob starting from the given @offset. If @nextoffset is non-NULL, it will 135 + * be set to the offset immediately following the tag. 136 + * 137 + * returns: 138 + * the tag type (FDT_BEGIN_NODE, FDT_END_NODE, FDT_PROP, FDT_NOP, FDT_END), 139 + * FDT_END, if offset is out of bounds 140 + */ 141 141 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset); 142 142 143 143 /* ··· 362 334 /* Read-only functions */ 363 335 /**********************************************************************/ 364 336 337 + /** 338 + * fdt_check_full - check device tree validity 339 + * @fdt: pointer to the device tree blob 340 + * @bufsize: size of the buffer containing the device tree 341 + * 342 + * fdt_check_full() checks that the given buffer contains a valid 343 + * flattened device tree and that the tree structure is internally 344 + * consistent. This is a more thorough check than fdt_check_header(). 345 + * 346 + * returns: 347 + * 0, on success 348 + * -FDT_ERR_BADMAGIC, 349 + * -FDT_ERR_BADVERSION, 350 + * -FDT_ERR_BADSTATE, 351 + * -FDT_ERR_BADSTRUCTURE, 352 + * -FDT_ERR_TRUNCATED, standard meanings 353 + */ 365 354 int fdt_check_full(const void *fdt, size_t bufsize); 366 355 367 356 /** ··· 1585 1540 */ 1586 1541 int fdt_create(void *buf, int bufsize); 1587 1542 1543 + /** 1544 + * fdt_resize - move and resize a device tree in sequential write state 1545 + * @fdt: Pointer to the device tree to resize 1546 + * @buf: Buffer where resized tree should be placed 1547 + * @bufsize: Size of the buffer at @buf 1548 + * 1549 + * fdt_resize() moves the device tree blob from @fdt to @buf and 1550 + * resizes it to fit in the new buffer size. 1551 + * 1552 + * returns: 1553 + * 0, on success 1554 + * -FDT_ERR_NOSPACE, if @bufsize is too small 1555 + * -FDT_ERR_BADMAGIC, 1556 + * -FDT_ERR_BADVERSION, 1557 + * -FDT_ERR_BADSTATE, standard meanings 1558 + */ 1588 1559 int fdt_resize(void *fdt, void *buf, int bufsize); 1560 + 1561 + /** 1562 + * fdt_add_reservemap_entry - add an entry to the memory reserve map 1563 + * @fdt: Pointer to the device tree blob 1564 + * @addr: Start address of the reserve map entry 1565 + * @size: Size of the reserved region 1566 + * 1567 + * fdt_add_reservemap_entry() adds a memory reserve map entry to the 1568 + * device tree blob during the sequential write process. This function 1569 + * can only be called after fdt_create() and before fdt_finish_reservemap(). 1570 + * 1571 + * returns: 1572 + * 0, on success 1573 + * -FDT_ERR_NOSPACE, if there is insufficient space in the blob 1574 + * -FDT_ERR_BADSTATE, if not in the correct sequential write state 1575 + */ 1589 1576 int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size); 1577 + 1578 + /** 1579 + * fdt_finish_reservemap - complete the memory reserve map 1580 + * @fdt: Pointer to the device tree blob 1581 + * 1582 + * fdt_finish_reservemap() completes the memory reserve map section 1583 + * of the device tree blob during sequential write. After calling this 1584 + * function, no more reserve map entries can be added and the blob 1585 + * moves to the structure creation phase. 1586 + * 1587 + * returns: 1588 + * 0, on success 1589 + * -FDT_ERR_BADSTATE, if not in the correct sequential write state 1590 + */ 1590 1591 int fdt_finish_reservemap(void *fdt); 1592 + 1593 + /** 1594 + * fdt_begin_node - start creation of a new node 1595 + * @fdt: Pointer to the device tree blob 1596 + * @name: Name of the node to create 1597 + * 1598 + * fdt_begin_node() starts the creation of a new node with the given 1599 + * @name during sequential write. After calling this function, properties 1600 + * can be added with fdt_property() and subnodes can be created with 1601 + * additional fdt_begin_node() calls. The node must be completed with 1602 + * fdt_end_node(). 1603 + * 1604 + * returns: 1605 + * 0, on success 1606 + * -FDT_ERR_NOSPACE, if there is insufficient space in the blob 1607 + * -FDT_ERR_BADSTATE, if not in the correct sequential write state 1608 + */ 1591 1609 int fdt_begin_node(void *fdt, const char *name); 1610 + 1611 + /** 1612 + * fdt_property - add a property to the current node 1613 + * @fdt: Pointer to the device tree blob 1614 + * @name: Name of the property to add 1615 + * @val: Pointer to the property value 1616 + * @len: Length of the property value in bytes 1617 + * 1618 + * fdt_property() adds a property with the given @name and value to 1619 + * the current node during sequential write. This function can only 1620 + * be called between fdt_begin_node() and fdt_end_node(). 1621 + * 1622 + * returns: 1623 + * 0, on success 1624 + * -FDT_ERR_NOSPACE, if there is insufficient space in the blob 1625 + * -FDT_ERR_BADSTATE, if not currently within a node 1626 + */ 1592 1627 int fdt_property(void *fdt, const char *name, const void *val, int len); 1593 1628 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val) 1594 1629 { ··· 1705 1580 1706 1581 #define fdt_property_string(fdt, name, str) \ 1707 1582 fdt_property(fdt, name, str, strlen(str)+1) 1583 + 1584 + /** 1585 + * fdt_end_node - complete the current node 1586 + * @fdt: Pointer to the device tree blob 1587 + * 1588 + * fdt_end_node() completes the current node during sequential write. This 1589 + * function must be called to close each node started with 1590 + * fdt_begin_node(). After calling this function, no more properties or subnodes 1591 + * can be added to the node. 1592 + * 1593 + * returns: 1594 + * 0, on success 1595 + * -FDT_ERR_BADSTATE, if not currently within a node 1596 + */ 1708 1597 int fdt_end_node(void *fdt); 1598 + 1599 + /** 1600 + * fdt_finish - complete device tree creation 1601 + * @fdt: Pointer to the device tree blob 1602 + * 1603 + * fdt_finish() completes the device tree creation process started with 1604 + * fdt_create(). This function finalizes the device tree blob and makes it ready 1605 + * for use. After calling this function, the blob is complete and can be used 1606 + * with libfdt read-only and read-write functions, but not with sequential write 1607 + * functions. 1608 + * 1609 + * returns: 1610 + * 0, on success 1611 + * -FDT_ERR_BADSTATE, if the sequential write process is incomplete 1612 + */ 1709 1613 int fdt_finish(void *fdt); 1710 1614 1711 1615 /**********************************************************************/ 1712 1616 /* Read-write functions */ 1713 1617 /**********************************************************************/ 1714 1618 1619 + /** 1620 + * fdt_create_empty_tree - create an empty device tree 1621 + * @buf: Buffer where the empty tree should be created 1622 + * @bufsize: Size of the buffer at @buf 1623 + * 1624 + * fdt_create_empty_tree() creates a minimal empty device tree blob 1625 + * in the given buffer. The tree contains only a root node with no 1626 + * properties or subnodes. 1627 + * 1628 + * returns: 1629 + * 0, on success 1630 + * -FDT_ERR_NOSPACE, if @bufsize is too small for even an empty tree 1631 + */ 1715 1632 int fdt_create_empty_tree(void *buf, int bufsize); 1633 + 1634 + /** 1635 + * fdt_open_into - move a device tree into a new buffer and make editable 1636 + * @fdt: Pointer to the device tree to move 1637 + * @buf: Buffer where the editable tree should be placed 1638 + * @bufsize: Size of the buffer at @buf 1639 + * 1640 + * fdt_open_into() moves and reorganizes the device tree blob from @fdt 1641 + * into @buf, converting it to a format suitable for read-write operations. 1642 + * The new buffer should allow space for modifications. 1643 + * 1644 + * returns: 1645 + * 0, on success 1646 + * -FDT_ERR_NOSPACE, if @bufsize is too small 1647 + * -FDT_ERR_BADMAGIC, 1648 + * -FDT_ERR_BADVERSION, 1649 + * -FDT_ERR_BADSTATE, 1650 + * -FDT_ERR_BADSTRUCTURE, 1651 + * -FDT_ERR_TRUNCATED, standard meanings 1652 + */ 1716 1653 int fdt_open_into(const void *fdt, void *buf, int bufsize); 1654 + 1655 + /** 1656 + * fdt_pack - pack a device tree blob 1657 + * @fdt: Pointer to the device tree blob 1658 + * 1659 + * fdt_pack() reorganizes the device tree blob to eliminate any free space 1660 + * and pack it into the minimum possible size. This is useful after making 1661 + * modifications that might have left gaps in the blob. 1662 + * 1663 + * returns: 1664 + * 0, on success 1665 + * -FDT_ERR_BADMAGIC, 1666 + * -FDT_ERR_BADVERSION, 1667 + * -FDT_ERR_BADSTATE, 1668 + * -FDT_ERR_BADSTRUCTURE, 1669 + * -FDT_ERR_BADLAYOUT, standard meanings 1670 + */ 1717 1671 int fdt_pack(void *fdt); 1718 1672 1719 1673 /** ··· 2521 2317 /* Debugging / informational functions */ 2522 2318 /**********************************************************************/ 2523 2319 2320 + /** 2321 + * fdt_strerror - return string description of error code 2322 + * @errval: Error code returned by a libfdt function 2323 + * 2324 + * fdt_strerror() returns a string description of the error code passed 2325 + * in @errval. 2326 + * 2327 + * returns: 2328 + * pointer to a string describing the error code 2329 + */ 2524 2330 const char *fdt_strerror(int errval); 2525 2331 2526 2332 #ifdef __cplusplus
-27
scripts/dtc/libfdt/libfdt_env.h
··· 66 66 #undef CPU_TO_FDT16 67 67 #undef EXTRACT_BYTE 68 68 69 - #ifdef __APPLE__ 70 - #include <AvailabilityMacros.h> 71 - 72 - /* strnlen() is not available on Mac OS < 10.7 */ 73 - # if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \ 74 - MAC_OS_X_VERSION_10_7) 75 - 76 - #define strnlen fdt_strnlen 77 - 78 - /* 79 - * fdt_strnlen: returns the length of a string or max_count - which ever is 80 - * smallest. 81 - * Input 1 string: the string whose size is to be determined 82 - * Input 2 max_count: the maximum value returned by this function 83 - * Output: length of the string or max_count (the smallest of the two) 84 - */ 85 - static inline size_t fdt_strnlen(const char *string, size_t max_count) 86 - { 87 - const char *p = memchr(string, 0, max_count); 88 - return p ? p - string : max_count; 89 - } 90 - 91 - #endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < 92 - MAC_OS_X_VERSION_10_7) */ 93 - 94 - #endif /* __APPLE__ */ 95 - 96 69 #endif /* LIBFDT_ENV_H */
+8 -6
scripts/dtc/libfdt/libfdt_internal.h
··· 11 11 #define FDT_TAGALIGN(x) (FDT_ALIGN((x), FDT_TAGSIZE)) 12 12 13 13 int32_t fdt_ro_probe_(const void *fdt); 14 - #define FDT_RO_PROBE(fdt) \ 15 - { \ 16 - int32_t totalsize_; \ 17 - if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \ 18 - return totalsize_; \ 14 + #define FDT_RO_PROBE(fdt) \ 15 + { \ 16 + if (!can_assume(VALID_DTB)) { \ 17 + int32_t totalsize_; \ 18 + if ((totalsize_ = fdt_ro_probe_(fdt)) < 0) \ 19 + return totalsize_; \ 20 + } \ 19 21 } 20 22 21 23 int fdt_check_node_offset_(const void *fdt, int offset); ··· 94 92 * signature or hash check before using libfdt. 95 93 * 96 94 * For situations where security is not a concern it may be safe to enable 97 - * ASSUME_SANE. 95 + * ASSUME_PERFECT. 98 96 */ 99 97 enum { 100 98 /*
+271 -40
scripts/dtc/livetree.c
··· 340 340 char *name, const void *data, int len, 341 341 enum markertype type) 342 342 { 343 - struct data d; 343 + struct property *p; 344 + 345 + p = get_property(node, name); 346 + if (!p) { 347 + p = build_property(name, empty_data, NULL); 348 + add_property(node, p); 349 + } 350 + 351 + p->val = data_add_marker(p->val, type, name); 352 + p->val = data_append_data(p->val, data, len); 353 + } 354 + 355 + static int append_unique_str_to_property(struct node *node, 356 + char *name, const char *data, int len) 357 + { 344 358 struct property *p; 345 359 346 360 p = get_property(node, name); 347 361 if (p) { 348 - d = data_add_marker(p->val, type, name); 349 - d = data_append_data(d, data, len); 350 - p->val = d; 362 + const char *s; 363 + 364 + if (p->val.len && p->val.val[p->val.len - 1] != '\0') 365 + /* The current content doesn't look like a string */ 366 + return -1; 367 + 368 + for (s = p->val.val; s < p->val.val + p->val.len; s = strchr(s, '\0') + 1) { 369 + if (strcmp(data, s) == 0) 370 + /* data already contained in node.name */ 371 + return 0; 372 + } 351 373 } else { 352 - d = data_add_marker(empty_data, type, name); 353 - d = data_append_data(d, data, len); 354 - p = build_property(name, d, NULL); 374 + p = build_property(name, empty_data, NULL); 355 375 add_property(node, p); 356 376 } 377 + 378 + p->val = data_add_marker(p->val, TYPE_STRING, name); 379 + p->val = data_append_data(p->val, data, len); 380 + 381 + return 0; 382 + } 383 + 384 + static int append_unique_u32_to_property(struct node *node, char *name, fdt32_t value) 385 + { 386 + struct property *p; 387 + 388 + p = get_property(node, name); 389 + if (p) { 390 + const fdt32_t *v, *val_end = (const fdt32_t *)p->val.val + p->val.len / 4; 391 + 392 + if (p->val.len % 4 != 0) 393 + /* The current content doesn't look like a u32 array */ 394 + return -1; 395 + 396 + for (v = (const void *)p->val.val; v < val_end; v++) { 397 + if (*v == value) 398 + /* value already contained */ 399 + return 0; 400 + } 401 + } else { 402 + p = build_property(name, empty_data, NULL); 403 + add_property(node, p); 404 + } 405 + 406 + p->val = data_add_marker(p->val, TYPE_UINT32, name); 407 + p->val = data_append_data(p->val, &value, 4); 408 + 409 + return 0; 357 410 } 358 411 359 412 struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size) ··· 971 918 return false; 972 919 } 973 920 974 - static void add_fixup_entry(struct dt_info *dti, struct node *fn, 975 - struct node *node, struct property *prop, 976 - struct marker *m) 921 + static int add_fixup_entry(struct dt_info *dti, struct node *fn, 922 + struct node *node, struct property *prop, 923 + struct marker *m) 977 924 { 978 925 char *entry; 926 + int ret; 979 927 980 928 /* m->ref can only be a REF_PHANDLE, but check anyway */ 981 929 assert(m->type == REF_PHANDLE); ··· 993 939 994 940 xasprintf(&entry, "%s:%s:%u", 995 941 node->fullpath, prop->name, m->offset); 996 - append_to_property(fn, m->ref, entry, strlen(entry) + 1, TYPE_STRING); 942 + ret = append_unique_str_to_property(fn, m->ref, entry, strlen(entry) + 1); 997 943 998 944 free(entry); 945 + 946 + return ret; 999 947 } 1000 948 1001 - static void generate_fixups_tree_internal(struct dt_info *dti, 1002 - struct node *fn, 1003 - struct node *node) 949 + static int generate_fixups_tree_internal(struct dt_info *dti, 950 + struct node *fn, 951 + struct node *node) 1004 952 { 1005 953 struct node *dt = dti->dt; 1006 954 struct node *c; 1007 955 struct property *prop; 1008 956 struct marker *m; 1009 957 struct node *refnode; 958 + int ret = 0; 1010 959 1011 960 for_each_property(node, prop) { 1012 961 m = prop->val.markers; 1013 962 for_each_marker_of_type(m, REF_PHANDLE) { 1014 963 refnode = get_node_by_ref(dt, m->ref); 1015 964 if (!refnode) 1016 - add_fixup_entry(dti, fn, node, prop, m); 965 + if (add_fixup_entry(dti, fn, node, prop, m)) 966 + ret = -1; 1017 967 } 1018 968 } 1019 969 1020 970 for_each_child(node, c) 1021 - generate_fixups_tree_internal(dti, fn, c); 971 + if (generate_fixups_tree_internal(dti, fn, c)) 972 + ret = -1; 973 + 974 + return ret; 1022 975 } 1023 976 1024 977 static bool any_local_fixup_tree(struct dt_info *dti, struct node *node) ··· 1050 989 return false; 1051 990 } 1052 991 1053 - static void add_local_fixup_entry(struct dt_info *dti, 992 + static int add_local_fixup_entry(struct dt_info *dti, 1054 993 struct node *lfn, struct node *node, 1055 994 struct property *prop, struct marker *m, 1056 995 struct node *refnode) ··· 1081 1020 free(compp); 1082 1021 1083 1022 value_32 = cpu_to_fdt32(m->offset); 1084 - append_to_property(wn, prop->name, &value_32, sizeof(value_32), TYPE_UINT32); 1023 + return append_unique_u32_to_property(wn, prop->name, value_32); 1085 1024 } 1086 1025 1087 - static void generate_local_fixups_tree_internal(struct dt_info *dti, 1088 - struct node *lfn, 1089 - struct node *node) 1026 + static int generate_local_fixups_tree_internal(struct dt_info *dti, 1027 + struct node *lfn, 1028 + struct node *node) 1090 1029 { 1091 1030 struct node *dt = dti->dt; 1092 1031 struct node *c; 1093 1032 struct property *prop; 1094 1033 struct marker *m; 1095 1034 struct node *refnode; 1035 + int ret = 0; 1096 1036 1097 1037 for_each_property(node, prop) { 1098 1038 m = prop->val.markers; 1099 1039 for_each_marker_of_type(m, REF_PHANDLE) { 1100 1040 refnode = get_node_by_ref(dt, m->ref); 1101 1041 if (refnode) 1102 - add_local_fixup_entry(dti, lfn, node, prop, m, refnode); 1042 + if (add_local_fixup_entry(dti, lfn, node, prop, m, refnode)) 1043 + ret = -1; 1103 1044 } 1104 1045 } 1105 1046 1106 1047 for_each_child(node, c) 1107 - generate_local_fixups_tree_internal(dti, lfn, c); 1048 + if (generate_local_fixups_tree_internal(dti, lfn, c)) 1049 + ret = -1; 1050 + 1051 + return ret; 1052 + } 1053 + 1054 + void generate_labels_from_tree(struct dt_info *dti, const char *name) 1055 + { 1056 + struct node *an; 1057 + struct property *p; 1058 + 1059 + an = get_subnode(dti->dt, name); 1060 + if (!an) 1061 + return; 1062 + 1063 + for_each_property(an, p) { 1064 + struct node *labeled_node; 1065 + 1066 + labeled_node = get_node_by_path(dti->dt, p->val.val); 1067 + if (labeled_node) 1068 + add_label(&labeled_node->labels, p->name); 1069 + else if (quiet < 1) 1070 + fprintf(stderr, "Warning: Path %s referenced in property %s/%s missing", 1071 + p->val.val, name, p->name); 1072 + } 1108 1073 } 1109 1074 1110 1075 void generate_label_tree(struct dt_info *dti, const char *name, bool allocph) ··· 1143 1056 1144 1057 void generate_fixups_tree(struct dt_info *dti, const char *name) 1145 1058 { 1146 - struct node *n = get_subnode(dti->dt, name); 1147 - 1148 - /* Start with an empty __fixups__ node to not get duplicates */ 1149 - if (n) 1150 - n->deleted = true; 1151 - 1152 1059 if (!any_fixup_tree(dti, dti->dt)) 1153 1060 return; 1154 - generate_fixups_tree_internal(dti, 1155 - build_and_name_child_node(dti->dt, name), 1156 - dti->dt); 1061 + if (generate_fixups_tree_internal(dti, build_root_node(dti->dt, name), dti->dt)) 1062 + fprintf(stderr, 1063 + "Warning: Preexisting data in %s malformed, some content could not be added.\n", 1064 + name); 1065 + } 1066 + 1067 + void fixup_phandles(struct dt_info *dti, const char *name) 1068 + { 1069 + struct node *an; 1070 + struct property *fp; 1071 + 1072 + an = get_subnode(dti->dt, name); 1073 + if (!an) 1074 + return; 1075 + 1076 + for_each_property(an, fp) { 1077 + char *fnext = fp->val.val; 1078 + char *fv; 1079 + unsigned int fl; 1080 + 1081 + while ((fl = fp->val.len - (fnext - fp->val.val))) { 1082 + char *propname, *soffset; 1083 + struct node *n; 1084 + struct property *p; 1085 + long offset; 1086 + 1087 + fv = fnext; 1088 + fnext = memchr(fv, 0, fl); 1089 + 1090 + if (!fnext) { 1091 + if (quiet < 1) 1092 + fprintf(stderr, "Warning: Malformed fixup entry for label %s\n", 1093 + fp->name); 1094 + break; 1095 + } 1096 + fnext += 1; 1097 + 1098 + propname = memchr(fv, ':', fnext - 1 - fv); 1099 + if (!propname) { 1100 + if (quiet < 1) 1101 + fprintf(stderr, "Warning: Malformed fixup entry for label %s\n", 1102 + fp->name); 1103 + continue; 1104 + } 1105 + propname++; 1106 + 1107 + soffset = memchr(propname, ':', fnext - 1 - propname); 1108 + if (!soffset) { 1109 + if (quiet < 1) 1110 + fprintf(stderr, "Warning: Malformed fixup entry for label %s\n", 1111 + fp->name); 1112 + continue; 1113 + } 1114 + soffset++; 1115 + 1116 + /* 1117 + * temporarily modify the property to not have to create 1118 + * a copy for the node path. 1119 + */ 1120 + *(propname - 1) = '\0'; 1121 + 1122 + n = get_node_by_path(dti->dt, fv); 1123 + if (!n && quiet < 1) 1124 + fprintf(stderr, "Warning: Label %s references non-existing node %s\n", 1125 + fp->name, fv); 1126 + 1127 + *(propname - 1) = ':'; 1128 + 1129 + if (!n) 1130 + continue; 1131 + 1132 + /* 1133 + * temporarily modify the property to not have to create 1134 + * a copy for the property name. 1135 + */ 1136 + *(soffset - 1) = '\0'; 1137 + 1138 + p = get_property(n, propname); 1139 + 1140 + if (!p && quiet < 1) 1141 + fprintf(stderr, "Warning: Label %s references non-existing property %s in node %s\n", 1142 + fp->name, n->fullpath, propname); 1143 + 1144 + *(soffset - 1) = ':'; 1145 + 1146 + if (!p) 1147 + continue; 1148 + 1149 + offset = strtol(soffset, NULL, 0); 1150 + if (offset < 0 || offset + 4 > p->val.len) { 1151 + if (quiet < 1) 1152 + fprintf(stderr, 1153 + "Warning: Label %s contains invalid offset for property %s in node %s\n", 1154 + fp->name, p->name, n->fullpath); 1155 + continue; 1156 + } 1157 + 1158 + property_add_marker(p, REF_PHANDLE, offset, fp->name); 1159 + } 1160 + } 1157 1161 } 1158 1162 1159 1163 void generate_local_fixups_tree(struct dt_info *dti, const char *name) 1160 1164 { 1161 - struct node *n = get_subnode(dti->dt, name); 1162 - 1163 - /* Start with an empty __local_fixups__ node to not get duplicates */ 1164 - if (n) 1165 - n->deleted = true; 1166 1165 if (!any_local_fixup_tree(dti, dti->dt)) 1167 1166 return; 1168 - generate_local_fixups_tree_internal(dti, 1169 - build_and_name_child_node(dti->dt, name), 1170 - dti->dt); 1167 + if (generate_local_fixups_tree_internal(dti, build_root_node(dti->dt, name), dti->dt)) 1168 + fprintf(stderr, 1169 + "Warning: Preexisting data in %s malformed, some content could not be added.\n", 1170 + name); 1171 + } 1172 + 1173 + static void local_fixup_phandles_node(struct dt_info *dti, struct node *lf, struct node *n) 1174 + { 1175 + struct property *lfp; 1176 + struct node *lfsubnode; 1177 + 1178 + for_each_property(lf, lfp) { 1179 + struct property *p = get_property(n, lfp->name); 1180 + fdt32_t *offsets = (fdt32_t *)lfp->val.val; 1181 + size_t i; 1182 + 1183 + if (!p) { 1184 + if (quiet < 1) 1185 + fprintf(stderr, "Warning: Property %s in %s referenced in __local_fixups__ missing\n", 1186 + lfp->name, n->fullpath); 1187 + continue; 1188 + } 1189 + 1190 + /* 1191 + * Each property in the __local_fixups__ tree is a concatenation 1192 + * of offsets, so it must be a multiple of sizeof(fdt32_t). 1193 + */ 1194 + if (lfp->val.len % sizeof(fdt32_t)) { 1195 + if (quiet < 1) 1196 + fprintf(stderr, "Warning: property %s in /__local_fixups__%s malformed\n", 1197 + lfp->name, n->fullpath); 1198 + continue; 1199 + } 1200 + 1201 + for (i = 0; i < lfp->val.len / sizeof(fdt32_t); i++) 1202 + add_phandle_marker(dti, p, dtb_ld32(offsets + i)); 1203 + } 1204 + 1205 + for_each_child(lf, lfsubnode) { 1206 + struct node *subnode = get_subnode(n, lfsubnode->name); 1207 + 1208 + if (!subnode) { 1209 + if (quiet < 1) 1210 + fprintf(stderr, "Warning: node %s/%s referenced in __local_fixups__ missing\n", 1211 + lfsubnode->name, n->fullpath); 1212 + continue; 1213 + } 1214 + 1215 + local_fixup_phandles_node(dti, lfsubnode, subnode); 1216 + } 1217 + } 1218 + 1219 + void local_fixup_phandles(struct dt_info *dti, const char *name) 1220 + { 1221 + struct node *an; 1222 + 1223 + an = get_subnode(dti->dt, name); 1224 + if (!an) 1225 + return; 1226 + 1227 + local_fixup_phandles_node(dti, an, dti->dt); 1171 1228 }
+21 -1
scripts/dtc/srcpos.c
··· 89 89 } 90 90 91 91 /** 92 + * Returns true if the given path is an absolute one. 93 + * 94 + * On Windows, it either needs to begin with a forward slash or with a drive 95 + * letter (e.g. "C:"). 96 + * On all other operating systems, it must begin with a forward slash to be 97 + * considered an absolute path. 98 + */ 99 + static bool is_absolute_path(const char *path) 100 + { 101 + #ifdef WIN32 102 + return ( 103 + path[0] == '/' || 104 + (((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':') 105 + ); 106 + #else 107 + return (path[0] == '/'); 108 + #endif 109 + } 110 + 111 + /** 92 112 * Try to open a file in a given directory. 93 113 * 94 114 * If the filename is an absolute path, then dirname is ignored. If it is a ··· 123 103 { 124 104 char *fullname; 125 105 126 - if (!dirname || fname[0] == '/') 106 + if (!dirname || is_absolute_path(fname)) 127 107 fullname = xstrdup(fname); 128 108 else 129 109 fullname = join_path(dirname, fname);
+83 -31
scripts/dtc/treesource.c
··· 173 173 return &nm->next; 174 174 } 175 175 176 - static void add_string_markers(struct property *prop) 176 + void property_add_marker(struct property *prop, 177 + enum markertype type, unsigned int offset, char *ref) 177 178 { 178 - int l, len = prop->val.len; 179 - const char *p = prop->val.val; 179 + add_marker(&prop->val.markers, type, offset, ref); 180 + } 181 + 182 + static void add_string_markers(struct property *prop, unsigned int offset, int len) 183 + { 184 + int l; 185 + const char *p = prop->val.val + offset; 180 186 struct marker **mi = &prop->val.markers; 181 187 182 188 for (l = strlen(p) + 1; l < len; l += strlen(p + l) + 1) 183 - mi = add_marker(mi, TYPE_STRING, l, NULL); 189 + mi = add_marker(mi, TYPE_STRING, offset + l, NULL); 184 190 } 185 191 186 - static enum markertype guess_value_type(struct property *prop) 192 + void add_phandle_marker(struct dt_info *dti, struct property *prop, unsigned int offset) 187 193 { 188 - int len = prop->val.len; 189 - const char *p = prop->val.val; 190 - struct marker *m = prop->val.markers; 194 + cell_t phandle; 195 + struct node *refn; 196 + char *ref; 197 + 198 + if (prop->val.len < offset + 4) { 199 + if (quiet < 1) 200 + fprintf(stderr, 201 + "Warning: property %s too short to contain a phandle at offset %u\n", 202 + prop->name, offset); 203 + return; 204 + } 205 + 206 + phandle = dtb_ld32(prop->val.val + offset); 207 + refn = get_node_by_phandle(dti->dt, phandle); 208 + 209 + if (!refn) { 210 + if (quiet < 1) 211 + fprintf(stderr, 212 + "Warning: node referenced by phandle 0x%x in property %s not found\n", 213 + phandle, prop->name); 214 + return; 215 + } 216 + 217 + if (refn->labels) 218 + ref = refn->labels->label; 219 + else 220 + ref = refn->fullpath; 221 + 222 + add_marker(&prop->val.markers, REF_PHANDLE, offset, ref); 223 + } 224 + 225 + static enum markertype guess_value_type(struct property *prop, unsigned int offset, int len) 226 + { 227 + const char *p = prop->val.val + offset; 191 228 int nnotstring = 0, nnul = 0; 192 - int nnotstringlbl = 0, nnotcelllbl = 0; 193 229 int i; 194 230 195 231 for (i = 0; i < len; i++) { ··· 235 199 nnul++; 236 200 } 237 201 238 - for_each_marker_of_type(m, LABEL) { 239 - if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0')) 240 - nnotstringlbl++; 241 - if ((m->offset % sizeof(cell_t)) != 0) 242 - nnotcelllbl++; 243 - } 244 - 245 - if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= (len-nnul)) 246 - && (nnotstringlbl == 0)) { 202 + if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul <= len - nnul)) { 247 203 if (nnul > 1) 248 - add_string_markers(prop); 204 + add_string_markers(prop, offset, len); 249 205 return TYPE_STRING; 250 - } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) { 206 + } else if ((len % sizeof(cell_t)) == 0) { 251 207 return TYPE_UINT32; 252 208 } 253 209 254 210 return TYPE_UINT8; 255 211 } 256 212 213 + static void guess_type_markers(struct property *prop) 214 + { 215 + struct marker **m = &prop->val.markers; 216 + unsigned int offset = 0; 217 + 218 + for (m = &prop->val.markers; *m; m = &((*m)->next)) { 219 + if (is_type_marker((*m)->type)) 220 + /* assume the whole property is already marked */ 221 + return; 222 + 223 + if ((*m)->offset > offset) { 224 + m = add_marker(m, guess_value_type(prop, offset, (*m)->offset - offset), 225 + offset, NULL); 226 + 227 + offset = (*m)->offset; 228 + } 229 + 230 + if ((*m)->type == REF_PHANDLE) { 231 + m = add_marker(m, TYPE_UINT32, offset, NULL); 232 + offset += 4; 233 + } 234 + } 235 + 236 + if (offset < prop->val.len) 237 + add_marker(m, guess_value_type(prop, offset, prop->val.len - offset), 238 + offset, NULL); 239 + } 240 + 257 241 static void write_propval(FILE *f, struct property *prop) 258 242 { 259 243 size_t len = prop->val.len; 260 - struct marker *m = prop->val.markers; 261 - struct marker dummy_marker; 244 + struct marker *m; 262 245 enum markertype emit_type = TYPE_NONE; 263 246 char *srcstr; 264 247 ··· 296 241 297 242 fprintf(f, " ="); 298 243 299 - if (!next_type_marker(m)) { 300 - /* data type information missing, need to guess */ 301 - dummy_marker.type = guess_value_type(prop); 302 - dummy_marker.next = prop->val.markers; 303 - dummy_marker.offset = 0; 304 - dummy_marker.ref = NULL; 305 - m = &dummy_marker; 306 - } 244 + guess_type_markers(prop); 245 + m = prop->val.markers; 307 246 308 247 for_each_marker(m) { 309 248 size_t chunk_len = (m->next ? m->next->offset : len) - m->offset; ··· 418 369 { 419 370 struct reserve_info *re; 420 371 421 - fprintf(f, "/dts-v1/;\n\n"); 372 + fprintf(f, "/dts-v1/;\n"); 373 + if (dti->dtsflags & DTSF_PLUGIN) 374 + fprintf(f, "/plugin/;\n"); 375 + fprintf(f, "\n"); 422 376 423 377 for (re = dti->reservelist; re; re = re->next) { 424 378 struct label *l;
+1 -1
scripts/dtc/version_gen.h
··· 1 - #define DTC_VERSION "DTC 1.7.2-g52f07dcc" 1 + #define DTC_VERSION "DTC 1.7.2-ga26ef640"