aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 17:06:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 17:06:31 -0400
commit289cf155d95df07ac1e692dfaa7036f10235c77c (patch)
tree3e53ec4a1e494a9c47891784f328a4e7641a68e4
parent7423fd7a6693e8c1cef6d5033ce3f9b731dbac94 (diff)
parent44acf10587907ff77c28fd97906220b2d8eb4f05 (diff)
Merge tag 'devicetree-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree updates from Rob Herring: - Sync dtc with upstream version v1.4.6-21-g84e414b0b5bc. This adds new warnings which are either fixed or disabled by default (enabled with W=1). - Validate an untrusted offset in DT overlay function update_usages_of_a_phandle_reference - Fix a use after free error of_platform_device_destroy - Fix an off by 1 string errors in unittest - Avoid creating a struct device for OPP nodes - Update DT specific submitting-patches.txt with patch content and subject requirements. - Move some bindings to their proper subsystem locations - Add vendor prefixes for Kaohsiung, SiFive, Avnet, Wi2Wi, Logic PD, and ArcherMind - Add documentation for "no-gpio-delays" property in FSI bus GPIO master - Add compatible for r8a77990 SoC ravb ethernet block - More wack-a-mole removal of 'status' property in examples * tag 'devicetree-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (25 commits) dt-bindings: submitting-patches: add guidance on patch content and subject of: platform: stop accessing invalid dev in of_platform_device_destroy dt-bindings: net: ravb: Add support for r8a77990 SoC dt-bindings: Add vendor prefix for ArcherMind dt-bindings: fsi-master-gpio: Document "no-gpio-delays" property dt-bindings: Add vendor prefix for Logic PD of: overlay: validate offset from property fixups of: unittest: for strings, account for trailing \0 in property length field drm: rcar-du: disable dtc graph-endpoint warnings on DT overlays kbuild: disable new dtc graph and unit-address warnings scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc MAINTAINERS: add keyword for devicetree overlay notifiers dt-bindings: define vendor prefix for Wi2Wi, Inc. dt-bindings: Add vendor prefix for Avnet, Inc. dt-bindings: Relocate Tegra20 memory controller bindings dt-bindings: Add "sifive" vendor prefix dt-bindings: exynos: move ADC binding to iio/adc/ directory dt-bindings: powerpc/4xx: move 4xx NDFC and EMAC bindings to subsystem directories dt-bindings: move various RNG bindings to rng/ directory dt-bindings: move various timer bindings to timer/ directory ...
-rw-r--r--Documentation/devicetree/bindings/arm/ux500/boards.txt2
-rw-r--r--Documentation/devicetree/bindings/dma/k3dma.txt1
-rw-r--r--Documentation/devicetree/bindings/dma/ti-edma.txt1
-rw-r--r--Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt4
-rw-r--r--Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt (renamed from Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt)0
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt (renamed from Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-mc.txt)0
-rw-r--r--Documentation/devicetree/bindings/mips/lantiq/rcu.txt2
-rw-r--r--Documentation/devicetree/bindings/mmc/tmio_mmc.txt4
-rw-r--r--Documentation/devicetree/bindings/mtd/ibm,ndfc.txt (renamed from Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt)0
-rw-r--r--Documentation/devicetree/bindings/mtd/mtk-nand.txt4
-rw-r--r--Documentation/devicetree/bindings/net/ibm,emac.txt (renamed from Documentation/devicetree/bindings/powerpc/4xx/emac.txt)0
-rw-r--r--Documentation/devicetree/bindings/net/renesas,ravb.txt1
-rw-r--r--Documentation/devicetree/bindings/pci/xgene-pci.txt7
-rw-r--r--Documentation/devicetree/bindings/pps/pps-gpio.txt1
-rw-r--r--Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt2
-rw-r--r--Documentation/devicetree/bindings/rng/samsung,exynos4-rng.txt (renamed from Documentation/devicetree/bindings/crypto/samsung,exynos-rng4.txt)0
-rw-r--r--Documentation/devicetree/bindings/rng/sparc_sun_oracle_rng.txt (renamed from Documentation/devicetree/bindings/sparc_sun_oracle_rng.txt)0
-rw-r--r--Documentation/devicetree/bindings/submitting-patches.txt9
-rw-r--r--Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt6
-rw-r--r--Documentation/devicetree/bindings/timer/altr,timer-1.0.txt (renamed from Documentation/devicetree/bindings/nios2/timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/arm,arch_timer.txt (renamed from Documentation/devicetree/bindings/arm/arch_timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/arm,armv7m-systick.txt (renamed from Documentation/devicetree/bindings/arm/armv7m_systick.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/arm,global_timer.txt (renamed from Documentation/devicetree/bindings/arm/global_timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/arm,twd.txt (renamed from Documentation/devicetree/bindings/arm/twd.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/fsl,gtm.txt (renamed from Documentation/devicetree/bindings/powerpc/fsl/gtm.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt (renamed from Documentation/devicetree/bindings/arm/mrvl/timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/qcom,msm-timer.txt (renamed from Documentation/devicetree/bindings/arm/msm/timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/st,spear-timer.txt (renamed from Documentation/devicetree/bindings/arm/spear-timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/ti,c64x+timer64.txt (renamed from Documentation/devicetree/bindings/c6x/timer64.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/ti,timer.txt (renamed from Documentation/devicetree/bindings/arm/omap/timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/timer/via,vt8500-timer.txt (renamed from Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt)0
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt6
-rw-r--r--MAINTAINERS2
-rw-r--r--drivers/gpu/drm/rcar-du/Makefile7
-rw-r--r--drivers/of/of_numa.c1
-rw-r--r--drivers/of/platform.c16
-rw-r--r--drivers/of/resolver.c5
-rw-r--r--drivers/of/unittest.c8
-rw-r--r--scripts/Makefile.lib3
-rw-r--r--scripts/dtc/checks.c199
-rw-r--r--scripts/dtc/dtc-lexer.l7
-rw-r--r--scripts/dtc/dtc-parser.y39
-rw-r--r--scripts/dtc/dtc.h4
-rw-r--r--scripts/dtc/livetree.c26
-rw-r--r--scripts/dtc/version_gen.h2
45 files changed, 320 insertions, 49 deletions
diff --git a/Documentation/devicetree/bindings/arm/ux500/boards.txt b/Documentation/devicetree/bindings/arm/ux500/boards.txt
index 7334c24625fc..0fa429534f49 100644
--- a/Documentation/devicetree/bindings/arm/ux500/boards.txt
+++ b/Documentation/devicetree/bindings/arm/ux500/boards.txt
@@ -26,7 +26,7 @@ interrupt-controller:
26 see binding for interrupt-controller/arm,gic.txt 26 see binding for interrupt-controller/arm,gic.txt
27 27
28timer: 28timer:
29 see binding for arm/twd.txt 29 see binding for timer/arm,twd.txt
30 30
31clocks: 31clocks:
32 see binding for clocks/ux500.txt 32 see binding for clocks/ux500.txt
diff --git a/Documentation/devicetree/bindings/dma/k3dma.txt b/Documentation/devicetree/bindings/dma/k3dma.txt
index 23f8d712c3ce..4945aeac4dc4 100644
--- a/Documentation/devicetree/bindings/dma/k3dma.txt
+++ b/Documentation/devicetree/bindings/dma/k3dma.txt
@@ -23,7 +23,6 @@ Controller:
23 dma-requests = <27>; 23 dma-requests = <27>;
24 interrupts = <0 12 4>; 24 interrupts = <0 12 4>;
25 clocks = <&pclk>; 25 clocks = <&pclk>;
26 status = "disable";
27 }; 26 };
28 27
29Client: 28Client:
diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt b/Documentation/devicetree/bindings/dma/ti-edma.txt
index 66026dcf53e1..3f15f6644527 100644
--- a/Documentation/devicetree/bindings/dma/ti-edma.txt
+++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
@@ -190,7 +190,6 @@ mmc0: mmc@23000000 {
190 power-domains = <&k2g_pds 0xb>; 190 power-domains = <&k2g_pds 0xb>;
191 clocks = <&k2g_clks 0xb 1>, <&k2g_clks 0xb 2>; 191 clocks = <&k2g_clks 0xb 1>, <&k2g_clks 0xb 2>;
192 clock-names = "fck", "mmchsdb_fck"; 192 clock-names = "fck", "mmchsdb_fck";
193 status = "disabled";
194}; 193};
195 194
196------------------------------------------------------------------------------ 195------------------------------------------------------------------------------
diff --git a/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt b/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt
index a767259dedad..1e442450747f 100644
--- a/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt
+++ b/Documentation/devicetree/bindings/fsi/fsi-master-gpio.txt
@@ -11,6 +11,10 @@ Optional properties:
11 - trans-gpios = <gpio-descriptor>; : GPIO for voltage translator enable 11 - trans-gpios = <gpio-descriptor>; : GPIO for voltage translator enable
12 - mux-gpios = <gpio-descriptor>; : GPIO for pin multiplexing with other 12 - mux-gpios = <gpio-descriptor>; : GPIO for pin multiplexing with other
13 functions (eg, external FSI masters) 13 functions (eg, external FSI masters)
14 - no-gpio-delays; : Don't add extra delays between GPIO
15 accesses. This is useful when the HW
16 GPIO block is running at a low enough
17 frequency.
14 18
15Examples: 19Examples:
16 20
diff --git a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
index 6c49db7f8ad2..6c49db7f8ad2 100644
--- a/Documentation/devicetree/bindings/arm/samsung/exynos-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/samsung,exynos-adc.txt
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-mc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt
index f9632bacbd04..f9632bacbd04 100644
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-mc.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt
diff --git a/Documentation/devicetree/bindings/mips/lantiq/rcu.txt b/Documentation/devicetree/bindings/mips/lantiq/rcu.txt
index a086f1e1cdd7..7f0822b4beae 100644
--- a/Documentation/devicetree/bindings/mips/lantiq/rcu.txt
+++ b/Documentation/devicetree/bindings/mips/lantiq/rcu.txt
@@ -61,7 +61,6 @@ Example of the RCU bindings on a xRX200 SoC:
61 usb_phy0: usb2-phy@18 { 61 usb_phy0: usb2-phy@18 {
62 compatible = "lantiq,xrx200-usb2-phy"; 62 compatible = "lantiq,xrx200-usb2-phy";
63 reg = <0x18 4>, <0x38 4>; 63 reg = <0x18 4>, <0x38 4>;
64 status = "disabled";
65 64
66 resets = <&reset1 4 4>, <&reset0 4 4>; 65 resets = <&reset1 4 4>, <&reset0 4 4>;
67 reset-names = "phy", "ctrl"; 66 reset-names = "phy", "ctrl";
@@ -71,7 +70,6 @@ Example of the RCU bindings on a xRX200 SoC:
71 usb_phy1: usb2-phy@34 { 70 usb_phy1: usb2-phy@34 {
72 compatible = "lantiq,xrx200-usb2-phy"; 71 compatible = "lantiq,xrx200-usb2-phy";
73 reg = <0x34 4>, <0x3C 4>; 72 reg = <0x34 4>, <0x3C 4>;
74 status = "disabled";
75 73
76 resets = <&reset1 5 4>, <&reset0 4 4>; 74 resets = <&reset1 5 4>, <&reset0 4 4>;
77 reset-names = "phy", "ctrl"; 75 reset-names = "phy", "ctrl";
diff --git a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
index ee978c95189d..839f469f4525 100644
--- a/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/tmio_mmc.txt
@@ -69,7 +69,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
69 max-frequency = <195000000>; 69 max-frequency = <195000000>;
70 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 70 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
71 resets = <&cpg 314>; 71 resets = <&cpg 314>;
72 status = "disabled";
73 }; 72 };
74 73
75 sdhi1: sd@ee120000 { 74 sdhi1: sd@ee120000 {
@@ -83,7 +82,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
83 max-frequency = <195000000>; 82 max-frequency = <195000000>;
84 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 83 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
85 resets = <&cpg 313>; 84 resets = <&cpg 313>;
86 status = "disabled";
87 }; 85 };
88 86
89 sdhi2: sd@ee140000 { 87 sdhi2: sd@ee140000 {
@@ -97,7 +95,6 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
97 max-frequency = <97500000>; 95 max-frequency = <97500000>;
98 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 96 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
99 resets = <&cpg 312>; 97 resets = <&cpg 312>;
100 status = "disabled";
101 }; 98 };
102 99
103 sdhi3: sd@ee160000 { 100 sdhi3: sd@ee160000 {
@@ -111,5 +108,4 @@ Example: R8A7790 (R-Car H2) SDHI controller nodes
111 max-frequency = <97500000>; 108 max-frequency = <97500000>;
112 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>; 109 power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
113 resets = <&cpg 311>; 110 resets = <&cpg 311>;
114 status = "disabled";
115 }; 111 };
diff --git a/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt b/Documentation/devicetree/bindings/mtd/ibm,ndfc.txt
index 869f0b5f16e8..869f0b5f16e8 100644
--- a/Documentation/devicetree/bindings/powerpc/4xx/ndfc.txt
+++ b/Documentation/devicetree/bindings/mtd/ibm,ndfc.txt
diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
index 1c88526dedfc..c5ba6a4ba1f2 100644
--- a/Documentation/devicetree/bindings/mtd/mtk-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
@@ -20,7 +20,6 @@ Required NFI properties:
20- interrupts: Interrupts of NFI. 20- interrupts: Interrupts of NFI.
21- clocks: NFI required clocks. 21- clocks: NFI required clocks.
22- clock-names: NFI clocks internal name. 22- clock-names: NFI clocks internal name.
23- status: Disabled default. Then set "okay" by platform.
24- ecc-engine: Required ECC Engine node. 23- ecc-engine: Required ECC Engine node.
25- #address-cells: NAND chip index, should be 1. 24- #address-cells: NAND chip index, should be 1.
26- #size-cells: Should be 0. 25- #size-cells: Should be 0.
@@ -34,7 +33,6 @@ Example:
34 clocks = <&pericfg CLK_PERI_NFI>, 33 clocks = <&pericfg CLK_PERI_NFI>,
35 <&pericfg CLK_PERI_NFI_PAD>; 34 <&pericfg CLK_PERI_NFI_PAD>;
36 clock-names = "nfi_clk", "pad_clk"; 35 clock-names = "nfi_clk", "pad_clk";
37 status = "disabled";
38 ecc-engine = <&bch>; 36 ecc-engine = <&bch>;
39 #address-cells = <1>; 37 #address-cells = <1>;
40 #size-cells = <0>; 38 #size-cells = <0>;
@@ -152,7 +150,6 @@ Required BCH properties:
152- interrupts: Interrupts of ECC. 150- interrupts: Interrupts of ECC.
153- clocks: ECC required clocks. 151- clocks: ECC required clocks.
154- clock-names: ECC clocks internal name. 152- clock-names: ECC clocks internal name.
155- status: Disabled default. Then set "okay" by platform.
156 153
157Example: 154Example:
158 155
@@ -162,5 +159,4 @@ Example:
162 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>; 159 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
163 clocks = <&pericfg CLK_PERI_NFI_ECC>; 160 clocks = <&pericfg CLK_PERI_NFI_ECC>;
164 clock-names = "nfiecc_clk"; 161 clock-names = "nfiecc_clk";
165 status = "disabled";
166 }; 162 };
diff --git a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt b/Documentation/devicetree/bindings/net/ibm,emac.txt
index 44b842b6ca15..44b842b6ca15 100644
--- a/Documentation/devicetree/bindings/powerpc/4xx/emac.txt
+++ b/Documentation/devicetree/bindings/net/ibm,emac.txt
diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt
index 890526dbfc26..fac897d54423 100644
--- a/Documentation/devicetree/bindings/net/renesas,ravb.txt
+++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt
@@ -21,6 +21,7 @@ Required properties:
21 - "renesas,etheravb-r8a77965" for the R8A77965 SoC. 21 - "renesas,etheravb-r8a77965" for the R8A77965 SoC.
22 - "renesas,etheravb-r8a77970" for the R8A77970 SoC. 22 - "renesas,etheravb-r8a77970" for the R8A77970 SoC.
23 - "renesas,etheravb-r8a77980" for the R8A77980 SoC. 23 - "renesas,etheravb-r8a77980" for the R8A77980 SoC.
24 - "renesas,etheravb-r8a77990" for the R8A77990 SoC.
24 - "renesas,etheravb-r8a77995" for the R8A77995 SoC. 25 - "renesas,etheravb-r8a77995" for the R8A77995 SoC.
25 - "renesas,etheravb-rcar-gen3" as a fallback for the above 26 - "renesas,etheravb-rcar-gen3" as a fallback for the above
26 R-Car Gen3 devices. 27 R-Car Gen3 devices.
diff --git a/Documentation/devicetree/bindings/pci/xgene-pci.txt b/Documentation/devicetree/bindings/pci/xgene-pci.txt
index 6fd2decfa66c..92490330dc1c 100644
--- a/Documentation/devicetree/bindings/pci/xgene-pci.txt
+++ b/Documentation/devicetree/bindings/pci/xgene-pci.txt
@@ -25,8 +25,6 @@ Optional properties:
25 25
26Example: 26Example:
27 27
28SoC-specific DT Entry:
29
30 pcie0: pcie@1f2b0000 { 28 pcie0: pcie@1f2b0000 {
31 status = "disabled"; 29 status = "disabled";
32 device_type = "pci"; 30 device_type = "pci";
@@ -50,8 +48,3 @@ SoC-specific DT Entry:
50 clocks = <&pcie0clk 0>; 48 clocks = <&pcie0clk 0>;
51 }; 49 };
52 50
53
54Board-specific DT Entry:
55 &pcie0 {
56 status = "ok";
57 };
diff --git a/Documentation/devicetree/bindings/pps/pps-gpio.txt b/Documentation/devicetree/bindings/pps/pps-gpio.txt
index 0de23b793657..3683874832ae 100644
--- a/Documentation/devicetree/bindings/pps/pps-gpio.txt
+++ b/Documentation/devicetree/bindings/pps/pps-gpio.txt
@@ -20,5 +20,4 @@ Example:
20 assert-falling-edge; 20 assert-falling-edge;
21 21
22 compatible = "pps-gpio"; 22 compatible = "pps-gpio";
23 status = "okay";
24 }; 23 };
diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
index 2e53324fb720..5ccfcc82da08 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
@@ -2,7 +2,7 @@
2 2
3Required properties: 3Required properties:
4- compatible: Shall contain "ti,omap-dmtimer-pwm". 4- compatible: Shall contain "ti,omap-dmtimer-pwm".
5- ti,timers: phandle to PWM capable OMAP timer. See arm/omap/timer.txt for info 5- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer.txt for info
6 about these timers. 6 about these timers.
7- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of 7- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of
8 the cells format. 8 the cells format.
diff --git a/Documentation/devicetree/bindings/crypto/samsung,exynos-rng4.txt b/Documentation/devicetree/bindings/rng/samsung,exynos4-rng.txt
index a13fbdb4bd88..a13fbdb4bd88 100644
--- a/Documentation/devicetree/bindings/crypto/samsung,exynos-rng4.txt
+++ b/Documentation/devicetree/bindings/rng/samsung,exynos4-rng.txt
diff --git a/Documentation/devicetree/bindings/sparc_sun_oracle_rng.txt b/Documentation/devicetree/bindings/rng/sparc_sun_oracle_rng.txt
index b0b211194c71..b0b211194c71 100644
--- a/Documentation/devicetree/bindings/sparc_sun_oracle_rng.txt
+++ b/Documentation/devicetree/bindings/rng/sparc_sun_oracle_rng.txt
diff --git a/Documentation/devicetree/bindings/submitting-patches.txt b/Documentation/devicetree/bindings/submitting-patches.txt
index 274058c583dd..de0d6090c0fd 100644
--- a/Documentation/devicetree/bindings/submitting-patches.txt
+++ b/Documentation/devicetree/bindings/submitting-patches.txt
@@ -6,7 +6,14 @@ I. For patch submitters
6 0) Normal patch submission rules from Documentation/process/submitting-patches.rst 6 0) Normal patch submission rules from Documentation/process/submitting-patches.rst
7 applies. 7 applies.
8 8
9 1) The Documentation/ portion of the patch should be a separate patch. 9 1) The Documentation/ and include/dt-bindings/ portion of the patch should
10 be a separate patch. The preferred subject prefix for binding patches is:
11
12 "dt-bindings: <binding dir>: ..."
13
14 The 80 characters of the subject are precious. It is recommended to not
15 use "Documentation" or "doc" because that is implied. All bindings are
16 docs. Repeating "binding" again should also be avoided.
10 17
11 2) Submit the entire series to the devicetree mailinglist at 18 2) Submit the entire series to the devicetree mailinglist at
12 19
diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
index fdf5caa6229b..39e7d4e61a63 100644
--- a/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/rcar-gen3-thermal.txt
@@ -27,9 +27,9 @@ Example:
27 27
28 tsc: thermal@e6198000 { 28 tsc: thermal@e6198000 {
29 compatible = "renesas,r8a7795-thermal"; 29 compatible = "renesas,r8a7795-thermal";
30 reg = <0 0xe6198000 0 0x68>, 30 reg = <0 0xe6198000 0 0x100>,
31 <0 0xe61a0000 0 0x5c>, 31 <0 0xe61a0000 0 0x100>,
32 <0 0xe61a8000 0 0x5c>; 32 <0 0xe61a8000 0 0x100>;
33 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, 33 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
34 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, 34 <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
35 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>; 35 <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/Documentation/devicetree/bindings/nios2/timer.txt b/Documentation/devicetree/bindings/timer/altr,timer-1.0.txt
index 904a5846d7ac..904a5846d7ac 100644
--- a/Documentation/devicetree/bindings/nios2/timer.txt
+++ b/Documentation/devicetree/bindings/timer/altr,timer-1.0.txt
diff --git a/Documentation/devicetree/bindings/arm/arch_timer.txt b/Documentation/devicetree/bindings/timer/arm,arch_timer.txt
index 68301b77e854..68301b77e854 100644
--- a/Documentation/devicetree/bindings/arm/arch_timer.txt
+++ b/Documentation/devicetree/bindings/timer/arm,arch_timer.txt
diff --git a/Documentation/devicetree/bindings/arm/armv7m_systick.txt b/Documentation/devicetree/bindings/timer/arm,armv7m-systick.txt
index 7cf4a24601eb..7cf4a24601eb 100644
--- a/Documentation/devicetree/bindings/arm/armv7m_systick.txt
+++ b/Documentation/devicetree/bindings/timer/arm,armv7m-systick.txt
diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/timer/arm,global_timer.txt
index bdae3a818793..bdae3a818793 100644
--- a/Documentation/devicetree/bindings/arm/global_timer.txt
+++ b/Documentation/devicetree/bindings/timer/arm,global_timer.txt
diff --git a/Documentation/devicetree/bindings/arm/twd.txt b/Documentation/devicetree/bindings/timer/arm,twd.txt
index 383ea19c2bf0..383ea19c2bf0 100644
--- a/Documentation/devicetree/bindings/arm/twd.txt
+++ b/Documentation/devicetree/bindings/timer/arm,twd.txt
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt b/Documentation/devicetree/bindings/timer/fsl,gtm.txt
index 9a33efded4bc..9a33efded4bc 100644
--- a/Documentation/devicetree/bindings/powerpc/fsl/gtm.txt
+++ b/Documentation/devicetree/bindings/timer/fsl,gtm.txt
diff --git a/Documentation/devicetree/bindings/arm/mrvl/timer.txt b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
index 9a6e251462e7..9a6e251462e7 100644
--- a/Documentation/devicetree/bindings/arm/mrvl/timer.txt
+++ b/Documentation/devicetree/bindings/timer/mrvl,mmp-timer.txt
diff --git a/Documentation/devicetree/bindings/arm/msm/timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
index 5e10c345548f..5e10c345548f 100644
--- a/Documentation/devicetree/bindings/arm/msm/timer.txt
+++ b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
diff --git a/Documentation/devicetree/bindings/arm/spear-timer.txt b/Documentation/devicetree/bindings/timer/st,spear-timer.txt
index c0017221cf55..c0017221cf55 100644
--- a/Documentation/devicetree/bindings/arm/spear-timer.txt
+++ b/Documentation/devicetree/bindings/timer/st,spear-timer.txt
diff --git a/Documentation/devicetree/bindings/c6x/timer64.txt b/Documentation/devicetree/bindings/timer/ti,c64x+timer64.txt
index 95911fe70224..95911fe70224 100644
--- a/Documentation/devicetree/bindings/c6x/timer64.txt
+++ b/Documentation/devicetree/bindings/timer/ti,c64x+timer64.txt
diff --git a/Documentation/devicetree/bindings/arm/omap/timer.txt b/Documentation/devicetree/bindings/timer/ti,timer.txt
index d02e27c764ec..d02e27c764ec 100644
--- a/Documentation/devicetree/bindings/arm/omap/timer.txt
+++ b/Documentation/devicetree/bindings/timer/ti,timer.txt
diff --git a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt b/Documentation/devicetree/bindings/timer/via,vt8500-timer.txt
index 901c73f0d8ef..901c73f0d8ef 100644
--- a/Documentation/devicetree/bindings/arm/vt8500/via,vt8500-timer.txt
+++ b/Documentation/devicetree/bindings/timer/via,vt8500-timer.txt
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 74e9db9e9088..4b38f3373f43 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -32,6 +32,7 @@ andestech Andes Technology Corporation
32apm Applied Micro Circuits Corporation (APM) 32apm Applied Micro Circuits Corporation (APM)
33aptina Aptina Imaging 33aptina Aptina Imaging
34arasan Arasan Chip Systems 34arasan Arasan Chip Systems
35archermind ArcherMind Technology (Nanjing) Co., Ltd.
35arctic Arctic Sand 36arctic Arctic Sand
36aries Aries Embedded GmbH 37aries Aries Embedded GmbH
37arm ARM Ltd. 38arm ARM Ltd.
@@ -47,6 +48,7 @@ auvidea Auvidea GmbH
47avago Avago Technologies 48avago Avago Technologies
48avia avia semiconductor 49avia avia semiconductor
49avic Shanghai AVIC Optoelectronics Co., Ltd. 50avic Shanghai AVIC Optoelectronics Co., Ltd.
51avnet Avnet, Inc.
50axentia Axentia Technologies AB 52axentia Axentia Technologies AB
51axis Axis Communications AB 53axis Axis Communications AB
52bananapi BIPAI KEJI LIMITED 54bananapi BIPAI KEJI LIMITED
@@ -186,6 +188,7 @@ khadas Khadas
186kiebackpeter Kieback & Peter GmbH 188kiebackpeter Kieback & Peter GmbH
187kinetic Kinetic Technologies 189kinetic Kinetic Technologies
188kingnovel Kingnovel Technology Co., Ltd. 190kingnovel Kingnovel Technology Co., Ltd.
191koe Kaohsiung Opto-Electronics Inc.
189kosagi Sutajio Ko-Usagi PTE Ltd. 192kosagi Sutajio Ko-Usagi PTE Ltd.
190kyo Kyocera Corporation 193kyo Kyocera Corporation
191lacie LaCie 194lacie LaCie
@@ -200,6 +203,7 @@ linaro Linaro Limited
200linksys Belkin International, Inc. (Linksys) 203linksys Belkin International, Inc. (Linksys)
201linux Linux-specific binding 204linux Linux-specific binding
202lltc Linear Technology Corporation 205lltc Linear Technology Corporation
206logicpd Logic PD, Inc.
203lsi LSI Corp. (LSI Logic) 207lsi LSI Corp. (LSI Logic)
204lwn Liebherr-Werk Nenzing GmbH 208lwn Liebherr-Werk Nenzing GmbH
205macnica Macnica Americas 209macnica Macnica Americas
@@ -320,6 +324,7 @@ sgx SGX Sensortech
320sharp Sharp Corporation 324sharp Sharp Corporation
321shimafuji Shimafuji Electric, Inc. 325shimafuji Shimafuji Electric, Inc.
322si-en Si-En Technology Ltd. 326si-en Si-En Technology Ltd.
327sifive SiFive, Inc.
323sigma Sigma Designs, Inc. 328sigma Sigma Designs, Inc.
324sii Seiko Instruments, Inc. 329sii Seiko Instruments, Inc.
325sil Silicon Image 330sil Silicon Image
@@ -395,6 +400,7 @@ vot Vision Optical Technology Co., Ltd.
395wd Western Digital Corp. 400wd Western Digital Corp.
396wetek WeTek Electronics, limited. 401wetek WeTek Electronics, limited.
397wexler Wexler 402wexler Wexler
403wi2wi Wi2Wi, Inc.
398winbond Winbond Electronics corp. 404winbond Winbond Electronics corp.
399winstar Winstar Display Corp. 405winstar Winstar Display Corp.
400wlf Wolfson Microelectronics 406wlf Wolfson Microelectronics
diff --git a/MAINTAINERS b/MAINTAINERS
index 5c29a7dee379..d325d2dc7600 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10510,12 +10510,14 @@ F: drivers/infiniband/ulp/opa_vnic
10510 10510
10511OPEN FIRMWARE AND DEVICE TREE OVERLAYS 10511OPEN FIRMWARE AND DEVICE TREE OVERLAYS
10512M: Pantelis Antoniou <pantelis.antoniou@konsulko.com> 10512M: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
10513M: Frank Rowand <frowand.list@gmail.com>
10513L: devicetree@vger.kernel.org 10514L: devicetree@vger.kernel.org
10514S: Maintained 10515S: Maintained
10515F: Documentation/devicetree/dynamic-resolution-notes.txt 10516F: Documentation/devicetree/dynamic-resolution-notes.txt
10516F: Documentation/devicetree/overlay-notes.txt 10517F: Documentation/devicetree/overlay-notes.txt
10517F: drivers/of/overlay.c 10518F: drivers/of/overlay.c
10518F: drivers/of/resolver.c 10519F: drivers/of/resolver.c
10520K: of_overlay_notifier_
10519 10521
10520OPEN FIRMWARE AND FLATTENED DEVICE TREE 10522OPEN FIRMWARE AND FLATTENED DEVICE TREE
10521M: Rob Herring <robh+dt@kernel.org> 10523M: Rob Herring <robh+dt@kernel.org>
diff --git a/drivers/gpu/drm/rcar-du/Makefile b/drivers/gpu/drm/rcar-du/Makefile
index 3e58ed93d5b1..2a3b8d7972b5 100644
--- a/drivers/gpu/drm/rcar-du/Makefile
+++ b/drivers/gpu/drm/rcar-du/Makefile
@@ -17,3 +17,10 @@ rcar-du-drm-$(CONFIG_DRM_RCAR_VSP) += rcar_du_vsp.o
17obj-$(CONFIG_DRM_RCAR_DU) += rcar-du-drm.o 17obj-$(CONFIG_DRM_RCAR_DU) += rcar-du-drm.o
18obj-$(CONFIG_DRM_RCAR_DW_HDMI) += rcar_dw_hdmi.o 18obj-$(CONFIG_DRM_RCAR_DW_HDMI) += rcar_dw_hdmi.o
19obj-$(CONFIG_DRM_RCAR_LVDS) += rcar_lvds.o 19obj-$(CONFIG_DRM_RCAR_LVDS) += rcar_lvds.o
20
21# 'remote-endpoint' is fixed up at run-time
22DTC_FLAGS_rcar_du_of_lvds_r8a7790 += -Wno-graph_endpoint
23DTC_FLAGS_rcar_du_of_lvds_r8a7791 += -Wno-graph_endpoint
24DTC_FLAGS_rcar_du_of_lvds_r8a7793 += -Wno-graph_endpoint
25DTC_FLAGS_rcar_du_of_lvds_r8a7795 += -Wno-graph_endpoint
26DTC_FLAGS_rcar_du_of_lvds_r8a7796 += -Wno-graph_endpoint
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c
index f9d5480a4ae5..27d9b4bba535 100644
--- a/drivers/of/of_numa.c
+++ b/drivers/of/of_numa.c
@@ -177,7 +177,6 @@ int of_node_to_nid(struct device_node *device)
177 177
178 return NUMA_NO_NODE; 178 return NUMA_NO_NODE;
179} 179}
180EXPORT_SYMBOL(of_node_to_nid);
181 180
182int __init of_numa_init(void) 181int __init of_numa_init(void)
183{ 182{
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index c00d81dfac0b..0b49a62b38a3 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -32,6 +32,11 @@ const struct of_device_id of_default_bus_match_table[] = {
32 {} /* Empty terminated list */ 32 {} /* Empty terminated list */
33}; 33};
34 34
35static const struct of_device_id of_skipped_node_table[] = {
36 { .compatible = "operating-points-v2", },
37 {} /* Empty terminated list */
38};
39
35static int of_dev_node_match(struct device *dev, void *data) 40static int of_dev_node_match(struct device *dev, void *data)
36{ 41{
37 return dev->of_node == data; 42 return dev->of_node == data;
@@ -356,6 +361,12 @@ static int of_platform_bus_create(struct device_node *bus,
356 return 0; 361 return 0;
357 } 362 }
358 363
364 /* Skip nodes for which we don't want to create devices */
365 if (unlikely(of_match_node(of_skipped_node_table, bus))) {
366 pr_debug("%s() - skipping %pOF node\n", __func__, bus);
367 return 0;
368 }
369
359 if (of_node_check_flag(bus, OF_POPULATED_BUS)) { 370 if (of_node_check_flag(bus, OF_POPULATED_BUS)) {
360 pr_debug("%s() - skipping %pOF, already populated\n", 371 pr_debug("%s() - skipping %pOF, already populated\n",
361 __func__, bus); 372 __func__, bus);
@@ -537,6 +548,9 @@ int of_platform_device_destroy(struct device *dev, void *data)
537 if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS)) 548 if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS))
538 device_for_each_child(dev, NULL, of_platform_device_destroy); 549 device_for_each_child(dev, NULL, of_platform_device_destroy);
539 550
551 of_node_clear_flag(dev->of_node, OF_POPULATED);
552 of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
553
540 if (dev->bus == &platform_bus_type) 554 if (dev->bus == &platform_bus_type)
541 platform_device_unregister(to_platform_device(dev)); 555 platform_device_unregister(to_platform_device(dev));
542#ifdef CONFIG_ARM_AMBA 556#ifdef CONFIG_ARM_AMBA
@@ -544,8 +558,6 @@ int of_platform_device_destroy(struct device *dev, void *data)
544 amba_device_unregister(to_amba_device(dev)); 558 amba_device_unregister(to_amba_device(dev));
545#endif 559#endif
546 560
547 of_node_clear_flag(dev->of_node, OF_POPULATED);
548 of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
549 return 0; 561 return 0;
550} 562}
551EXPORT_SYMBOL_GPL(of_platform_device_destroy); 563EXPORT_SYMBOL_GPL(of_platform_device_destroy);
diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c
index 65d0b7adfcd4..7edfac6f1914 100644
--- a/drivers/of/resolver.c
+++ b/drivers/of/resolver.c
@@ -122,6 +122,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
122 goto err_fail; 122 goto err_fail;
123 } 123 }
124 124
125 if (offset < 0 || offset + sizeof(__be32) > prop->length) {
126 err = -EINVAL;
127 goto err_fail;
128 }
129
125 *(__be32 *)(prop->value + offset) = cpu_to_be32(phandle); 130 *(__be32 *)(prop->value + offset) = cpu_to_be32(phandle);
126 } 131 }
127 132
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 6bb37c18292a..ecee50d10d14 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -165,20 +165,20 @@ static void __init of_unittest_dynamic(void)
165 /* Add a new property - should pass*/ 165 /* Add a new property - should pass*/
166 prop->name = "new-property"; 166 prop->name = "new-property";
167 prop->value = "new-property-data"; 167 prop->value = "new-property-data";
168 prop->length = strlen(prop->value); 168 prop->length = strlen(prop->value) + 1;
169 unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n"); 169 unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n");
170 170
171 /* Try to add an existing property - should fail */ 171 /* Try to add an existing property - should fail */
172 prop++; 172 prop++;
173 prop->name = "new-property"; 173 prop->name = "new-property";
174 prop->value = "new-property-data-should-fail"; 174 prop->value = "new-property-data-should-fail";
175 prop->length = strlen(prop->value); 175 prop->length = strlen(prop->value) + 1;
176 unittest(of_add_property(np, prop) != 0, 176 unittest(of_add_property(np, prop) != 0,
177 "Adding an existing property should have failed\n"); 177 "Adding an existing property should have failed\n");
178 178
179 /* Try to modify an existing property - should pass */ 179 /* Try to modify an existing property - should pass */
180 prop->value = "modify-property-data-should-pass"; 180 prop->value = "modify-property-data-should-pass";
181 prop->length = strlen(prop->value); 181 prop->length = strlen(prop->value) + 1;
182 unittest(of_update_property(np, prop) == 0, 182 unittest(of_update_property(np, prop) == 0,
183 "Updating an existing property should have passed\n"); 183 "Updating an existing property should have passed\n");
184 184
@@ -186,7 +186,7 @@ static void __init of_unittest_dynamic(void)
186 prop++; 186 prop++;
187 prop->name = "modify-property"; 187 prop->name = "modify-property";
188 prop->value = "modify-missing-property-data-should-pass"; 188 prop->value = "modify-missing-property-data-should-pass";
189 prop->length = strlen(prop->value); 189 prop->length = strlen(prop->value) + 1;
190 unittest(of_update_property(np, prop) == 0, 190 unittest(of_update_property(np, prop) == 0,
191 "Updating a missing property should have passed\n"); 191 "Updating a missing property should have passed\n");
192 192
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 5af34a2b0cd9..1bb594fcfe12 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -251,6 +251,9 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
251 -Wno-unit_address_format \ 251 -Wno-unit_address_format \
252 -Wno-avoid_unnecessary_addr_size \ 252 -Wno-avoid_unnecessary_addr_size \
253 -Wno-alias_paths \ 253 -Wno-alias_paths \
254 -Wno-graph_child_address \
255 -Wno-graph_port \
256 -Wno-unique_unit_address \
254 -Wno-pci_device_reg 257 -Wno-pci_device_reg
255endif 258endif
256 259
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 815eaf140ab5..a2cc1036c915 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -255,7 +255,7 @@ static void check_duplicate_node_names(struct check *c, struct dt_info *dti,
255 child2; 255 child2;
256 child2 = child2->next_sibling) 256 child2 = child2->next_sibling)
257 if (streq(child->name, child2->name)) 257 if (streq(child->name, child2->name))
258 FAIL(c, dti, node, "Duplicate node name"); 258 FAIL(c, dti, child2, "Duplicate node name");
259} 259}
260ERROR(duplicate_node_names, check_duplicate_node_names, NULL); 260ERROR(duplicate_node_names, check_duplicate_node_names, NULL);
261 261
@@ -317,6 +317,11 @@ static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti,
317 const char *unitname = get_unitname(node); 317 const char *unitname = get_unitname(node);
318 struct property *prop = get_property(node, "reg"); 318 struct property *prop = get_property(node, "reg");
319 319
320 if (get_subnode(node, "__overlay__")) {
321 /* HACK: Overlay fragments are a special case */
322 return;
323 }
324
320 if (!prop) { 325 if (!prop) {
321 prop = get_property(node, "ranges"); 326 prop = get_property(node, "ranges");
322 if (prop && !prop->val.len) 327 if (prop && !prop->val.len)
@@ -579,6 +584,8 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti,
579 584
580 phandle = get_node_phandle(dt, refnode); 585 phandle = get_node_phandle(dt, refnode);
581 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); 586 *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle);
587
588 reference_node(refnode);
582 } 589 }
583 } 590 }
584} 591}
@@ -609,11 +616,21 @@ static void fixup_path_references(struct check *c, struct dt_info *dti,
609 path = refnode->fullpath; 616 path = refnode->fullpath;
610 prop->val = data_insert_at_marker(prop->val, m, path, 617 prop->val = data_insert_at_marker(prop->val, m, path,
611 strlen(path) + 1); 618 strlen(path) + 1);
619
620 reference_node(refnode);
612 } 621 }
613 } 622 }
614} 623}
615ERROR(path_references, fixup_path_references, NULL, &duplicate_node_names); 624ERROR(path_references, fixup_path_references, NULL, &duplicate_node_names);
616 625
626static void fixup_omit_unused_nodes(struct check *c, struct dt_info *dti,
627 struct node *node)
628{
629 if (node->omit_if_unused && !node->is_referenced)
630 delete_node(node);
631}
632ERROR(omit_unused_nodes, fixup_omit_unused_nodes, NULL, &phandle_references, &path_references);
633
617/* 634/*
618 * Semantic checks 635 * Semantic checks
619 */ 636 */
@@ -1017,6 +1034,36 @@ static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *d
1017} 1034}
1018WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size); 1035WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size);
1019 1036
1037static void check_unique_unit_address(struct check *c, struct dt_info *dti,
1038 struct node *node)
1039{
1040 struct node *childa;
1041
1042 if (node->addr_cells < 0 || node->size_cells < 0)
1043 return;
1044
1045 if (!node->children)
1046 return;
1047
1048 for_each_child(node, childa) {
1049 struct node *childb;
1050 const char *addr_a = get_unitname(childa);
1051
1052 if (!strlen(addr_a))
1053 continue;
1054
1055 for_each_child(node, childb) {
1056 const char *addr_b = get_unitname(childb);
1057 if (childa == childb)
1058 break;
1059
1060 if (streq(addr_a, addr_b))
1061 FAIL(c, dti, childb, "duplicate unit-address (also used in node %s)", childa->fullpath);
1062 }
1063 }
1064}
1065WARNING(unique_unit_address, check_unique_unit_address, NULL, &avoid_default_addr_size);
1066
1020static void check_obsolete_chosen_interrupt_controller(struct check *c, 1067static void check_obsolete_chosen_interrupt_controller(struct check *c,
1021 struct dt_info *dti, 1068 struct dt_info *dti,
1022 struct node *node) 1069 struct node *node)
@@ -1357,6 +1404,152 @@ static void check_interrupts_property(struct check *c,
1357} 1404}
1358WARNING(interrupts_property, check_interrupts_property, &phandle_references); 1405WARNING(interrupts_property, check_interrupts_property, &phandle_references);
1359 1406
1407static const struct bus_type graph_port_bus = {
1408 .name = "graph-port",
1409};
1410
1411static const struct bus_type graph_ports_bus = {
1412 .name = "graph-ports",
1413};
1414
1415static void check_graph_nodes(struct check *c, struct dt_info *dti,
1416 struct node *node)
1417{
1418 struct node *child;
1419
1420 for_each_child(node, child) {
1421 if (!(strprefixeq(child->name, child->basenamelen, "endpoint") ||
1422 get_property(child, "remote-endpoint")))
1423 continue;
1424
1425 node->bus = &graph_port_bus;
1426
1427 /* The parent of 'port' nodes can be either 'ports' or a device */
1428 if (!node->parent->bus &&
1429 (streq(node->parent->name, "ports") || get_property(node, "reg")))
1430 node->parent->bus = &graph_ports_bus;
1431
1432 break;
1433 }
1434
1435}
1436WARNING(graph_nodes, check_graph_nodes, NULL);
1437
1438static void check_graph_child_address(struct check *c, struct dt_info *dti,
1439 struct node *node)
1440{
1441 int cnt = 0;
1442 struct node *child;
1443
1444 if (node->bus != &graph_ports_bus && node->bus != &graph_port_bus)
1445 return;
1446
1447 for_each_child(node, child) {
1448 struct property *prop = get_property(child, "reg");
1449
1450 /* No error if we have any non-zero unit address */
1451 if (prop && propval_cell(prop) != 0)
1452 return;
1453
1454 cnt++;
1455 }
1456
1457 if (cnt == 1 && node->addr_cells != -1)
1458 FAIL(c, dti, node, "graph node has single child node '%s', #address-cells/#size-cells are not necessary",
1459 node->children->name);
1460}
1461WARNING(graph_child_address, check_graph_child_address, NULL, &graph_nodes);
1462
1463static void check_graph_reg(struct check *c, struct dt_info *dti,
1464 struct node *node)
1465{
1466 char unit_addr[9];
1467 const char *unitname = get_unitname(node);
1468 struct property *prop;
1469
1470 prop = get_property(node, "reg");
1471 if (!prop || !unitname)
1472 return;
1473
1474 if (!(prop->val.val && prop->val.len == sizeof(cell_t))) {
1475 FAIL(c, dti, node, "graph node malformed 'reg' property");
1476 return;
1477 }
1478
1479 snprintf(unit_addr, sizeof(unit_addr), "%x", propval_cell(prop));
1480 if (!streq(unitname, unit_addr))
1481 FAIL(c, dti, node, "graph node unit address error, expected \"%s\"",
1482 unit_addr);
1483
1484 if (node->parent->addr_cells != 1)
1485 FAIL_PROP(c, dti, node, get_property(node, "#address-cells"),
1486 "graph node '#address-cells' is %d, must be 1",
1487 node->parent->addr_cells);
1488 if (node->parent->size_cells != 0)
1489 FAIL_PROP(c, dti, node, get_property(node, "#size-cells"),
1490 "graph node '#size-cells' is %d, must be 0",
1491 node->parent->size_cells);
1492}
1493
1494static void check_graph_port(struct check *c, struct dt_info *dti,
1495 struct node *node)
1496{
1497 if (node->bus != &graph_port_bus)
1498 return;
1499
1500 if (!strprefixeq(node->name, node->basenamelen, "port"))
1501 FAIL(c, dti, node, "graph port node name should be 'port'");
1502
1503 check_graph_reg(c, dti, node);
1504}
1505WARNING(graph_port, check_graph_port, NULL, &graph_nodes);
1506
1507static struct node *get_remote_endpoint(struct check *c, struct dt_info *dti,
1508 struct node *endpoint)
1509{
1510 int phandle;
1511 struct node *node;
1512 struct property *prop;
1513
1514 prop = get_property(endpoint, "remote-endpoint");
1515 if (!prop)
1516 return NULL;
1517
1518 phandle = propval_cell(prop);
1519 /* Give up if this is an overlay with external references */
1520 if (phandle == 0 || phandle == -1)
1521 return NULL;
1522
1523 node = get_node_by_phandle(dti->dt, phandle);
1524 if (!node)
1525 FAIL_PROP(c, dti, endpoint, prop, "graph phandle is not valid");
1526
1527 return node;
1528}
1529
1530static void check_graph_endpoint(struct check *c, struct dt_info *dti,
1531 struct node *node)
1532{
1533 struct node *remote_node;
1534
1535 if (!node->parent || node->parent->bus != &graph_port_bus)
1536 return;
1537
1538 if (!strprefixeq(node->name, node->basenamelen, "endpoint"))
1539 FAIL(c, dti, node, "graph endpont node name should be 'endpoint'");
1540
1541 check_graph_reg(c, dti, node);
1542
1543 remote_node = get_remote_endpoint(c, dti, node);
1544 if (!remote_node)
1545 return;
1546
1547 if (get_remote_endpoint(c, dti, remote_node) != node)
1548 FAIL(c, dti, node, "graph connection to node '%s' is not bidirectional",
1549 remote_node->fullpath);
1550}
1551WARNING(graph_endpoint, check_graph_endpoint, NULL, &graph_nodes);
1552
1360static struct check *check_table[] = { 1553static struct check *check_table[] = {
1361 &duplicate_node_names, &duplicate_property_names, 1554 &duplicate_node_names, &duplicate_property_names,
1362 &node_name_chars, &node_name_format, &property_name_chars, 1555 &node_name_chars, &node_name_format, &property_name_chars,
@@ -1366,6 +1559,7 @@ static struct check *check_table[] = {
1366 1559
1367 &explicit_phandles, 1560 &explicit_phandles,
1368 &phandle_references, &path_references, 1561 &phandle_references, &path_references,
1562 &omit_unused_nodes,
1369 1563
1370 &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell, 1564 &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
1371 &device_type_is_string, &model_is_string, &status_is_string, 1565 &device_type_is_string, &model_is_string, &status_is_string,
@@ -1390,6 +1584,7 @@ static struct check *check_table[] = {
1390 1584
1391 &avoid_default_addr_size, 1585 &avoid_default_addr_size,
1392 &avoid_unnecessary_addr_size, 1586 &avoid_unnecessary_addr_size,
1587 &unique_unit_address,
1393 &obsolete_chosen_interrupt_controller, 1588 &obsolete_chosen_interrupt_controller,
1394 &chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path, 1589 &chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path,
1395 1590
@@ -1416,6 +1611,8 @@ static struct check *check_table[] = {
1416 1611
1417 &alias_paths, 1612 &alias_paths,
1418 1613
1614 &graph_nodes, &graph_child_address, &graph_port, &graph_endpoint,
1615
1419 &always_fail, 1616 &always_fail,
1420}; 1617};
1421 1618
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index fd825ebba69c..615b7ec6588f 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -153,6 +153,13 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
153 return DT_DEL_NODE; 153 return DT_DEL_NODE;
154 } 154 }
155 155
156<*>"/omit-if-no-ref/" {
157 DPRINT("Keyword: /omit-if-no-ref/\n");
158 DPRINT("<PROPNODENAME>\n");
159 BEGIN(PROPNODENAME);
160 return DT_OMIT_NO_REF;
161 }
162
156<*>{LABEL}: { 163<*>{LABEL}: {
157 DPRINT("Label: %s\n", yytext); 164 DPRINT("Label: %s\n", yytext);
158 yylval.labelref = xstrdup(yytext); 165 yylval.labelref = xstrdup(yytext);
diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y
index 44af170abfea..011a5b25539a 100644
--- a/scripts/dtc/dtc-parser.y
+++ b/scripts/dtc/dtc-parser.y
@@ -63,6 +63,7 @@ extern bool treesource_error;
63%token DT_BITS 63%token DT_BITS
64%token DT_DEL_PROP 64%token DT_DEL_PROP
65%token DT_DEL_NODE 65%token DT_DEL_NODE
66%token DT_OMIT_NO_REF
66%token <propnodename> DT_PROPNODENAME 67%token <propnodename> DT_PROPNODENAME
67%token <integer> DT_LITERAL 68%token <integer> DT_LITERAL
68%token <integer> DT_CHAR_LITERAL 69%token <integer> DT_CHAR_LITERAL
@@ -190,18 +191,18 @@ devicetree:
190 } 191 }
191 | devicetree DT_REF nodedef 192 | devicetree DT_REF nodedef
192 { 193 {
193 struct node *target = get_node_by_ref($1, $2); 194 /*
194 195 * We rely on the rule being always:
195 if (target) { 196 * versioninfo plugindecl memreserves devicetree
196 merge_nodes(target, $3); 197 * so $-1 is what we want (plugindecl)
198 */
199 if ($<flags>-1 & DTSF_PLUGIN) {
200 add_orphan_node($1, $3, $2);
197 } else { 201 } else {
198 /* 202 struct node *target = get_node_by_ref($1, $2);
199 * We rely on the rule being always: 203
200 * versioninfo plugindecl memreserves devicetree 204 if (target)
201 * so $-1 is what we want (plugindecl) 205 merge_nodes(target, $3);
202 */
203 if ($<flags>-1 & DTSF_PLUGIN)
204 add_orphan_node($1, $3, $2);
205 else 206 else
206 ERROR(&@2, "Label or path %s not found", $2); 207 ERROR(&@2, "Label or path %s not found", $2);
207 } 208 }
@@ -219,6 +220,18 @@ devicetree:
219 220
220 $$ = $1; 221 $$ = $1;
221 } 222 }
223 | devicetree DT_OMIT_NO_REF DT_REF ';'
224 {
225 struct node *target = get_node_by_ref($1, $3);
226
227 if (target)
228 omit_node_if_unused(target);
229 else
230 ERROR(&@3, "Label or path %s not found", $3);
231
232
233 $$ = $1;
234 }
222 ; 235 ;
223 236
224nodedef: 237nodedef:
@@ -523,6 +536,10 @@ subnode:
523 { 536 {
524 $$ = name_node(build_node_delete(), $2); 537 $$ = name_node(build_node_delete(), $2);
525 } 538 }
539 | DT_OMIT_NO_REF subnode
540 {
541 $$ = omit_node_if_unused($2);
542 }
526 | DT_LABEL subnode 543 | DT_LABEL subnode
527 { 544 {
528 add_label(&$2->labels, $1); 545 add_label(&$2->labels, $1);
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h
index 3b18a42b866e..6d667701ab6a 100644
--- a/scripts/dtc/dtc.h
+++ b/scripts/dtc/dtc.h
@@ -168,6 +168,8 @@ struct node {
168 168
169 struct label *labels; 169 struct label *labels;
170 const struct bus_type *bus; 170 const struct bus_type *bus;
171
172 bool omit_if_unused, is_referenced;
171}; 173};
172 174
173#define for_each_label_withdel(l0, l) \ 175#define for_each_label_withdel(l0, l) \
@@ -202,6 +204,8 @@ struct property *reverse_properties(struct property *first);
202struct node *build_node(struct property *proplist, struct node *children); 204struct node *build_node(struct property *proplist, struct node *children);
203struct node *build_node_delete(void); 205struct node *build_node_delete(void);
204struct node *name_node(struct node *node, char *name); 206struct node *name_node(struct node *node, char *name);
207struct node *omit_node_if_unused(struct node *node);
208struct node *reference_node(struct node *node);
205struct node *chain_node(struct node *first, struct node *list); 209struct node *chain_node(struct node *first, struct node *list);
206struct node *merge_nodes(struct node *old_node, struct node *new_node); 210struct node *merge_nodes(struct node *old_node, struct node *new_node);
207struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref); 211struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref);
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c
index 57b7db2ed153..6e4c367f54b3 100644
--- a/scripts/dtc/livetree.c
+++ b/scripts/dtc/livetree.c
@@ -134,6 +134,20 @@ struct node *name_node(struct node *node, char *name)
134 return node; 134 return node;
135} 135}
136 136
137struct node *omit_node_if_unused(struct node *node)
138{
139 node->omit_if_unused = 1;
140
141 return node;
142}
143
144struct node *reference_node(struct node *node)
145{
146 node->is_referenced = 1;
147
148 return node;
149}
150
137struct node *merge_nodes(struct node *old_node, struct node *new_node) 151struct node *merge_nodes(struct node *old_node, struct node *new_node)
138{ 152{
139 struct property *new_prop, *old_prop; 153 struct property *new_prop, *old_prop;
@@ -224,10 +238,16 @@ struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref)
224 struct data d = empty_data; 238 struct data d = empty_data;
225 char *name; 239 char *name;
226 240
227 d = data_add_marker(d, REF_PHANDLE, ref); 241 if (ref[0] == '/') {
228 d = data_append_integer(d, 0xffffffff, 32); 242 d = data_append_data(d, ref, strlen(ref) + 1);
229 243
230 p = build_property("target", d); 244 p = build_property("target-path", d);
245 } else {
246 d = data_add_marker(d, REF_PHANDLE, ref);
247 d = data_append_integer(d, 0xffffffff, 32);
248
249 p = build_property("target", d);
250 }
231 251
232 xasprintf(&name, "fragment@%u", 252 xasprintf(&name, "fragment@%u",
233 next_orphan_fragment++); 253 next_orphan_fragment++);
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index ad87849e333b..b00f14ff7a17 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
#define DTC_VERSION "DTC 1.4.6-gaadd0b65" #define DTC_VERSION "DTC 1.4.6-g84e414b0"