aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 17:51:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 17:51:34 -0400
commite7f44b65b532040ac90b73b60ea0b629742ced33 (patch)
tree1dec69d411543c5c8ee1b61311db4470070745f0
parent76b584d3125a1f7d8b64e9c522a4555bc2844bde (diff)
parentf2c27767af0a91cbdc3d832231f953110473e853 (diff)
Merge tag 'devicetree-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring: - Rewrite of the unflattening code to avoid recursion and lessen the stack usage. - Rewrite of the phandle args parsing code to get rid of the fixed args size. This is needed for IOMMU code. - Sync to latest dtc which adds more dts style checking. These warnings are enabled with "W=1" compiles. - Tegra documentation updates related to the above warnings. - A bunch of spelling and other doc fixes. - Various vendor prefix additions. * tag 'devicetree-for-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (52 commits) devicetree: Add Creative Technology vendor id gpio: dt-bindings: add ibm,ppc4xx-gpio binding of/unittest: Remove unnecessary module.h header inclusion drivers/of: Fix build warning in populate_node() drivers/of: Fix depth when unflattening devicetree of: dynamic: changeset prop-update revert fix drivers/of: Export of_detach_node() drivers/of: Return allocated memory from of_fdt_unflatten_tree() drivers/of: Specify parent node in of_fdt_unflatten_tree() drivers/of: Rename unflatten_dt_node() drivers/of: Avoid recursively calling unflatten_dt_node() drivers/of: Split unflatten_dt_node() of: include errno.h in of_graph.h of: document refcount incrementation of of_get_cpu_node() Documentation: dt: soc: fix spelling mistakes Documentation: dt: power: fix spelling mistake Documentation: dt: pinctrl: fix spelling mistake Documentation: dt: opp: fix spelling mistake Documentation: dt: net: fix spelling mistakes Documentation: dt: mtd: fix spelling mistake ...
-rw-r--r--Documentation/devicetree/bindings/arm/cci.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/omap/crossbar.txt3
-rw-r--r--Documentation/devicetree/bindings/arm/spear-misc.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/ux500/boards.txt2
-rw-r--r--Documentation/devicetree/bindings/ata/nvidia,tegra124-ahci.txt (renamed from Documentation/devicetree/bindings/ata/tegra-sata.txt)0
-rw-r--r--Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt2
-rw-r--r--Documentation/devicetree/bindings/clock/rockchip,rk3188-cru.txt2
-rw-r--r--Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt2
-rw-r--r--Documentation/devicetree/bindings/clock/st/st,clkgen.txt2
-rw-r--r--Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt (renamed from Documentation/devicetree/bindings/cpufreq/tegra124-cpufreq.txt)0
-rw-r--r--Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt2
-rw-r--r--Documentation/devicetree/bindings/dma/nvidia,tegra20-apbdma.txt (renamed from Documentation/devicetree/bindings/dma/tegra20-apbdma.txt)0
-rw-r--r--Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt2
-rw-r--r--Documentation/devicetree/bindings/gpio/ibm,ppc4xx-gpio.txt24
-rw-r--r--Documentation/devicetree/bindings/input/ads7846.txt2
-rw-r--r--Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt2
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt3
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra20-ictlr.txt (renamed from Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt)0
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu4
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.txt (renamed from Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt)4
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.txt (renamed from Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt)6
-rw-r--r--Documentation/devicetree/bindings/mfd/qcom-rpm.txt4
-rw-r--r--Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt2
-rw-r--r--Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt2
-rw-r--r--Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt2
-rw-r--r--Documentation/devicetree/bindings/net/stmmac.txt4
-rw-r--r--Documentation/devicetree/bindings/net/ti,dp83867.txt2
-rw-r--r--Documentation/devicetree/bindings/opp/opp.txt2
-rw-r--r--Documentation/devicetree/bindings/pci/designware-pcie.txt2
-rw-r--r--Documentation/devicetree/bindings/pci/hisilicon-pcie.txt12
-rw-r--r--Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt2
-rw-r--r--Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt6
-rw-r--r--Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt2
-rw-r--r--Documentation/devicetree/bindings/power/qcom,coincell-charger.txt2
-rw-r--r--Documentation/devicetree/bindings/regulator/palmas-pmic.txt8
-rw-r--r--Documentation/devicetree/bindings/rtc/rtc-palmas.txt6
-rw-r--r--Documentation/devicetree/bindings/serial/mvebu-uart.txt (renamed from Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt)0
-rw-r--r--Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt6
-rw-r--r--Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt2
-rw-r--r--Documentation/devicetree/bindings/sram/sram.txt2
-rw-r--r--Documentation/devicetree/bindings/thermal/nvidia,tegra124-soctherm.txt (renamed from Documentation/devicetree/bindings/thermal/tegra-soctherm.txt)2
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt4
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c2
-rw-r--r--drivers/iommu/arm-smmu.c38
-rw-r--r--drivers/of/base.c209
-rw-r--r--drivers/of/dynamic.c6
-rw-r--r--drivers/of/fdt.c382
-rw-r--r--drivers/of/unittest.c3
-rw-r--r--include/linux/of.h56
-rw-r--r--include/linux/of_fdt.h5
-rw-r--r--include/linux/of_graph.h1
-rw-r--r--scripts/Makefile.lib5
-rw-r--r--scripts/dtc/checks.c26
-rw-r--r--scripts/dtc/flattree.c4
-rw-r--r--scripts/dtc/libfdt/fdt_ro.c6
-rw-r--r--scripts/dtc/version_gen.h2
56 files changed, 595 insertions, 290 deletions
diff --git a/Documentation/devicetree/bindings/arm/cci.txt b/Documentation/devicetree/bindings/arm/cci.txt
index a1a5a7ecc2fb..0f2153e8fa7e 100644
--- a/Documentation/devicetree/bindings/arm/cci.txt
+++ b/Documentation/devicetree/bindings/arm/cci.txt
@@ -100,7 +100,7 @@ specific to ARM.
100 "arm,cci-400-pmu,r0" 100 "arm,cci-400-pmu,r0"
101 "arm,cci-400-pmu,r1" 101 "arm,cci-400-pmu,r1"
102 "arm,cci-400-pmu" - DEPRECATED, permitted only where OS has 102 "arm,cci-400-pmu" - DEPRECATED, permitted only where OS has
103 secure acces to CCI registers 103 secure access to CCI registers
104 "arm,cci-500-pmu,r0" 104 "arm,cci-500-pmu,r0"
105 "arm,cci-550-pmu,r0" 105 "arm,cci-550-pmu,r0"
106 - reg: 106 - reg:
diff --git a/Documentation/devicetree/bindings/arm/omap/crossbar.txt b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
index a9b28d74d902..bb5727ae004a 100644
--- a/Documentation/devicetree/bindings/arm/omap/crossbar.txt
+++ b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
@@ -42,7 +42,8 @@ Examples:
42Consumer: 42Consumer:
43======== 43========
44See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt and 44See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt and
45Documentation/devicetree/bindings/arm/gic.txt for further details. 45Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt for
46further details.
46 47
47An interrupt consumer on an SoC using crossbar will use: 48An interrupt consumer on an SoC using crossbar will use:
48 interrupts = <GIC_SPI request_number interrupt_level> 49 interrupts = <GIC_SPI request_number interrupt_level>
diff --git a/Documentation/devicetree/bindings/arm/spear-misc.txt b/Documentation/devicetree/bindings/arm/spear-misc.txt
index cf649827ffcd..e404e2556b4a 100644
--- a/Documentation/devicetree/bindings/arm/spear-misc.txt
+++ b/Documentation/devicetree/bindings/arm/spear-misc.txt
@@ -6,4 +6,4 @@ few properties of different peripheral controllers.
6misc node required properties: 6misc node required properties:
7 7
8- compatible Should be "st,spear1340-misc", "syscon". 8- compatible Should be "st,spear1340-misc", "syscon".
9- reg: Address range of misc space upto 8K 9- reg: Address range of misc space up to 8K
diff --git a/Documentation/devicetree/bindings/arm/ux500/boards.txt b/Documentation/devicetree/bindings/arm/ux500/boards.txt
index b8737a8de718..7334c24625fc 100644
--- a/Documentation/devicetree/bindings/arm/ux500/boards.txt
+++ b/Documentation/devicetree/bindings/arm/ux500/boards.txt
@@ -23,7 +23,7 @@ scu:
23 see binding for arm/scu.txt 23 see binding for arm/scu.txt
24 24
25interrupt-controller: 25interrupt-controller:
26 see binding for 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 arm/twd.txt
diff --git a/Documentation/devicetree/bindings/ata/tegra-sata.txt b/Documentation/devicetree/bindings/ata/nvidia,tegra124-ahci.txt
index 66c83c3e8915..66c83c3e8915 100644
--- a/Documentation/devicetree/bindings/ata/tegra-sata.txt
+++ b/Documentation/devicetree/bindings/ata/nvidia,tegra124-ahci.txt
diff --git a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
index ee7e5fd4a50b..63f9d8277d48 100644
--- a/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
+++ b/Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.txt
@@ -50,7 +50,7 @@ Required properties for I2C mode:
50 50
51Example: 51Example:
52 52
53clock@0,70110000 { 53clock@70110000 {
54 compatible = "nvidia,tegra124-dfll"; 54 compatible = "nvidia,tegra124-dfll";
55 reg = <0 0x70110000 0 0x100>, /* DFLL control */ 55 reg = <0 0x70110000 0 0x100>, /* DFLL control */
56 <0 0x70110000 0 0x100>, /* I2C output control */ 56 <0 0x70110000 0 0x100>, /* I2C output control */
diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3188-cru.txt b/Documentation/devicetree/bindings/clock/rockchip,rk3188-cru.txt
index 0c2bf5eba43e..7f368530a2e4 100644
--- a/Documentation/devicetree/bindings/clock/rockchip,rk3188-cru.txt
+++ b/Documentation/devicetree/bindings/clock/rockchip,rk3188-cru.txt
@@ -16,7 +16,7 @@ Required Properties:
16Optional Properties: 16Optional Properties:
17 17
18- rockchip,grf: phandle to the syscon managing the "general register files" 18- rockchip,grf: phandle to the syscon managing the "general register files"
19 If missing pll rates are not changable, due to the missing pll lock status. 19 If missing pll rates are not changeable, due to the missing pll lock status.
20 20
21Each clock is assigned an identifier and client nodes can use this identifier 21Each clock is assigned an identifier and client nodes can use this identifier
22to specify the clock which they consume. All available clocks are defined as 22to specify the clock which they consume. All available clocks are defined as
diff --git a/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt b/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt
index c9fbb76573e1..8cb47c39ba53 100644
--- a/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt
+++ b/Documentation/devicetree/bindings/clock/rockchip,rk3288-cru.txt
@@ -15,7 +15,7 @@ Required Properties:
15Optional Properties: 15Optional Properties:
16 16
17- rockchip,grf: phandle to the syscon managing the "general register files" 17- rockchip,grf: phandle to the syscon managing the "general register files"
18 If missing pll rates are not changable, due to the missing pll lock status. 18 If missing pll rates are not changeable, due to the missing pll lock status.
19 19
20Each clock is assigned an identifier and client nodes can use this identifier 20Each clock is assigned an identifier and client nodes can use this identifier
21to specify the clock which they consume. All available clocks are defined as 21to specify the clock which they consume. All available clocks are defined as
diff --git a/Documentation/devicetree/bindings/clock/st/st,clkgen.txt b/Documentation/devicetree/bindings/clock/st/st,clkgen.txt
index 78978f1f5158..b18bf86f926f 100644
--- a/Documentation/devicetree/bindings/clock/st/st,clkgen.txt
+++ b/Documentation/devicetree/bindings/clock/st/st,clkgen.txt
@@ -40,7 +40,7 @@ address is common of all subnode.
40 }; 40 };
41 41
42This binding uses the common clock binding[1]. 42This binding uses the common clock binding[1].
43Each subnode should use the binding discribe in [2]..[7] 43Each subnode should use the binding described in [2]..[7]
44 44
45[1] Documentation/devicetree/bindings/clock/clock-bindings.txt 45[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
46[2] Documentation/devicetree/bindings/clock/st,clkgen-divmux.txt 46[2] Documentation/devicetree/bindings/clock/st,clkgen-divmux.txt
diff --git a/Documentation/devicetree/bindings/cpufreq/tegra124-cpufreq.txt b/Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt
index b1669fbfb740..b1669fbfb740 100644
--- a/Documentation/devicetree/bindings/cpufreq/tegra124-cpufreq.txt
+++ b/Documentation/devicetree/bindings/cpufreq/nvidia,tegra124-cpufreq.txt
diff --git a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt
index 22756b3dede2..a78265993665 100644
--- a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt
+++ b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt
@@ -41,7 +41,7 @@ Video interfaces:
41 endpoint node connected from mic node (reg = 0): 41 endpoint node connected from mic node (reg = 0):
42 - remote-endpoint: specifies the endpoint in mic node. This node is required 42 - remote-endpoint: specifies the endpoint in mic node. This node is required
43 for Exynos5433 mipi dsi. So mic can access to panel node 43 for Exynos5433 mipi dsi. So mic can access to panel node
44 thoughout this dsi node. 44 throughout this dsi node.
45 endpoint node connected to panel node (reg = 1): 45 endpoint node connected to panel node (reg = 1):
46 - remote-endpoint: specifies the endpoint in panel node. This node is 46 - remote-endpoint: specifies the endpoint in panel node. This node is
47 required in all kinds of exynos mipi dsi to represent 47 required in all kinds of exynos mipi dsi to represent
diff --git a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt b/Documentation/devicetree/bindings/dma/nvidia,tegra20-apbdma.txt
index c6908e7c42cc..c6908e7c42cc 100644
--- a/Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
+++ b/Documentation/devicetree/bindings/dma/nvidia,tegra20-apbdma.txt
diff --git a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
index 2291c4098730..3cf0072d3141 100644
--- a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
+++ b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
@@ -7,7 +7,7 @@ Required properties:
7- compatible: Should be "xlnx,axi-dma-1.00.a" 7- compatible: Should be "xlnx,axi-dma-1.00.a"
8- #dma-cells: Should be <1>, see "dmas" property below 8- #dma-cells: Should be <1>, see "dmas" property below
9- reg: Should contain DMA registers location and length. 9- reg: Should contain DMA registers location and length.
10- dma-channel child node: Should have atleast one channel and can have upto 10- dma-channel child node: Should have at least one channel and can have up to
11 two channels per device. This node specifies the properties of each 11 two channels per device. This node specifies the properties of each
12 DMA channel (see child node properties below). 12 DMA channel (see child node properties below).
13 13
diff --git a/Documentation/devicetree/bindings/gpio/ibm,ppc4xx-gpio.txt b/Documentation/devicetree/bindings/gpio/ibm,ppc4xx-gpio.txt
new file mode 100644
index 000000000000..d58b3958f3ea
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/ibm,ppc4xx-gpio.txt
@@ -0,0 +1,24 @@
1* IBM/AMCC/APM GPIO Controller for PowerPC 4XX series and compatible SoCs
2
3All GPIOs are pin-shared with other functions. DCRs control whether a
4particular pin that has GPIO capabilities acts as a GPIO or is used for
5another purpose. GPIO outputs are separately programmable to emulate
6an open-drain driver.
7
8Required properties:
9 - compatible: must be "ibm,ppc4xx-gpio"
10 - reg: address and length of the register set for the device
11 - #gpio-cells: must be set to 2. The first cell is the pin number
12 and the second cell is used to specify the gpio polarity:
13 0 = active high
14 1 = active low
15 - gpio-controller: marks the device node as a gpio controller.
16
17Example:
18
19GPIO0: gpio@ef600b00 {
20 compatible = "ibm,ppc4xx-gpio";
21 reg = <0xef600b00 0x00000048>;
22 #gpio-cells = <2>;
23 gpio-controller;
24};
diff --git a/Documentation/devicetree/bindings/input/ads7846.txt b/Documentation/devicetree/bindings/input/ads7846.txt
index c6cfe2e3ed41..9fc47b006fd1 100644
--- a/Documentation/devicetree/bindings/input/ads7846.txt
+++ b/Documentation/devicetree/bindings/input/ads7846.txt
@@ -29,7 +29,7 @@ Optional properties:
29 ti,vref-delay-usecs vref supply delay in usecs, 0 for 29 ti,vref-delay-usecs vref supply delay in usecs, 0 for
30 external vref (u16). 30 external vref (u16).
31 ti,vref-mv The VREF voltage, in millivolts (u16). 31 ti,vref-mv The VREF voltage, in millivolts (u16).
32 Set to 0 to use internal refernce 32 Set to 0 to use internal references
33 (ADS7846). 33 (ADS7846).
34 ti,keep-vref-on set to keep vref on for differential 34 ti,keep-vref-on set to keep vref on for differential
35 measurements as well 35 measurements as well
diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt b/Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt
index cdf05f9b2329..abfcab3edc66 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/fsl-mx25-tcq.txt
@@ -15,7 +15,7 @@ Optional properties:
15 - fsl,pen-debounce-ns: Pen debounce time in nanoseconds. 15 - fsl,pen-debounce-ns: Pen debounce time in nanoseconds.
16 - fsl,pen-threshold: Pen-down threshold for the touchscreen. This is a value 16 - fsl,pen-threshold: Pen-down threshold for the touchscreen. This is a value
17 between 1 and 4096. It is the ratio between the internal reference voltage 17 between 1 and 4096. It is the ratio between the internal reference voltage
18 and the measured voltage after the plate was precharged. Resistence between 18 and the measured voltage after the plate was precharged. Resistance between
19 plates and therefore the voltage decreases with pressure so that a smaller 19 plates and therefore the voltage decreases with pressure so that a smaller
20 value is equivalent to a higher pressure. 20 value is equivalent to a higher pressure.
21 - fsl,settling-time-ns: Settling time in nanoseconds. The settling time is before 21 - fsl,settling-time-ns: Settling time in nanoseconds. The settling time is before
diff --git a/Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt b/Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt
index b8e1674c7837..8cf564d083d2 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt
@@ -16,8 +16,7 @@ Required properties:
16 "mediatek,mt6577-sysirq" 16 "mediatek,mt6577-sysirq"
17 "mediatek,mt2701-sysirq" 17 "mediatek,mt2701-sysirq"
18- interrupt-controller : Identifies the node as an interrupt controller 18- interrupt-controller : Identifies the node as an interrupt controller
19- #interrupt-cells : Use the same format as specified by GIC in 19- #interrupt-cells : Use the same format as specified by GIC in arm,gic.txt.
20 Documentation/devicetree/bindings/arm/gic.txt
21- interrupt-parent: phandle of irq parent for sysirq. The parent must 20- interrupt-parent: phandle of irq parent for sysirq. The parent must
22 use the same interrupt-cells format as GIC. 21 use the same interrupt-cells format as GIC.
23- reg: Physical base address of the intpol registers and length of memory 22- reg: Physical base address of the intpol registers and length of memory
diff --git a/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt b/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra20-ictlr.txt
index 1099fe0788fa..1099fe0788fa 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra-ictlr.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/nvidia,tegra20-ictlr.txt
diff --git a/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu b/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
index 43effa0a4fe7..18d4f407bf0e 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
+++ b/Documentation/devicetree/bindings/interrupt-controller/ti,omap4-wugen-mpu
@@ -4,7 +4,7 @@ All TI OMAP4/5 (and their derivatives) an interrupt controller that
4routes interrupts to the GIC, and also serves as a wakeup source. It 4routes interrupts to the GIC, and also serves as a wakeup source. It
5is also referred to as "WUGEN-MPU", hence the name of the binding. 5is also referred to as "WUGEN-MPU", hence the name of the binding.
6 6
7Reguired properties: 7Required properties:
8 8
9- compatible : should contain at least "ti,omap4-wugen-mpu" or 9- compatible : should contain at least "ti,omap4-wugen-mpu" or
10 "ti,omap5-wugen-mpu" 10 "ti,omap5-wugen-mpu"
@@ -20,7 +20,7 @@ Notes:
20- Because this HW ultimately routes interrupts to the GIC, the 20- Because this HW ultimately routes interrupts to the GIC, the
21 interrupt specifier must be that of the GIC. 21 interrupt specifier must be that of the GIC.
22- Only SPIs can use the WUGEN as an interrupt parent. SGIs and PPIs 22- Only SPIs can use the WUGEN as an interrupt parent. SGIs and PPIs
23 are explicitly forbiden. 23 are explicitly forbidden.
24 24
25Example: 25Example:
26 26
diff --git a/Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.txt
index b59c625d6336..ba0bc3f12419 100644
--- a/Documentation/devicetree/bindings/memory-controllers/tegra-emc.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.txt
@@ -190,7 +190,7 @@ be specified, according to the board documentation:
190Example SoC include file: 190Example SoC include file:
191 191
192/ { 192/ {
193 emc@0,7001b000 { 193 emc@7001b000 {
194 compatible = "nvidia,tegra124-emc"; 194 compatible = "nvidia,tegra124-emc";
195 reg = <0x0 0x7001b000 0x0 0x1000>; 195 reg = <0x0 0x7001b000 0x0 0x1000>;
196 196
@@ -201,7 +201,7 @@ Example SoC include file:
201Example board file: 201Example board file:
202 202
203/ { 203/ {
204 emc@0,7001b000 { 204 emc@7001b000 {
205 emc-timings-3 { 205 emc-timings-3 {
206 nvidia,ram-code = <3>; 206 nvidia,ram-code = <3>;
207 207
diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.txt
index 3338a2834ad7..8dbe47013c2b 100644
--- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra-mc.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.txt
@@ -61,7 +61,7 @@ specified, according to the board documentation:
61Example SoC include file: 61Example SoC include file:
62 62
63/ { 63/ {
64 mc: memory-controller@0,70019000 { 64 mc: memory-controller@70019000 {
65 compatible = "nvidia,tegra124-mc"; 65 compatible = "nvidia,tegra124-mc";
66 reg = <0x0 0x70019000 0x0 0x1000>; 66 reg = <0x0 0x70019000 0x0 0x1000>;
67 clocks = <&tegra_car TEGRA124_CLK_MC>; 67 clocks = <&tegra_car TEGRA124_CLK_MC>;
@@ -72,7 +72,7 @@ Example SoC include file:
72 #iommu-cells = <1>; 72 #iommu-cells = <1>;
73 }; 73 };
74 74
75 sdhci@0,700b0000 { 75 sdhci@700b0000 {
76 compatible = "nvidia,tegra124-sdhci"; 76 compatible = "nvidia,tegra124-sdhci";
77 ... 77 ...
78 iommus = <&mc TEGRA_SWGROUP_SDMMC1A>; 78 iommus = <&mc TEGRA_SWGROUP_SDMMC1A>;
@@ -82,7 +82,7 @@ Example SoC include file:
82Example board file: 82Example board file:
83 83
84/ { 84/ {
85 memory-controller@0,70019000 { 85 memory-controller@70019000 {
86 emc-timings-3 { 86 emc-timings-3 {
87 nvidia,ram-code = <3>; 87 nvidia,ram-code = <3>;
88 88
diff --git a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
index 5e97a9593ad7..b98b291a31ba 100644
--- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
+++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
@@ -178,7 +178,7 @@ see regulator.txt - with additional custom properties described below:
178- qcom,force-mode: 178- qcom,force-mode:
179 Usage: optional (default if no other qcom,force-mode is specified) 179 Usage: optional (default if no other qcom,force-mode is specified)
180 Value type: <u32> 180 Value type: <u32>
181 Defintion: indicates that the regulator should be forced to a 181 Definition: indicates that the regulator should be forced to a
182 particular mode, valid values are: 182 particular mode, valid values are:
183 QCOM_RPM_FORCE_MODE_NONE - do not force any mode 183 QCOM_RPM_FORCE_MODE_NONE - do not force any mode
184 QCOM_RPM_FORCE_MODE_LPM - force into low power mode 184 QCOM_RPM_FORCE_MODE_LPM - force into low power mode
@@ -204,7 +204,7 @@ see regulator.txt - with additional custom properties described below:
204- qcom,force-mode: 204- qcom,force-mode:
205 Usage: optional 205 Usage: optional
206 Value type: <u32> 206 Value type: <u32>
207 Defintion: indicates that the regulator should not be forced to any 207 Definition: indicates that the regulator should not be forced to any
208 particular mode, valid values are: 208 particular mode, valid values are:
209 QCOM_RPM_FORCE_MODE_NONE - do not force any mode 209 QCOM_RPM_FORCE_MODE_NONE - do not force any mode
210 QCOM_RPM_FORCE_MODE_LPM - force into low power mode 210 QCOM_RPM_FORCE_MODE_LPM - force into low power mode
diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt
index 0cb827bf9435..3d965d57e00b 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-emmc.txt
@@ -1,7 +1,7 @@
1* The simple eMMC hardware reset provider 1* The simple eMMC hardware reset provider
2 2
3The purpose of this driver is to perform standard eMMC hw reset 3The purpose of this driver is to perform standard eMMC hw reset
4procedure, as descibed by Jedec 4.4 specification. This procedure is 4procedure, as described by Jedec 4.4 specification. This procedure is
5performed just after MMC core enabled power to the given mmc host (to 5performed just after MMC core enabled power to the given mmc host (to
6fix possible issues if bootloader has left eMMC card in initialized or 6fix possible issues if bootloader has left eMMC card in initialized or
7unknown state), and before performing complete system reboot (also in 7unknown state), and before performing complete system reboot (also in
diff --git a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt
index c2546ced9c02..0f6985b5de49 100644
--- a/Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt
+++ b/Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt
@@ -52,7 +52,7 @@ Optional properties:
52 v7.0. Use this property to describe the rare 52 v7.0. Use this property to describe the rare
53 earlier versions of this core that include WP 53 earlier versions of this core that include WP
54 54
55 -- Additonal SoC-specific NAND controller properties -- 55 -- Additional SoC-specific NAND controller properties --
56 56
57The NAND controller is integrated differently on the variety of SoCs on which it 57The NAND controller is integrated differently on the variety of SoCs on which it
58is found. Part of this integration involves providing status and enable bits 58is found. Part of this integration involves providing status and enable bits
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt b/Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
index b9ff4ba6454e..f0421ee3c714 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-nic.txt
@@ -8,7 +8,7 @@ Required properties:
8 specifies a reference to the associating hardware driver node. 8 specifies a reference to the associating hardware driver node.
9 see Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt 9 see Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
10- port-id: is the index of port provided by DSAF (the accelerator). DSAF can 10- port-id: is the index of port provided by DSAF (the accelerator). DSAF can
11 connect to 8 PHYs. Port 0 to 1 are both used for adminstration purpose. They 11 connect to 8 PHYs. Port 0 to 1 are both used for administration purpose. They
12 are called debug ports. 12 are called debug ports.
13 13
14 The remaining 6 PHYs are taken according to the mode of DSAF. 14 The remaining 6 PHYs are taken according to the mode of DSAF.
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index 4d302db657c0..95816c5fc589 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -51,8 +51,8 @@ Optional properties:
51 AXI register inside the DMA module: 51 AXI register inside the DMA module:
52 - snps,lpi_en: enable Low Power Interface 52 - snps,lpi_en: enable Low Power Interface
53 - snps,xit_frm: unlock on WoL 53 - snps,xit_frm: unlock on WoL
54 - snps,wr_osr_lmt: max write oustanding req. limit 54 - snps,wr_osr_lmt: max write outstanding req. limit
55 - snps,rd_osr_lmt: max read oustanding req. limit 55 - snps,rd_osr_lmt: max read outstanding req. limit
56 - snps,kbbe: do not cross 1KiB boundary. 56 - snps,kbbe: do not cross 1KiB boundary.
57 - snps,axi_all: align address 57 - snps,axi_all: align address
58 - snps,blen: this is a vector of supported burst length. 58 - snps,blen: this is a vector of supported burst length.
diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt
index 58d935b58598..5d21141a68b5 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.txt
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt
@@ -2,7 +2,7 @@
2 2
3Required properties: 3Required properties:
4 - reg - The ID number for the phy, usually a small integer 4 - reg - The ID number for the phy, usually a small integer
5 - ti,rx-internal-delay - RGMII Recieve Clock Delay - see dt-bindings/net/ti-dp83867.h 5 - ti,rx-internal-delay - RGMII Receive Clock Delay - see dt-bindings/net/ti-dp83867.h
6 for applicable values 6 for applicable values
7 - ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h 7 - ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h
8 for applicable values 8 for applicable values
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt
index 601256fe8c0d..ee91cbdd95ee 100644
--- a/Documentation/devicetree/bindings/opp/opp.txt
+++ b/Documentation/devicetree/bindings/opp/opp.txt
@@ -45,7 +45,7 @@ Devices supporting OPPs must set their "operating-points-v2" property with
45phandle to a OPP table in their DT node. The OPP core will use this phandle to 45phandle to a OPP table in their DT node. The OPP core will use this phandle to
46find the operating points for the device. 46find the operating points for the device.
47 47
48If required, this can be extended for SoC vendor specfic bindings. Such bindings 48If required, this can be extended for SoC vendor specific bindings. Such bindings
49should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt 49should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt
50and should have a compatible description like: "operating-points-v2-<vendor>". 50and should have a compatible description like: "operating-points-v2-<vendor>".
51 51
diff --git a/Documentation/devicetree/bindings/pci/designware-pcie.txt b/Documentation/devicetree/bindings/pci/designware-pcie.txt
index 64f2fff12128..6c5322c55411 100644
--- a/Documentation/devicetree/bindings/pci/designware-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/designware-pcie.txt
@@ -31,7 +31,7 @@ Optional properties:
31 31
32Example configuration: 32Example configuration:
33 33
34 pcie: pcie@0xdffff000 { 34 pcie: pcie@dffff000 {
35 compatible = "snps,dw-pcie"; 35 compatible = "snps,dw-pcie";
36 reg = <0xdffff000 0x1000>, /* Controller registers */ 36 reg = <0xdffff000 0x1000>, /* Controller registers */
37 <0xd0000000 0x2000>; /* PCI config space */ 37 <0xd0000000 0x2000>; /* PCI config space */
diff --git a/Documentation/devicetree/bindings/pci/hisilicon-pcie.txt b/Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
index b721beacfe4d..59c2f47aa303 100644
--- a/Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/hisilicon-pcie.txt
@@ -34,11 +34,11 @@ Hip05 Example (note that Hip06 is the same except compatible):
34 ranges = <0x82000000 0 0x00000000 0x220 0x00000000 0 0x10000000>; 34 ranges = <0x82000000 0 0x00000000 0x220 0x00000000 0 0x10000000>;
35 num-lanes = <8>; 35 num-lanes = <8>;
36 port-id = <1>; 36 port-id = <1>;
37 #interrupts-cells = <1>; 37 #interrupt-cells = <1>;
38 interrupts-map-mask = <0xf800 0 0 7>; 38 interrupt-map-mask = <0xf800 0 0 7>;
39 interrupts-map = <0x0 0 0 1 &mbigen_pcie 1 10 39 interrupt-map = <0x0 0 0 1 &mbigen_pcie 1 10
40 0x0 0 0 2 &mbigen_pcie 2 11 40 0x0 0 0 2 &mbigen_pcie 2 11
41 0x0 0 0 3 &mbigen_pcie 3 12 41 0x0 0 0 3 &mbigen_pcie 3 12
42 0x0 0 0 4 &mbigen_pcie 4 13>; 42 0x0 0 0 4 &mbigen_pcie 4 13>;
43 status = "ok"; 43 status = "ok";
44 }; 44 };
diff --git a/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt b/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt
index 00944a05ee6b..744b4809542e 100644
--- a/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt
+++ b/Documentation/devicetree/bindings/phy/phy-stih41x-usb.txt
@@ -17,7 +17,7 @@ Example:
17 17
18usb2_phy: usb2phy@0 { 18usb2_phy: usb2phy@0 {
19 compatible = "st,stih416-usb-phy"; 19 compatible = "st,stih416-usb-phy";
20 #phy-cell = <0>; 20 #phy-cells = <0>;
21 st,syscfg = <&syscfg_rear>; 21 st,syscfg = <&syscfg_rear>;
22 clocks = <&clk_sysin>; 22 clocks = <&clk_sysin>;
23 clock-names = "osc_phy"; 23 clock-names = "osc_phy";
diff --git a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt
index 8a6223dbc143..4048f43a9d29 100644
--- a/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt
@@ -85,7 +85,7 @@ Example:
85SoC file extract: 85SoC file extract:
86----------------- 86-----------------
87 87
88 padctl@0,7009f000 { 88 padctl@7009f000 {
89 compatible = "nvidia,tegra124-xusb-padctl"; 89 compatible = "nvidia,tegra124-xusb-padctl";
90 reg = <0x0 0x7009f000 0x0 0x1000>; 90 reg = <0x0 0x7009f000 0x0 0x1000>;
91 resets = <&tegra_car 142>; 91 resets = <&tegra_car 142>;
@@ -97,7 +97,7 @@ SoC file extract:
97Board file extract: 97Board file extract:
98------------------- 98-------------------
99 99
100 pcie-controller@0,01003000 { 100 pcie-controller@01003000 {
101 ... 101 ...
102 102
103 phys = <&padctl 0>; 103 phys = <&padctl 0>;
@@ -108,7 +108,7 @@ Board file extract:
108 108
109 ... 109 ...
110 110
111 padctl: padctl@0,7009f000 { 111 padctl: padctl@7009f000 {
112 pinctrl-0 = <&padctl_default>; 112 pinctrl-0 = <&padctl_default>;
113 pinctrl-names = "default"; 113 pinctrl-names = "default";
114 114
diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
index a90c812ad642..a54c39ebbf8b 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt
@@ -122,7 +122,7 @@ to specify in a pin configuration subnode:
122 2: 1.5uA (PMIC_GPIO_PULL_UP_1P5) 122 2: 1.5uA (PMIC_GPIO_PULL_UP_1P5)
123 3: 31.5uA (PMIC_GPIO_PULL_UP_31P5) 123 3: 31.5uA (PMIC_GPIO_PULL_UP_31P5)
124 4: 1.5uA + 30uA boost (PMIC_GPIO_PULL_UP_1P5_30) 124 4: 1.5uA + 30uA boost (PMIC_GPIO_PULL_UP_1P5_30)
125 If this property is ommited 30uA strength will be used if 125 If this property is omitted 30uA strength will be used if
126 pull up is selected 126 pull up is selected
127 127
128- bias-high-impedance: 128- bias-high-impedance:
diff --git a/Documentation/devicetree/bindings/power/qcom,coincell-charger.txt b/Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
index 0e6d8754e7ec..747899223262 100644
--- a/Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
+++ b/Documentation/devicetree/bindings/power/qcom,coincell-charger.txt
@@ -29,7 +29,7 @@ IC (PMIC)
29- qcom,charger-disable: 29- qcom,charger-disable:
30 Usage: optional 30 Usage: optional
31 Value type: <boolean> 31 Value type: <boolean>
32 Definition: definining this property disables charging 32 Definition: defining this property disables charging
33 33
34This charger is a sub-node of one of the 8941 PMIC blocks, and is specified 34This charger is a sub-node of one of the 8941 PMIC blocks, and is specified
35as a child node in DTS of that node. See ../mfd/qcom,spmi-pmic.txt and 35as a child node in DTS of that node. See ../mfd/qcom,spmi-pmic.txt and
diff --git a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
index 725393c8a7f2..99872819604f 100644
--- a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
+++ b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt
@@ -1,5 +1,12 @@
1* palmas regulator IP block devicetree bindings 1* palmas regulator IP block devicetree bindings
2 2
3The tps659038 for the AM57x class have OTP spins that
4have different part numbers but the same functionality. There
5is not a need to add the OTP spins to the palmas driver. The
6spin devices should use the tps659038 as it's compatible value.
7This is the list of those devices:
8tps659037
9
3Required properties: 10Required properties:
4- compatible : Should be from the list 11- compatible : Should be from the list
5 ti,twl6035-pmic 12 ti,twl6035-pmic
@@ -8,6 +15,7 @@ Required properties:
8 ti,tps65913-pmic 15 ti,tps65913-pmic
9 ti,tps65914-pmic 16 ti,tps65914-pmic
10 ti,tps65917-pmic 17 ti,tps65917-pmic
18 ti,tps659038-pmic
11and also the generic series names 19and also the generic series names
12 ti,palmas-pmic 20 ti,palmas-pmic
13- interrupt-parent : The parent interrupt controller which is palmas. 21- interrupt-parent : The parent interrupt controller which is palmas.
diff --git a/Documentation/devicetree/bindings/rtc/rtc-palmas.txt b/Documentation/devicetree/bindings/rtc/rtc-palmas.txt
index adbccc0a51e1..eb1c7fdeb413 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-palmas.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-palmas.txt
@@ -15,9 +15,9 @@ Optional properties:
15 battery is chargeable or not. If charging battery then driver can 15 battery is chargeable or not. If charging battery then driver can
16 enable the charging. 16 enable the charging.
17- ti,backup-battery-charge-high-current: Enable high current charging in 17- ti,backup-battery-charge-high-current: Enable high current charging in
18 backup battery. Device supports the < 100mA and > 100mA charging. 18 backup battery. Device supports the < 100uA and > 100uA charging.
19 The high current will be > 100mA. Absence of this property will 19 The high current will be > 100uA. Absence of this property will
20 charge battery to lower current i.e. < 100mA. 20 charge battery to lower current i.e. < 100uA.
21 21
22Example: 22Example:
23 palmas: tps65913@58 { 23 palmas: tps65913@58 {
diff --git a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt b/Documentation/devicetree/bindings/serial/mvebu-uart.txt
index 6087defd9f93..6087defd9f93 100644
--- a/Documentation/devicetree/bindings/tty/serial/mvebu-uart.txt
+++ b/Documentation/devicetree/bindings/serial/mvebu-uart.txt
diff --git a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
index d1ce21a4904d..64c66a5644e7 100644
--- a/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
+++ b/Documentation/devicetree/bindings/soc/ti/keystone-navigator-qmss.txt
@@ -42,7 +42,7 @@ Required properties:
42- queue-pools : child node classifying the queue ranges into pools. 42- queue-pools : child node classifying the queue ranges into pools.
43 Queue ranges are grouped into 3 type of pools: 43 Queue ranges are grouped into 3 type of pools:
44 - qpend : pool of qpend(interruptible) queues 44 - qpend : pool of qpend(interruptible) queues
45 - general-purpose : pool of general queues, primarly used 45 - general-purpose : pool of general queues, primarily used
46 as free descriptor queues or the 46 as free descriptor queues or the
47 transmit DMA queues. 47 transmit DMA queues.
48 - accumulator : pool of queues on PDSP accumulator channel 48 - accumulator : pool of queues on PDSP accumulator channel
@@ -50,7 +50,7 @@ Required properties:
50 -- qrange : number of queues to use per queue range, specified as 50 -- qrange : number of queues to use per queue range, specified as
51 <"base queue #" "# of queues">. 51 <"base queue #" "# of queues">.
52 -- interrupts : Optional property to specify the interrupt mapping 52 -- interrupts : Optional property to specify the interrupt mapping
53 for interruptible queues. The driver additionaly sets 53 for interruptible queues. The driver additionally sets
54 the interrupt affinity hint based on the cpu mask. 54 the interrupt affinity hint based on the cpu mask.
55 -- qalloc-by-id : Optional property to specify that the queues in this 55 -- qalloc-by-id : Optional property to specify that the queues in this
56 range can only be allocated by queue id. 56 range can only be allocated by queue id.
@@ -80,7 +80,7 @@ Required properties:
80 latency : time to delay the interrupt, specified 80 latency : time to delay the interrupt, specified
81 in microseconds. 81 in microseconds.
82 -- multi-queue : Optional property to specify that the channel has to 82 -- multi-queue : Optional property to specify that the channel has to
83 monitor upto 32 queues starting at the base queue #. 83 monitor up to 32 queues starting at the base queue #.
84- descriptor-regions : child node describing the memory regions for keystone 84- descriptor-regions : child node describing the memory regions for keystone
85 navigator packet DMA descriptors. The memory for 85 navigator packet DMA descriptors. The memory for
86 descriptors will be allocated by the driver. 86 descriptors will be allocated by the driver.
diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt
index 275c6ea356f6..44d27456e8a4 100644
--- a/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt
+++ b/Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.txt
@@ -15,7 +15,7 @@ Required properties:
15 15
16Example: 16Example:
17 17
18hda@0,70030000 { 18hda@70030000 {
19 compatible = "nvidia,tegra124-hda", "nvidia,tegra30-hda"; 19 compatible = "nvidia,tegra124-hda", "nvidia,tegra30-hda";
20 reg = <0x0 0x70030000 0x0 0x10000>; 20 reg = <0x0 0x70030000 0x0 0x10000>;
21 interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>; 21 interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/Documentation/devicetree/bindings/sram/sram.txt b/Documentation/devicetree/bindings/sram/sram.txt
index 227e3a341af1..add48f09015e 100644
--- a/Documentation/devicetree/bindings/sram/sram.txt
+++ b/Documentation/devicetree/bindings/sram/sram.txt
@@ -51,7 +51,7 @@ sram: sram@5c000000 {
51 compatible = "mmio-sram"; 51 compatible = "mmio-sram";
52 reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ 52 reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */
53 53
54 #adress-cells = <1>; 54 #address-cells = <1>;
55 #size-cells = <1>; 55 #size-cells = <1>;
56 ranges = <0 0x5c000000 0x40000>; 56 ranges = <0 0x5c000000 0x40000>;
57 57
diff --git a/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt b/Documentation/devicetree/bindings/thermal/nvidia,tegra124-soctherm.txt
index 6b68cd150405..6908d3aca598 100644
--- a/Documentation/devicetree/bindings/thermal/tegra-soctherm.txt
+++ b/Documentation/devicetree/bindings/thermal/nvidia,tegra124-soctherm.txt
@@ -29,7 +29,7 @@ Required properties :
29 29
30Example : 30Example :
31 31
32 soctherm@0,700e2000 { 32 soctherm@700e2000 {
33 compatible = "nvidia,tegra124-soctherm"; 33 compatible = "nvidia,tegra124-soctherm";
34 reg = <0x0 0x700e2000 0x0 0x1000>; 34 reg = <0x0 0x700e2000 0x0 0x1000>;
35 interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; 35 interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 316412dc7913..32f965807a07 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -28,6 +28,7 @@ aptina Aptina Imaging
28arasan Arasan Chip Systems 28arasan Arasan Chip Systems
29arm ARM Ltd. 29arm ARM Ltd.
30armadeus ARMadeus Systems SARL 30armadeus ARMadeus Systems SARL
31arrow Arrow Electronics
31artesyn Artesyn Embedded Technologies Inc. 32artesyn Artesyn Embedded Technologies Inc.
32asahi-kasei Asahi Kasei Corp. 33asahi-kasei Asahi Kasei Corp.
33aspeed ASPEED Technology Inc. 34aspeed ASPEED Technology Inc.
@@ -60,6 +61,7 @@ cnxt Conexant Systems, Inc.
60compulab CompuLab Ltd. 61compulab CompuLab Ltd.
61cortina Cortina Systems, Inc. 62cortina Cortina Systems, Inc.
62cosmic Cosmic Circuits 63cosmic Cosmic Circuits
64creative Creative Technology Ltd
63crystalfontz Crystalfontz America, Inc. 65crystalfontz Crystalfontz America, Inc.
64cubietech Cubietech, Ltd. 66cubietech Cubietech, Ltd.
65cypress Cypress Semiconductor Corporation 67cypress Cypress Semiconductor Corporation
@@ -79,6 +81,7 @@ ebv EBV Elektronik
79edt Emerging Display Technologies 81edt Emerging Display Technologies
80eeti eGalax_eMPIA Technology Inc 82eeti eGalax_eMPIA Technology Inc
81elan Elan Microelectronic Corp. 83elan Elan Microelectronic Corp.
84embest Shenzhen Embest Technology Co., Ltd.
82emmicro EM Microelectronic 85emmicro EM Microelectronic
83energymicro Silicon Laboratories (formerly Energy Micro AS) 86energymicro Silicon Laboratories (formerly Energy Micro AS)
84epcos EPCOS AG 87epcos EPCOS AG
@@ -124,6 +127,7 @@ idt Integrated Device Technologies, Inc.
124ifi Ingenieurburo Fur Ic-Technologie (I/F/I) 127ifi Ingenieurburo Fur Ic-Technologie (I/F/I)
125iom Iomega Corporation 128iom Iomega Corporation
126img Imagination Technologies Ltd. 129img Imagination Technologies Ltd.
130inforce Inforce Computing
127ingenic Ingenic Semiconductor 131ingenic Ingenic Semiconductor
128innolux Innolux Corporation 132innolux Innolux Corporation
129intel Intel Corporation 133intel Intel Corporation
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index 106679bca6cb..f9c79dabce20 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -157,7 +157,7 @@ struct device_node * __init tilcdc_get_overlay(struct kfree_table *kft)
157 if (!overlay_data || kfree_table_add(kft, overlay_data)) 157 if (!overlay_data || kfree_table_add(kft, overlay_data))
158 return NULL; 158 return NULL;
159 159
160 of_fdt_unflatten_tree(overlay_data, &overlay); 160 of_fdt_unflatten_tree(overlay_data, NULL, &overlay);
161 if (!overlay) { 161 if (!overlay) {
162 pr_warn("%s: Unfattening overlay tree failed\n", __func__); 162 pr_warn("%s: Unfattening overlay tree failed\n", __func__);
163 return NULL; 163 return NULL;
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 0360919a5737..e206ce7a4e4b 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -50,7 +50,7 @@
50#include "io-pgtable.h" 50#include "io-pgtable.h"
51 51
52/* Maximum number of stream IDs assigned to a single device */ 52/* Maximum number of stream IDs assigned to a single device */
53#define MAX_MASTER_STREAMIDS MAX_PHANDLE_ARGS 53#define MAX_MASTER_STREAMIDS 128
54 54
55/* Maximum number of context banks per SMMU */ 55/* Maximum number of context banks per SMMU */
56#define ARM_SMMU_MAX_CBS 128 56#define ARM_SMMU_MAX_CBS 128
@@ -397,6 +397,12 @@ struct arm_smmu_domain {
397 struct iommu_domain domain; 397 struct iommu_domain domain;
398}; 398};
399 399
400struct arm_smmu_phandle_args {
401 struct device_node *np;
402 int args_count;
403 uint32_t args[MAX_MASTER_STREAMIDS];
404};
405
400static DEFINE_SPINLOCK(arm_smmu_devices_lock); 406static DEFINE_SPINLOCK(arm_smmu_devices_lock);
401static LIST_HEAD(arm_smmu_devices); 407static LIST_HEAD(arm_smmu_devices);
402 408
@@ -506,7 +512,7 @@ static int insert_smmu_master(struct arm_smmu_device *smmu,
506 512
507static int register_smmu_master(struct arm_smmu_device *smmu, 513static int register_smmu_master(struct arm_smmu_device *smmu,
508 struct device *dev, 514 struct device *dev,
509 struct of_phandle_args *masterspec) 515 struct arm_smmu_phandle_args *masterspec)
510{ 516{
511 int i; 517 int i;
512 struct arm_smmu_master *master; 518 struct arm_smmu_master *master;
@@ -1875,7 +1881,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
1875 struct arm_smmu_device *smmu; 1881 struct arm_smmu_device *smmu;
1876 struct device *dev = &pdev->dev; 1882 struct device *dev = &pdev->dev;
1877 struct rb_node *node; 1883 struct rb_node *node;
1878 struct of_phandle_args masterspec; 1884 struct of_phandle_iterator it;
1885 struct arm_smmu_phandle_args *masterspec;
1879 int num_irqs, i, err; 1886 int num_irqs, i, err;
1880 1887
1881 smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL); 1888 smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL);
@@ -1938,20 +1945,35 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
1938 1945
1939 i = 0; 1946 i = 0;
1940 smmu->masters = RB_ROOT; 1947 smmu->masters = RB_ROOT;
1941 while (!of_parse_phandle_with_args(dev->of_node, "mmu-masters", 1948
1942 "#stream-id-cells", i, 1949 err = -ENOMEM;
1943 &masterspec)) { 1950 /* No need to zero the memory for masterspec */
1944 err = register_smmu_master(smmu, dev, &masterspec); 1951 masterspec = kmalloc(sizeof(*masterspec), GFP_KERNEL);
1952 if (!masterspec)
1953 goto out_put_masters;
1954
1955 of_for_each_phandle(&it, err, dev->of_node,
1956 "mmu-masters", "#stream-id-cells", 0) {
1957 int count = of_phandle_iterator_args(&it, masterspec->args,
1958 MAX_MASTER_STREAMIDS);
1959 masterspec->np = of_node_get(it.node);
1960 masterspec->args_count = count;
1961
1962 err = register_smmu_master(smmu, dev, masterspec);
1945 if (err) { 1963 if (err) {
1946 dev_err(dev, "failed to add master %s\n", 1964 dev_err(dev, "failed to add master %s\n",
1947 masterspec.np->name); 1965 masterspec->np->name);
1966 kfree(masterspec);
1948 goto out_put_masters; 1967 goto out_put_masters;
1949 } 1968 }
1950 1969
1951 i++; 1970 i++;
1952 } 1971 }
1972
1953 dev_notice(dev, "registered %d master devices\n", i); 1973 dev_notice(dev, "registered %d master devices\n", i);
1954 1974
1975 kfree(masterspec);
1976
1955 parse_driver_options(smmu); 1977 parse_driver_options(smmu);
1956 1978
1957 if (smmu->version == ARM_SMMU_V2 && 1979 if (smmu->version == ARM_SMMU_V2 &&
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 64018ebcc861..ebf84e3b56d5 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -394,7 +394,8 @@ bool __weak arch_find_n_match_cpu_physical_id(struct device_node *cpun,
394 * before booting secondary cores. This function uses arch_match_cpu_phys_id 394 * before booting secondary cores. This function uses arch_match_cpu_phys_id
395 * which can be overridden by architecture specific implementation. 395 * which can be overridden by architecture specific implementation.
396 * 396 *
397 * Returns a node pointer for the logical cpu if found, else NULL. 397 * Returns a node pointer for the logical cpu with refcount incremented, use
398 * of_node_put() on it when done. Returns NULL if not found.
398 */ 399 */
399struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) 400struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
400{ 401{
@@ -1440,106 +1441,155 @@ void of_print_phandle_args(const char *msg, const struct of_phandle_args *args)
1440 printk("\n"); 1441 printk("\n");
1441} 1442}
1442 1443
1443static int __of_parse_phandle_with_args(const struct device_node *np, 1444int of_phandle_iterator_init(struct of_phandle_iterator *it,
1444 const char *list_name, 1445 const struct device_node *np,
1445 const char *cells_name, 1446 const char *list_name,
1446 int cell_count, int index, 1447 const char *cells_name,
1447 struct of_phandle_args *out_args) 1448 int cell_count)
1448{ 1449{
1449 const __be32 *list, *list_end; 1450 const __be32 *list;
1450 int rc = 0, size, cur_index = 0; 1451 int size;
1451 uint32_t count = 0; 1452
1452 struct device_node *node = NULL; 1453 memset(it, 0, sizeof(*it));
1453 phandle phandle;
1454 1454
1455 /* Retrieve the phandle list property */
1456 list = of_get_property(np, list_name, &size); 1455 list = of_get_property(np, list_name, &size);
1457 if (!list) 1456 if (!list)
1458 return -ENOENT; 1457 return -ENOENT;
1459 list_end = list + size / sizeof(*list);
1460 1458
1461 /* Loop over the phandles until all the requested entry is found */ 1459 it->cells_name = cells_name;
1462 while (list < list_end) { 1460 it->cell_count = cell_count;
1463 rc = -EINVAL; 1461 it->parent = np;
1464 count = 0; 1462 it->list_end = list + size / sizeof(*list);
1463 it->phandle_end = list;
1464 it->cur = list;
1465
1466 return 0;
1467}
1468
1469int of_phandle_iterator_next(struct of_phandle_iterator *it)
1470{
1471 uint32_t count = 0;
1472
1473 if (it->node) {
1474 of_node_put(it->node);
1475 it->node = NULL;
1476 }
1477
1478 if (!it->cur || it->phandle_end >= it->list_end)
1479 return -ENOENT;
1480
1481 it->cur = it->phandle_end;
1482
1483 /* If phandle is 0, then it is an empty entry with no arguments. */
1484 it->phandle = be32_to_cpup(it->cur++);
1485
1486 if (it->phandle) {
1465 1487
1466 /* 1488 /*
1467 * If phandle is 0, then it is an empty entry with no 1489 * Find the provider node and parse the #*-cells property to
1468 * arguments. Skip forward to the next entry. 1490 * determine the argument length.
1469 */ 1491 */
1470 phandle = be32_to_cpup(list++); 1492 it->node = of_find_node_by_phandle(it->phandle);
1471 if (phandle) {
1472 /*
1473 * Find the provider node and parse the #*-cells
1474 * property to determine the argument length.
1475 *
1476 * This is not needed if the cell count is hard-coded
1477 * (i.e. cells_name not set, but cell_count is set),
1478 * except when we're going to return the found node
1479 * below.
1480 */
1481 if (cells_name || cur_index == index) {
1482 node = of_find_node_by_phandle(phandle);
1483 if (!node) {
1484 pr_err("%s: could not find phandle\n",
1485 np->full_name);
1486 goto err;
1487 }
1488 }
1489 1493
1490 if (cells_name) { 1494 if (it->cells_name) {
1491 if (of_property_read_u32(node, cells_name, 1495 if (!it->node) {
1492 &count)) { 1496 pr_err("%s: could not find phandle\n",
1493 pr_err("%s: could not get %s for %s\n", 1497 it->parent->full_name);
1494 np->full_name, cells_name, 1498 goto err;
1495 node->full_name);
1496 goto err;
1497 }
1498 } else {
1499 count = cell_count;
1500 } 1499 }
1501 1500
1502 /* 1501 if (of_property_read_u32(it->node, it->cells_name,
1503 * Make sure that the arguments actually fit in the 1502 &count)) {
1504 * remaining property data length 1503 pr_err("%s: could not get %s for %s\n",
1505 */ 1504 it->parent->full_name,
1506 if (list + count > list_end) { 1505 it->cells_name,
1507 pr_err("%s: arguments longer than property\n", 1506 it->node->full_name);
1508 np->full_name);
1509 goto err; 1507 goto err;
1510 } 1508 }
1509 } else {
1510 count = it->cell_count;
1511 } 1511 }
1512 1512
1513 /* 1513 /*
1514 * All of the error cases above bail out of the loop, so at 1514 * Make sure that the arguments actually fit in the remaining
1515 * property data length
1516 */
1517 if (it->cur + count > it->list_end) {
1518 pr_err("%s: arguments longer than property\n",
1519 it->parent->full_name);
1520 goto err;
1521 }
1522 }
1523
1524 it->phandle_end = it->cur + count;
1525 it->cur_count = count;
1526
1527 return 0;
1528
1529err:
1530 if (it->node) {
1531 of_node_put(it->node);
1532 it->node = NULL;
1533 }
1534
1535 return -EINVAL;
1536}
1537
1538int of_phandle_iterator_args(struct of_phandle_iterator *it,
1539 uint32_t *args,
1540 int size)
1541{
1542 int i, count;
1543
1544 count = it->cur_count;
1545
1546 if (WARN_ON(size < count))
1547 count = size;
1548
1549 for (i = 0; i < count; i++)
1550 args[i] = be32_to_cpup(it->cur++);
1551
1552 return count;
1553}
1554
1555static int __of_parse_phandle_with_args(const struct device_node *np,
1556 const char *list_name,
1557 const char *cells_name,
1558 int cell_count, int index,
1559 struct of_phandle_args *out_args)
1560{
1561 struct of_phandle_iterator it;
1562 int rc, cur_index = 0;
1563
1564 /* Loop over the phandles until all the requested entry is found */
1565 of_for_each_phandle(&it, rc, np, list_name, cells_name, cell_count) {
1566 /*
1567 * All of the error cases bail out of the loop, so at
1515 * this point, the parsing is successful. If the requested 1568 * this point, the parsing is successful. If the requested
1516 * index matches, then fill the out_args structure and return, 1569 * index matches, then fill the out_args structure and return,
1517 * or return -ENOENT for an empty entry. 1570 * or return -ENOENT for an empty entry.
1518 */ 1571 */
1519 rc = -ENOENT; 1572 rc = -ENOENT;
1520 if (cur_index == index) { 1573 if (cur_index == index) {
1521 if (!phandle) 1574 if (!it.phandle)
1522 goto err; 1575 goto err;
1523 1576
1524 if (out_args) { 1577 if (out_args) {
1525 int i; 1578 int c;
1526 if (WARN_ON(count > MAX_PHANDLE_ARGS)) 1579
1527 count = MAX_PHANDLE_ARGS; 1580 c = of_phandle_iterator_args(&it,
1528 out_args->np = node; 1581 out_args->args,
1529 out_args->args_count = count; 1582 MAX_PHANDLE_ARGS);
1530 for (i = 0; i < count; i++) 1583 out_args->np = it.node;
1531 out_args->args[i] = be32_to_cpup(list++); 1584 out_args->args_count = c;
1532 } else { 1585 } else {
1533 of_node_put(node); 1586 of_node_put(it.node);
1534 } 1587 }
1535 1588
1536 /* Found it! return success */ 1589 /* Found it! return success */
1537 return 0; 1590 return 0;
1538 } 1591 }
1539 1592
1540 of_node_put(node);
1541 node = NULL;
1542 list += count;
1543 cur_index++; 1593 cur_index++;
1544 } 1594 }
1545 1595
@@ -1547,12 +1597,11 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
1547 * Unlock node before returning result; will be one of: 1597 * Unlock node before returning result; will be one of:
1548 * -ENOENT : index is for empty phandle 1598 * -ENOENT : index is for empty phandle
1549 * -EINVAL : parsing error on data 1599 * -EINVAL : parsing error on data
1550 * [1..n] : Number of phandle (count mode; when index = -1)
1551 */ 1600 */
1552 rc = index < 0 ? cur_index : -ENOENT; 1601
1553 err: 1602 err:
1554 if (node) 1603 if (it.node)
1555 of_node_put(node); 1604 of_node_put(it.node);
1556 return rc; 1605 return rc;
1557} 1606}
1558 1607
@@ -1684,8 +1733,20 @@ EXPORT_SYMBOL(of_parse_phandle_with_fixed_args);
1684int of_count_phandle_with_args(const struct device_node *np, const char *list_name, 1733int of_count_phandle_with_args(const struct device_node *np, const char *list_name,
1685 const char *cells_name) 1734 const char *cells_name)
1686{ 1735{
1687 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, -1, 1736 struct of_phandle_iterator it;
1688 NULL); 1737 int rc, cur_index = 0;
1738
1739 rc = of_phandle_iterator_init(&it, np, list_name, cells_name, 0);
1740 if (rc)
1741 return rc;
1742
1743 while ((rc = of_phandle_iterator_next(&it)) == 0)
1744 cur_index += 1;
1745
1746 if (rc != -ENOENT)
1747 return rc;
1748
1749 return cur_index;
1689} 1750}
1690EXPORT_SYMBOL(of_count_phandle_with_args); 1751EXPORT_SYMBOL(of_count_phandle_with_args);
1691 1752
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index c647bd1b6903..3033fa3250dc 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -311,6 +311,7 @@ int of_detach_node(struct device_node *np)
311 311
312 return rc; 312 return rc;
313} 313}
314EXPORT_SYMBOL_GPL(of_detach_node);
314 315
315/** 316/**
316 * of_node_release() - release a dynamically allocated node 317 * of_node_release() - release a dynamically allocated node
@@ -497,6 +498,11 @@ static void __of_changeset_entry_invert(struct of_changeset_entry *ce,
497 case OF_RECONFIG_UPDATE_PROPERTY: 498 case OF_RECONFIG_UPDATE_PROPERTY:
498 rce->old_prop = ce->prop; 499 rce->old_prop = ce->prop;
499 rce->prop = ce->old_prop; 500 rce->prop = ce->old_prop;
501 /* update was used but original property did not exist */
502 if (!rce->prop) {
503 rce->action = OF_RECONFIG_REMOVE_PROPERTY;
504 rce->prop = ce->prop;
505 }
500 break; 506 break;
501 } 507 }
502} 508}
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 3349d2aa6634..14f2f8c7c260 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -161,39 +161,127 @@ static void *unflatten_dt_alloc(void **mem, unsigned long size,
161 return res; 161 return res;
162} 162}
163 163
164/** 164static void populate_properties(const void *blob,
165 * unflatten_dt_node - Alloc and populate a device_node from the flat tree 165 int offset,
166 * @blob: The parent device tree blob 166 void **mem,
167 * @mem: Memory chunk to use for allocating device nodes and properties 167 struct device_node *np,
168 * @poffset: pointer to node in flat tree 168 const char *nodename,
169 * @dad: Parent struct device_node
170 * @nodepp: The device_node tree created by the call
171 * @fpsize: Size of the node path up at the current depth.
172 * @dryrun: If true, do not allocate device nodes but still calculate needed
173 * memory size
174 */
175static void * unflatten_dt_node(const void *blob,
176 void *mem,
177 int *poffset,
178 struct device_node *dad,
179 struct device_node **nodepp,
180 unsigned long fpsize,
181 bool dryrun) 169 bool dryrun)
182{ 170{
183 const __be32 *p; 171 struct property *pp, **pprev = NULL;
172 int cur;
173 bool has_name = false;
174
175 pprev = &np->properties;
176 for (cur = fdt_first_property_offset(blob, offset);
177 cur >= 0;
178 cur = fdt_next_property_offset(blob, cur)) {
179 const __be32 *val;
180 const char *pname;
181 u32 sz;
182
183 val = fdt_getprop_by_offset(blob, cur, &pname, &sz);
184 if (!val) {
185 pr_warn("%s: Cannot locate property at 0x%x\n",
186 __func__, cur);
187 continue;
188 }
189
190 if (!pname) {
191 pr_warn("%s: Cannot find property name at 0x%x\n",
192 __func__, cur);
193 continue;
194 }
195
196 if (!strcmp(pname, "name"))
197 has_name = true;
198
199 pp = unflatten_dt_alloc(mem, sizeof(struct property),
200 __alignof__(struct property));
201 if (dryrun)
202 continue;
203
204 /* We accept flattened tree phandles either in
205 * ePAPR-style "phandle" properties, or the
206 * legacy "linux,phandle" properties. If both
207 * appear and have different values, things
208 * will get weird. Don't do that.
209 */
210 if (!strcmp(pname, "phandle") ||
211 !strcmp(pname, "linux,phandle")) {
212 if (!np->phandle)
213 np->phandle = be32_to_cpup(val);
214 }
215
216 /* And we process the "ibm,phandle" property
217 * used in pSeries dynamic device tree
218 * stuff
219 */
220 if (!strcmp(pname, "ibm,phandle"))
221 np->phandle = be32_to_cpup(val);
222
223 pp->name = (char *)pname;
224 pp->length = sz;
225 pp->value = (__be32 *)val;
226 *pprev = pp;
227 pprev = &pp->next;
228 }
229
230 /* With version 0x10 we may not have the name property,
231 * recreate it here from the unit name if absent
232 */
233 if (!has_name) {
234 const char *p = nodename, *ps = p, *pa = NULL;
235 int len;
236
237 while (*p) {
238 if ((*p) == '@')
239 pa = p;
240 else if ((*p) == '/')
241 ps = p + 1;
242 p++;
243 }
244
245 if (pa < ps)
246 pa = p;
247 len = (pa - ps) + 1;
248 pp = unflatten_dt_alloc(mem, sizeof(struct property) + len,
249 __alignof__(struct property));
250 if (!dryrun) {
251 pp->name = "name";
252 pp->length = len;
253 pp->value = pp + 1;
254 *pprev = pp;
255 pprev = &pp->next;
256 memcpy(pp->value, ps, len - 1);
257 ((char *)pp->value)[len - 1] = 0;
258 pr_debug("fixed up name for %s -> %s\n",
259 nodename, (char *)pp->value);
260 }
261 }
262
263 if (!dryrun)
264 *pprev = NULL;
265}
266
267static unsigned int populate_node(const void *blob,
268 int offset,
269 void **mem,
270 struct device_node *dad,
271 unsigned int fpsize,
272 struct device_node **pnp,
273 bool dryrun)
274{
184 struct device_node *np; 275 struct device_node *np;
185 struct property *pp, **prev_pp = NULL;
186 const char *pathp; 276 const char *pathp;
187 unsigned int l, allocl; 277 unsigned int l, allocl;
188 static int depth;
189 int old_depth;
190 int offset;
191 int has_name = 0;
192 int new_format = 0; 278 int new_format = 0;
193 279
194 pathp = fdt_get_name(blob, *poffset, &l); 280 pathp = fdt_get_name(blob, offset, &l);
195 if (!pathp) 281 if (!pathp) {
196 return mem; 282 *pnp = NULL;
283 return 0;
284 }
197 285
198 allocl = ++l; 286 allocl = ++l;
199 287
@@ -223,7 +311,7 @@ static void * unflatten_dt_node(const void *blob,
223 } 311 }
224 } 312 }
225 313
226 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, 314 np = unflatten_dt_alloc(mem, sizeof(struct device_node) + allocl,
227 __alignof__(struct device_node)); 315 __alignof__(struct device_node));
228 if (!dryrun) { 316 if (!dryrun) {
229 char *fn; 317 char *fn;
@@ -246,89 +334,15 @@ static void * unflatten_dt_node(const void *blob,
246 } 334 }
247 memcpy(fn, pathp, l); 335 memcpy(fn, pathp, l);
248 336
249 prev_pp = &np->properties;
250 if (dad != NULL) { 337 if (dad != NULL) {
251 np->parent = dad; 338 np->parent = dad;
252 np->sibling = dad->child; 339 np->sibling = dad->child;
253 dad->child = np; 340 dad->child = np;
254 } 341 }
255 } 342 }
256 /* process properties */
257 for (offset = fdt_first_property_offset(blob, *poffset);
258 (offset >= 0);
259 (offset = fdt_next_property_offset(blob, offset))) {
260 const char *pname;
261 u32 sz;
262
263 if (!(p = fdt_getprop_by_offset(blob, offset, &pname, &sz))) {
264 offset = -FDT_ERR_INTERNAL;
265 break;
266 }
267 343
268 if (pname == NULL) { 344 populate_properties(blob, offset, mem, np, pathp, dryrun);
269 pr_info("Can't find property name in list !\n");
270 break;
271 }
272 if (strcmp(pname, "name") == 0)
273 has_name = 1;
274 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
275 __alignof__(struct property));
276 if (!dryrun) {
277 /* We accept flattened tree phandles either in
278 * ePAPR-style "phandle" properties, or the
279 * legacy "linux,phandle" properties. If both
280 * appear and have different values, things
281 * will get weird. Don't do that. */
282 if ((strcmp(pname, "phandle") == 0) ||
283 (strcmp(pname, "linux,phandle") == 0)) {
284 if (np->phandle == 0)
285 np->phandle = be32_to_cpup(p);
286 }
287 /* And we process the "ibm,phandle" property
288 * used in pSeries dynamic device tree
289 * stuff */
290 if (strcmp(pname, "ibm,phandle") == 0)
291 np->phandle = be32_to_cpup(p);
292 pp->name = (char *)pname;
293 pp->length = sz;
294 pp->value = (__be32 *)p;
295 *prev_pp = pp;
296 prev_pp = &pp->next;
297 }
298 }
299 /* with version 0x10 we may not have the name property, recreate
300 * it here from the unit name if absent
301 */
302 if (!has_name) {
303 const char *p1 = pathp, *ps = pathp, *pa = NULL;
304 int sz;
305
306 while (*p1) {
307 if ((*p1) == '@')
308 pa = p1;
309 if ((*p1) == '/')
310 ps = p1 + 1;
311 p1++;
312 }
313 if (pa < ps)
314 pa = p1;
315 sz = (pa - ps) + 1;
316 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
317 __alignof__(struct property));
318 if (!dryrun) {
319 pp->name = "name";
320 pp->length = sz;
321 pp->value = pp + 1;
322 *prev_pp = pp;
323 prev_pp = &pp->next;
324 memcpy(pp->value, ps, sz - 1);
325 ((char *)pp->value)[sz - 1] = 0;
326 pr_debug("fixed up name for %s -> %s\n", pathp,
327 (char *)pp->value);
328 }
329 }
330 if (!dryrun) { 345 if (!dryrun) {
331 *prev_pp = NULL;
332 np->name = of_get_property(np, "name", NULL); 346 np->name = of_get_property(np, "name", NULL);
333 np->type = of_get_property(np, "device_type", NULL); 347 np->type = of_get_property(np, "device_type", NULL);
334 348
@@ -338,36 +352,94 @@ static void * unflatten_dt_node(const void *blob,
338 np->type = "<NULL>"; 352 np->type = "<NULL>";
339 } 353 }
340 354
341 old_depth = depth; 355 *pnp = np;
342 *poffset = fdt_next_node(blob, *poffset, &depth); 356 return fpsize;
343 if (depth < 0) 357}
344 depth = 0; 358
345 while (*poffset > 0 && depth > old_depth) 359static void reverse_nodes(struct device_node *parent)
346 mem = unflatten_dt_node(blob, mem, poffset, np, NULL, 360{
347 fpsize, dryrun); 361 struct device_node *child, *next;
362
363 /* In-depth first */
364 child = parent->child;
365 while (child) {
366 reverse_nodes(child);
367
368 child = child->sibling;
369 }
370
371 /* Reverse the nodes in the child list */
372 child = parent->child;
373 parent->child = NULL;
374 while (child) {
375 next = child->sibling;
376
377 child->sibling = parent->child;
378 parent->child = child;
379 child = next;
380 }
381}
382
383/**
384 * unflatten_dt_nodes - Alloc and populate a device_node from the flat tree
385 * @blob: The parent device tree blob
386 * @mem: Memory chunk to use for allocating device nodes and properties
387 * @dad: Parent struct device_node
388 * @nodepp: The device_node tree created by the call
389 *
390 * It returns the size of unflattened device tree or error code
391 */
392static int unflatten_dt_nodes(const void *blob,
393 void *mem,
394 struct device_node *dad,
395 struct device_node **nodepp)
396{
397 struct device_node *root;
398 int offset = 0, depth = 0;
399#define FDT_MAX_DEPTH 64
400 unsigned int fpsizes[FDT_MAX_DEPTH];
401 struct device_node *nps[FDT_MAX_DEPTH];
402 void *base = mem;
403 bool dryrun = !base;
348 404
349 if (*poffset < 0 && *poffset != -FDT_ERR_NOTFOUND) 405 if (nodepp)
350 pr_err("unflatten: error %d processing FDT\n", *poffset); 406 *nodepp = NULL;
407
408 root = dad;
409 fpsizes[depth] = dad ? strlen(of_node_full_name(dad)) : 0;
410 nps[depth] = dad;
411 for (offset = 0;
412 offset >= 0 && depth >= 0;
413 offset = fdt_next_node(blob, offset, &depth)) {
414 if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH))
415 continue;
416
417 fpsizes[depth+1] = populate_node(blob, offset, &mem,
418 nps[depth],
419 fpsizes[depth],
420 &nps[depth+1], dryrun);
421 if (!fpsizes[depth+1])
422 return mem - base;
423
424 if (!dryrun && nodepp && !*nodepp)
425 *nodepp = nps[depth+1];
426 if (!dryrun && !root)
427 root = nps[depth+1];
428 }
429
430 if (offset < 0 && offset != -FDT_ERR_NOTFOUND) {
431 pr_err("%s: Error %d processing FDT\n", __func__, offset);
432 return -EINVAL;
433 }
351 434
352 /* 435 /*
353 * Reverse the child list. Some drivers assumes node order matches .dts 436 * Reverse the child list. Some drivers assumes node order matches .dts
354 * node order 437 * node order
355 */ 438 */
356 if (!dryrun && np->child) { 439 if (!dryrun)
357 struct device_node *child = np->child; 440 reverse_nodes(root);
358 np->child = NULL;
359 while (child) {
360 struct device_node *next = child->sibling;
361 child->sibling = np->child;
362 np->child = child;
363 child = next;
364 }
365 }
366
367 if (nodepp)
368 *nodepp = np;
369 441
370 return mem; 442 return mem - base;
371} 443}
372 444
373/** 445/**
@@ -378,23 +450,27 @@ static void * unflatten_dt_node(const void *blob,
378 * pointers of the nodes so the normal device-tree walking functions 450 * pointers of the nodes so the normal device-tree walking functions
379 * can be used. 451 * can be used.
380 * @blob: The blob to expand 452 * @blob: The blob to expand
453 * @dad: Parent device node
381 * @mynodes: The device_node tree created by the call 454 * @mynodes: The device_node tree created by the call
382 * @dt_alloc: An allocator that provides a virtual address to memory 455 * @dt_alloc: An allocator that provides a virtual address to memory
383 * for the resulting tree 456 * for the resulting tree
457 *
458 * Returns NULL on failure or the memory chunk containing the unflattened
459 * device tree on success.
384 */ 460 */
385static void __unflatten_device_tree(const void *blob, 461static void *__unflatten_device_tree(const void *blob,
386 struct device_node **mynodes, 462 struct device_node *dad,
387 void * (*dt_alloc)(u64 size, u64 align)) 463 struct device_node **mynodes,
464 void *(*dt_alloc)(u64 size, u64 align))
388{ 465{
389 unsigned long size; 466 int size;
390 int start;
391 void *mem; 467 void *mem;
392 468
393 pr_debug(" -> unflatten_device_tree()\n"); 469 pr_debug(" -> unflatten_device_tree()\n");
394 470
395 if (!blob) { 471 if (!blob) {
396 pr_debug("No device tree pointer\n"); 472 pr_debug("No device tree pointer\n");
397 return; 473 return NULL;
398 } 474 }
399 475
400 pr_debug("Unflattening device tree:\n"); 476 pr_debug("Unflattening device tree:\n");
@@ -404,15 +480,16 @@ static void __unflatten_device_tree(const void *blob,
404 480
405 if (fdt_check_header(blob)) { 481 if (fdt_check_header(blob)) {
406 pr_err("Invalid device tree blob header\n"); 482 pr_err("Invalid device tree blob header\n");
407 return; 483 return NULL;
408 } 484 }
409 485
410 /* First pass, scan for size */ 486 /* First pass, scan for size */
411 start = 0; 487 size = unflatten_dt_nodes(blob, NULL, dad, NULL);
412 size = (unsigned long)unflatten_dt_node(blob, NULL, &start, NULL, NULL, 0, true); 488 if (size < 0)
413 size = ALIGN(size, 4); 489 return NULL;
414 490
415 pr_debug(" size is %lx, allocating...\n", size); 491 size = ALIGN(size, 4);
492 pr_debug(" size is %d, allocating...\n", size);
416 493
417 /* Allocate memory for the expanded device tree */ 494 /* Allocate memory for the expanded device tree */
418 mem = dt_alloc(size + 4, __alignof__(struct device_node)); 495 mem = dt_alloc(size + 4, __alignof__(struct device_node));
@@ -423,13 +500,13 @@ static void __unflatten_device_tree(const void *blob,
423 pr_debug(" unflattening %p...\n", mem); 500 pr_debug(" unflattening %p...\n", mem);
424 501
425 /* Second pass, do actual unflattening */ 502 /* Second pass, do actual unflattening */
426 start = 0; 503 unflatten_dt_nodes(blob, mem, dad, mynodes);
427 unflatten_dt_node(blob, mem, &start, NULL, mynodes, 0, false);
428 if (be32_to_cpup(mem + size) != 0xdeadbeef) 504 if (be32_to_cpup(mem + size) != 0xdeadbeef)
429 pr_warning("End of tree marker overwritten: %08x\n", 505 pr_warning("End of tree marker overwritten: %08x\n",
430 be32_to_cpup(mem + size)); 506 be32_to_cpup(mem + size));
431 507
432 pr_debug(" <- unflatten_device_tree()\n"); 508 pr_debug(" <- unflatten_device_tree()\n");
509 return mem;
433} 510}
434 511
435static void *kernel_tree_alloc(u64 size, u64 align) 512static void *kernel_tree_alloc(u64 size, u64 align)
@@ -441,18 +518,29 @@ static DEFINE_MUTEX(of_fdt_unflatten_mutex);
441 518
442/** 519/**
443 * of_fdt_unflatten_tree - create tree of device_nodes from flat blob 520 * of_fdt_unflatten_tree - create tree of device_nodes from flat blob
521 * @blob: Flat device tree blob
522 * @dad: Parent device node
523 * @mynodes: The device tree created by the call
444 * 524 *
445 * unflattens the device-tree passed by the firmware, creating the 525 * unflattens the device-tree passed by the firmware, creating the
446 * tree of struct device_node. It also fills the "name" and "type" 526 * tree of struct device_node. It also fills the "name" and "type"
447 * pointers of the nodes so the normal device-tree walking functions 527 * pointers of the nodes so the normal device-tree walking functions
448 * can be used. 528 * can be used.
529 *
530 * Returns NULL on failure or the memory chunk containing the unflattened
531 * device tree on success.
449 */ 532 */
450void of_fdt_unflatten_tree(const unsigned long *blob, 533void *of_fdt_unflatten_tree(const unsigned long *blob,
451 struct device_node **mynodes) 534 struct device_node *dad,
535 struct device_node **mynodes)
452{ 536{
537 void *mem;
538
453 mutex_lock(&of_fdt_unflatten_mutex); 539 mutex_lock(&of_fdt_unflatten_mutex);
454 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc); 540 mem = __unflatten_device_tree(blob, dad, mynodes, &kernel_tree_alloc);
455 mutex_unlock(&of_fdt_unflatten_mutex); 541 mutex_unlock(&of_fdt_unflatten_mutex);
542
543 return mem;
456} 544}
457EXPORT_SYMBOL_GPL(of_fdt_unflatten_tree); 545EXPORT_SYMBOL_GPL(of_fdt_unflatten_tree);
458 546
@@ -969,10 +1057,16 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
969 * is set in which case we override whatever was found earlier. 1057 * is set in which case we override whatever was found earlier.
970 */ 1058 */
971#ifdef CONFIG_CMDLINE 1059#ifdef CONFIG_CMDLINE
972#ifndef CONFIG_CMDLINE_FORCE 1060#if defined(CONFIG_CMDLINE_EXTEND)
1061 strlcat(data, " ", COMMAND_LINE_SIZE);
1062 strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
1063#elif defined(CONFIG_CMDLINE_FORCE)
1064 strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
1065#else
1066 /* No arguments from boot loader, use kernel's cmdl*/
973 if (!((char *)data)[0]) 1067 if (!((char *)data)[0])
974#endif
975 strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 1068 strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
1069#endif
976#endif /* CONFIG_CMDLINE */ 1070#endif /* CONFIG_CMDLINE */
977 1071
978 pr_debug("Command line is: %s\n", (char*)data); 1072 pr_debug("Command line is: %s\n", (char*)data);
@@ -1118,7 +1212,7 @@ bool __init early_init_dt_scan(void *params)
1118 */ 1212 */
1119void __init unflatten_device_tree(void) 1213void __init unflatten_device_tree(void)
1120{ 1214{
1121 __unflatten_device_tree(initial_boot_params, &of_root, 1215 __unflatten_device_tree(initial_boot_params, NULL, &of_root,
1122 early_init_dt_alloc_memory_arch); 1216 early_init_dt_alloc_memory_arch);
1123 1217
1124 /* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */ 1218 /* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index c1ebbfb79453..f34ed9310323 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -8,7 +8,6 @@
8#include <linux/err.h> 8#include <linux/err.h>
9#include <linux/errno.h> 9#include <linux/errno.h>
10#include <linux/hashtable.h> 10#include <linux/hashtable.h>
11#include <linux/module.h>
12#include <linux/of.h> 11#include <linux/of.h>
13#include <linux/of_fdt.h> 12#include <linux/of_fdt.h>
14#include <linux/of_irq.h> 13#include <linux/of_irq.h>
@@ -921,7 +920,7 @@ static int __init unittest_data_add(void)
921 "not running tests\n", __func__); 920 "not running tests\n", __func__);
922 return -ENOMEM; 921 return -ENOMEM;
923 } 922 }
924 of_fdt_unflatten_tree(unittest_data, &unittest_data_node); 923 of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);
925 if (!unittest_data_node) { 924 if (!unittest_data_node) {
926 pr_warn("%s: No tree to attach; not running tests\n", __func__); 925 pr_warn("%s: No tree to attach; not running tests\n", __func__);
927 return -ENODATA; 926 return -ENODATA;
diff --git a/include/linux/of.h b/include/linux/of.h
index 77ddace575e8..c7292e8ea080 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -75,6 +75,23 @@ struct of_phandle_args {
75 uint32_t args[MAX_PHANDLE_ARGS]; 75 uint32_t args[MAX_PHANDLE_ARGS];
76}; 76};
77 77
78struct of_phandle_iterator {
79 /* Common iterator information */
80 const char *cells_name;
81 int cell_count;
82 const struct device_node *parent;
83
84 /* List size information */
85 const __be32 *list_end;
86 const __be32 *phandle_end;
87
88 /* Current position state */
89 const __be32 *cur;
90 uint32_t cur_count;
91 phandle phandle;
92 struct device_node *node;
93};
94
78struct of_reconfig_data { 95struct of_reconfig_data {
79 struct device_node *dn; 96 struct device_node *dn;
80 struct property *prop; 97 struct property *prop;
@@ -334,6 +351,18 @@ extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
334extern int of_count_phandle_with_args(const struct device_node *np, 351extern int of_count_phandle_with_args(const struct device_node *np,
335 const char *list_name, const char *cells_name); 352 const char *list_name, const char *cells_name);
336 353
354/* phandle iterator functions */
355extern int of_phandle_iterator_init(struct of_phandle_iterator *it,
356 const struct device_node *np,
357 const char *list_name,
358 const char *cells_name,
359 int cell_count);
360
361extern int of_phandle_iterator_next(struct of_phandle_iterator *it);
362extern int of_phandle_iterator_args(struct of_phandle_iterator *it,
363 uint32_t *args,
364 int size);
365
337extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); 366extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
338extern int of_alias_get_id(struct device_node *np, const char *stem); 367extern int of_alias_get_id(struct device_node *np, const char *stem);
339extern int of_alias_get_highest_id(const char *stem); 368extern int of_alias_get_highest_id(const char *stem);
@@ -608,6 +637,27 @@ static inline int of_count_phandle_with_args(struct device_node *np,
608 return -ENOSYS; 637 return -ENOSYS;
609} 638}
610 639
640static inline int of_phandle_iterator_init(struct of_phandle_iterator *it,
641 const struct device_node *np,
642 const char *list_name,
643 const char *cells_name,
644 int cell_count)
645{
646 return -ENOSYS;
647}
648
649static inline int of_phandle_iterator_next(struct of_phandle_iterator *it)
650{
651 return -ENOSYS;
652}
653
654static inline int of_phandle_iterator_args(struct of_phandle_iterator *it,
655 uint32_t *args,
656 int size)
657{
658 return 0;
659}
660
611static inline int of_alias_get_id(struct device_node *np, const char *stem) 661static inline int of_alias_get_id(struct device_node *np, const char *stem)
612{ 662{
613 return -ENOSYS; 663 return -ENOSYS;
@@ -877,6 +927,12 @@ static inline int of_property_read_s32(const struct device_node *np,
877 return of_property_read_u32(np, propname, (u32*) out_value); 927 return of_property_read_u32(np, propname, (u32*) out_value);
878} 928}
879 929
930#define of_for_each_phandle(it, err, np, ln, cn, cc) \
931 for (of_phandle_iterator_init((it), (np), (ln), (cn), (cc)), \
932 err = of_phandle_iterator_next(it); \
933 err == 0; \
934 err = of_phandle_iterator_next(it))
935
880#define of_property_for_each_u32(np, propname, prop, p, u) \ 936#define of_property_for_each_u32(np, propname, prop, p, u) \
881 for (prop = of_find_property(np, propname, NULL), \ 937 for (prop = of_find_property(np, propname, NULL), \
882 p = of_prop_next_u32(prop, NULL, &u); \ 938 p = of_prop_next_u32(prop, NULL, &u); \
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 2fbe8682a66f..901ec01c9fba 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -37,8 +37,9 @@ extern bool of_fdt_is_big_endian(const void *blob,
37 unsigned long node); 37 unsigned long node);
38extern int of_fdt_match(const void *blob, unsigned long node, 38extern int of_fdt_match(const void *blob, unsigned long node,
39 const char *const *compat); 39 const char *const *compat);
40extern void of_fdt_unflatten_tree(const unsigned long *blob, 40extern void *of_fdt_unflatten_tree(const unsigned long *blob,
41 struct device_node **mynodes); 41 struct device_node *dad,
42 struct device_node **mynodes);
42 43
43/* TBD: Temporary export of fdt globals - remove when code fully merged */ 44/* TBD: Temporary export of fdt globals - remove when code fully merged */
44extern int __initdata dt_root_addr_cells; 45extern int __initdata dt_root_addr_cells;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index f8bcd0e21a26..bb3a5a2cd570 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -15,6 +15,7 @@
15#define __LINUX_OF_GRAPH_H 15#define __LINUX_OF_GRAPH_H
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/errno.h>
18 19
19/** 20/**
20 * struct of_endpoint - the OF graph endpoint data structure 21 * struct of_endpoint - the OF graph endpoint data structure
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index ddf83d0181e7..ed1b7c4fb674 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -277,6 +277,11 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
277# --------------------------------------------------------------------------- 277# ---------------------------------------------------------------------------
278DTC ?= $(objtree)/scripts/dtc/dtc 278DTC ?= $(objtree)/scripts/dtc/dtc
279 279
280# Disable noisy checks by default
281ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),)
282DTC_FLAGS += -Wno-unit_address_vs_reg
283endif
284
280# Generate an assembly file to wrap the output of the device tree compiler 285# Generate an assembly file to wrap the output of the device tree compiler
281quiet_cmd_dt_S_dtb= DTB $@ 286quiet_cmd_dt_S_dtb= DTB $@
282cmd_dt_S_dtb= \ 287cmd_dt_S_dtb= \
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 0c03ac9159c1..386f9563313f 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -294,6 +294,30 @@ static void check_node_name_format(struct check *c, struct node *dt,
294} 294}
295NODE_ERROR(node_name_format, NULL, &node_name_chars); 295NODE_ERROR(node_name_format, NULL, &node_name_chars);
296 296
297static void check_unit_address_vs_reg(struct check *c, struct node *dt,
298 struct node *node)
299{
300 const char *unitname = get_unitname(node);
301 struct property *prop = get_property(node, "reg");
302
303 if (!prop) {
304 prop = get_property(node, "ranges");
305 if (prop && !prop->val.len)
306 prop = NULL;
307 }
308
309 if (prop) {
310 if (!unitname[0])
311 FAIL(c, "Node %s has a reg or ranges property, but no unit name",
312 node->fullpath);
313 } else {
314 if (unitname[0])
315 FAIL(c, "Node %s has a unit name, but no reg property",
316 node->fullpath);
317 }
318}
319NODE_WARNING(unit_address_vs_reg, NULL);
320
297static void check_property_name_chars(struct check *c, struct node *dt, 321static void check_property_name_chars(struct check *c, struct node *dt,
298 struct node *node, struct property *prop) 322 struct node *node, struct property *prop)
299{ 323{
@@ -667,6 +691,8 @@ static struct check *check_table[] = {
667 691
668 &addr_size_cells, &reg_format, &ranges_format, 692 &addr_size_cells, &reg_format, &ranges_format,
669 693
694 &unit_address_vs_reg,
695
670 &avoid_default_addr_size, 696 &avoid_default_addr_size,
671 &obsolete_chosen_interrupt_controller, 697 &obsolete_chosen_interrupt_controller,
672 698
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
index bd99fa2d33b8..ec14954f5810 100644
--- a/scripts/dtc/flattree.c
+++ b/scripts/dtc/flattree.c
@@ -889,7 +889,7 @@ struct boot_info *dt_from_blob(const char *fname)
889 889
890 if (version >= 3) { 890 if (version >= 3) {
891 uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings); 891 uint32_t size_str = fdt32_to_cpu(fdt->size_dt_strings);
892 if (off_str+size_str > totalsize) 892 if ((off_str+size_str < off_str) || (off_str+size_str > totalsize))
893 die("String table extends past total size\n"); 893 die("String table extends past total size\n");
894 inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str); 894 inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
895 } else { 895 } else {
@@ -898,7 +898,7 @@ struct boot_info *dt_from_blob(const char *fname)
898 898
899 if (version >= 17) { 899 if (version >= 17) {
900 size_dt = fdt32_to_cpu(fdt->size_dt_struct); 900 size_dt = fdt32_to_cpu(fdt->size_dt_struct);
901 if (off_dt+size_dt > totalsize) 901 if ((off_dt+size_dt < off_dt) || (off_dt+size_dt > totalsize))
902 die("Structure block extends past total size\n"); 902 die("Structure block extends past total size\n");
903 } 903 }
904 904
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index e5b313682007..50cce864283c 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -647,10 +647,8 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
647 prop = fdt_getprop(fdt, nodeoffset, "compatible", &len); 647 prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
648 if (!prop) 648 if (!prop)
649 return len; 649 return len;
650 if (fdt_stringlist_contains(prop, len, compatible)) 650
651 return 0; 651 return !fdt_stringlist_contains(prop, len, compatible);
652 else
653 return 1;
654} 652}
655 653
656int fdt_node_offset_by_compatible(const void *fdt, int startoffset, 654int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index 11d93e6d8220..ad9b05ae698b 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
#define DTC_VERSION "DTC 1.4.1-gb06e55c8" #define DTC_VERSION "DTC 1.4.1-g53bf130b"