diff options
65 files changed, 357 insertions, 207 deletions
diff --git a/Documentation/devicetree/bindings/arm/davinci/nand.txt b/Documentation/devicetree/bindings/arm/davinci/nand.txt index e37241f1fdd8..49fc7ada929a 100644 --- a/Documentation/devicetree/bindings/arm/davinci/nand.txt +++ b/Documentation/devicetree/bindings/arm/davinci/nand.txt | |||
@@ -23,29 +23,16 @@ Recommended properties : | |||
23 | - ti,davinci-nand-buswidth: buswidth 8 or 16 | 23 | - ti,davinci-nand-buswidth: buswidth 8 or 16 |
24 | - ti,davinci-nand-use-bbt: use flash based bad block table support. | 24 | - ti,davinci-nand-use-bbt: use flash based bad block table support. |
25 | 25 | ||
26 | Example (enbw_cmc board): | 26 | Example(da850 EVM ): |
27 | aemif@60000000 { | 27 | nand_cs3@62000000 { |
28 | compatible = "ti,davinci-aemif"; | 28 | compatible = "ti,davinci-nand"; |
29 | #address-cells = <2>; | 29 | reg = <0x62000000 0x807ff |
30 | #size-cells = <1>; | 30 | 0x68000000 0x8000>; |
31 | reg = <0x68000000 0x80000>; | 31 | ti,davinci-chipselect = <1>; |
32 | ranges = <2 0 0x60000000 0x02000000 | 32 | ti,davinci-mask-ale = <0>; |
33 | 3 0 0x62000000 0x02000000 | 33 | ti,davinci-mask-cle = <0>; |
34 | 4 0 0x64000000 0x02000000 | 34 | ti,davinci-mask-chipsel = <0>; |
35 | 5 0 0x66000000 0x02000000 | 35 | ti,davinci-ecc-mode = "hw"; |
36 | 6 0 0x68000000 0x02000000>; | 36 | ti,davinci-ecc-bits = <4>; |
37 | nand@3,0 { | 37 | ti,davinci-nand-use-bbt; |
38 | compatible = "ti,davinci-nand"; | ||
39 | reg = <3 0x0 0x807ff | ||
40 | 6 0x0 0x8000>; | ||
41 | #address-cells = <1>; | ||
42 | #size-cells = <1>; | ||
43 | ti,davinci-chipselect = <1>; | ||
44 | ti,davinci-mask-ale = <0>; | ||
45 | ti,davinci-mask-cle = <0>; | ||
46 | ti,davinci-mask-chipsel = <0>; | ||
47 | ti,davinci-ecc-mode = "hw"; | ||
48 | ti,davinci-ecc-bits = <4>; | ||
49 | ti,davinci-nand-use-bbt; | ||
50 | }; | ||
51 | }; | 38 | }; |
diff --git a/Documentation/devicetree/bindings/arm/l2cc.txt b/Documentation/devicetree/bindings/arm/l2cc.txt index 7ca52161e7ab..7c3ee3aeb7b7 100644 --- a/Documentation/devicetree/bindings/arm/l2cc.txt +++ b/Documentation/devicetree/bindings/arm/l2cc.txt | |||
@@ -37,7 +37,7 @@ L2: cache-controller { | |||
37 | reg = <0xfff12000 0x1000>; | 37 | reg = <0xfff12000 0x1000>; |
38 | arm,data-latency = <1 1 1>; | 38 | arm,data-latency = <1 1 1>; |
39 | arm,tag-latency = <2 2 2>; | 39 | arm,tag-latency = <2 2 2>; |
40 | arm,filter-latency = <0x80000000 0x8000000>; | 40 | arm,filter-ranges = <0x80000000 0x8000000>; |
41 | cache-unified; | 41 | cache-unified; |
42 | cache-level = <2>; | 42 | cache-level = <2>; |
43 | interrupts = <45>; | 43 | interrupts = <45>; |
diff --git a/Documentation/devicetree/bindings/i2c/atmel-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-at91.txt index b689a0d9441c..b689a0d9441c 100644 --- a/Documentation/devicetree/bindings/i2c/atmel-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-at91.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/davinci.txt b/Documentation/devicetree/bindings/i2c/i2c-davinci.txt index 2dc935b4113d..2dc935b4113d 100644 --- a/Documentation/devicetree/bindings/i2c/davinci.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-davinci.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/gpio-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-gpio.txt index 4f8ec947c6bd..4f8ec947c6bd 100644 --- a/Documentation/devicetree/bindings/i2c/gpio-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-gpio.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-imx.txt index f3cf43b66f7e..f3cf43b66f7e 100644 --- a/Documentation/devicetree/bindings/i2c/fsl-imx-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-imx.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/fsl-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-mpc.txt index 1eacd6b20ed5..1eacd6b20ed5 100644 --- a/Documentation/devicetree/bindings/i2c/fsl-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-mpc.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/mux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux.txt index af84cce5cd7b..af84cce5cd7b 100644 --- a/Documentation/devicetree/bindings/i2c/mux.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-mux.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt new file mode 100644 index 000000000000..f46d928aa73d --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | |||
2 | * Marvell MV64XXX I2C controller | ||
3 | |||
4 | Required properties : | ||
5 | |||
6 | - reg : Offset and length of the register set for the device | ||
7 | - compatible : Should be "marvell,mv64xxx-i2c" | ||
8 | - interrupts : The interrupt number | ||
9 | - clock-frequency : Desired I2C bus clock frequency in Hz. | ||
10 | |||
11 | Examples: | ||
12 | |||
13 | i2c@11000 { | ||
14 | compatible = "marvell,mv64xxx-i2c"; | ||
15 | reg = <0x11000 0x20>; | ||
16 | interrupts = <29>; | ||
17 | clock-frequency = <100000>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/nomadik.txt b/Documentation/devicetree/bindings/i2c/i2c-nomadik.txt index 72065b0ff680..72065b0ff680 100644 --- a/Documentation/devicetree/bindings/i2c/nomadik.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-nomadik.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/cavium-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-octeon.txt index dced82ebe31d..dced82ebe31d 100644 --- a/Documentation/devicetree/bindings/i2c/cavium-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-octeon.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/omap-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-omap.txt index 56564aa4b444..56564aa4b444 100644 --- a/Documentation/devicetree/bindings/i2c/omap-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-omap.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/pnx.txt b/Documentation/devicetree/bindings/i2c/i2c-pnx.txt index fe98ada33ee4..fe98ada33ee4 100644 --- a/Documentation/devicetree/bindings/i2c/pnx.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-pnx.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/ce4100-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-pxa-pci-ce4100.txt index 569b16248514..569b16248514 100644 --- a/Documentation/devicetree/bindings/i2c/ce4100-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-pxa-pci-ce4100.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt index 0f7945019f6f..12b78ac507e9 100644 --- a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt | |||
@@ -31,21 +31,3 @@ Examples: | |||
31 | reg = <0xd4025000 0x1000>; | 31 | reg = <0xd4025000 0x1000>; |
32 | interrupts = <58>; | 32 | interrupts = <58>; |
33 | }; | 33 | }; |
34 | |||
35 | * Marvell MV64XXX I2C controller | ||
36 | |||
37 | Required properties : | ||
38 | |||
39 | - reg : Offset and length of the register set for the device | ||
40 | - compatible : Should be "marvell,mv64xxx-i2c" | ||
41 | - interrupts : The interrupt number | ||
42 | - clock-frequency : Desired I2C bus clock frequency in Hz. | ||
43 | |||
44 | Examples: | ||
45 | |||
46 | i2c@11000 { | ||
47 | compatible = "marvell,mv64xxx-i2c"; | ||
48 | reg = <0x11000 0x20>; | ||
49 | interrupts = <29>; | ||
50 | clock-frequency = <100000>; | ||
51 | }; | ||
diff --git a/Documentation/devicetree/bindings/i2c/samsung-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt index b6cb5a12c672..b6cb5a12c672 100644 --- a/Documentation/devicetree/bindings/i2c/samsung-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-s3c2410.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/sirf-i2c.txt b/Documentation/devicetree/bindings/i2c/i2c-sirf.txt index 7baf9e133fa8..7baf9e133fa8 100644 --- a/Documentation/devicetree/bindings/i2c/sirf-i2c.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-sirf.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/arm-versatile.txt b/Documentation/devicetree/bindings/i2c/i2c-versatile.txt index 361d31c51b6f..361d31c51b6f 100644 --- a/Documentation/devicetree/bindings/i2c/arm-versatile.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-versatile.txt | |||
diff --git a/Documentation/devicetree/bindings/i2c/xiic.txt b/Documentation/devicetree/bindings/i2c/i2c-xiic.txt index ceabbe91ae44..ceabbe91ae44 100644 --- a/Documentation/devicetree/bindings/i2c/xiic.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-xiic.txt | |||
diff --git a/Documentation/devicetree/bindings/leds/common.txt b/Documentation/devicetree/bindings/leds/common.txt new file mode 100644 index 000000000000..2d88816dd550 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/common.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | Common leds properties. | ||
2 | |||
3 | Optional properties for child nodes: | ||
4 | - label : The label for this LED. If omitted, the label is | ||
5 | taken from the node name (excluding the unit address). | ||
6 | |||
7 | - linux,default-trigger : This parameter, if present, is a | ||
8 | string defining the trigger assigned to the LED. Current triggers are: | ||
9 | "backlight" - LED will act as a back-light, controlled by the framebuffer | ||
10 | system | ||
11 | "default-on" - LED will turn on (but for leds-gpio see "default-state" | ||
12 | property in Documentation/devicetree/bindings/gpio/led.txt) | ||
13 | "heartbeat" - LED "double" flashes at a load average based rate | ||
14 | "ide-disk" - LED indicates disk activity | ||
15 | "timer" - LED flashes at a fixed, configurable rate | ||
16 | |||
17 | Examples: | ||
18 | |||
19 | system-status { | ||
20 | label = "Status"; | ||
21 | linux,default-trigger = "heartbeat"; | ||
22 | ... | ||
23 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/led.txt b/Documentation/devicetree/bindings/leds/leds-gpio.txt index edc83c1c0d54..df1b3080f6b8 100644 --- a/Documentation/devicetree/bindings/gpio/led.txt +++ b/Documentation/devicetree/bindings/leds/leds-gpio.txt | |||
@@ -10,16 +10,10 @@ LED sub-node properties: | |||
10 | - gpios : Should specify the LED's GPIO, see "gpios property" in | 10 | - gpios : Should specify the LED's GPIO, see "gpios property" in |
11 | Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be | 11 | Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be |
12 | indicated using flags in the GPIO specifier. | 12 | indicated using flags in the GPIO specifier. |
13 | - label : (optional) The label for this LED. If omitted, the label is | 13 | - label : (optional) |
14 | taken from the node name (excluding the unit address). | 14 | see Documentation/devicetree/bindings/leds/common.txt |
15 | - linux,default-trigger : (optional) This parameter, if present, is a | 15 | - linux,default-trigger : (optional) |
16 | string defining the trigger assigned to the LED. Current triggers are: | 16 | see Documentation/devicetree/bindings/leds/common.txt |
17 | "backlight" - LED will act as a back-light, controlled by the framebuffer | ||
18 | system | ||
19 | "default-on" - LED will turn on, but see "default-state" below | ||
20 | "heartbeat" - LED "double" flashes at a load average based rate | ||
21 | "ide-disk" - LED indicates disk activity | ||
22 | "timer" - LED flashes at a fixed, configurable rate | ||
23 | - default-state: (optional) The initial state of the LED. Valid | 17 | - default-state: (optional) The initial state of the LED. Valid |
24 | values are "on", "off", and "keep". If the LED is already on or off | 18 | values are "on", "off", and "keep". If the LED is already on or off |
25 | and the default-state property is set the to same value, then no | 19 | and the default-state property is set the to same value, then no |
diff --git a/Documentation/devicetree/bindings/rtc/orion-rtc.txt b/Documentation/devicetree/bindings/rtc/orion-rtc.txt new file mode 100644 index 000000000000..3bf63ffa5160 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/orion-rtc.txt | |||
@@ -0,0 +1,18 @@ | |||
1 | * Mvebu Real Time Clock | ||
2 | |||
3 | RTC controller for the Kirkwood, the Dove, the Armada 370 and the | ||
4 | Armada XP SoCs | ||
5 | |||
6 | Required properties: | ||
7 | - compatible : Should be "marvell,orion-rtc" | ||
8 | - reg: physical base address of the controller and length of memory mapped | ||
9 | region. | ||
10 | - interrupts: IRQ line for the RTC. | ||
11 | |||
12 | Example: | ||
13 | |||
14 | rtc@10300 { | ||
15 | compatible = "marvell,orion-rtc"; | ||
16 | reg = <0xd0010300 0x20>; | ||
17 | interrupts = <50>; | ||
18 | }; | ||
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 9de2b9ff9d6e..770a0193ca1b 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -5,6 +5,7 @@ using them to avoid name-space collisions. | |||
5 | 5 | ||
6 | ad Avionic Design GmbH | 6 | ad Avionic Design GmbH |
7 | adi Analog Devices, Inc. | 7 | adi Analog Devices, Inc. |
8 | ak Asahi Kasei Corp. | ||
8 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 9 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
9 | apm Applied Micro Circuits Corporation (APM) | 10 | apm Applied Micro Circuits Corporation (APM) |
10 | arm ARM Ltd. | 11 | arm ARM Ltd. |
@@ -25,6 +26,7 @@ gef GE Fanuc Intelligent Platforms Embedded Systems, Inc. | |||
25 | hp Hewlett Packard | 26 | hp Hewlett Packard |
26 | ibm International Business Machines (IBM) | 27 | ibm International Business Machines (IBM) |
27 | idt Integrated Device Technologies, Inc. | 28 | idt Integrated Device Technologies, Inc. |
29 | img Imagination Technologies Ltd. | ||
28 | intercontrol Inter Control Group | 30 | intercontrol Inter Control Group |
29 | linux Linux-specific binding | 31 | linux Linux-specific binding |
30 | marvell Marvell Technology Group Ltd. | 32 | marvell Marvell Technology Group Ltd. |
@@ -34,8 +36,9 @@ national National Semiconductor | |||
34 | nintendo Nintendo | 36 | nintendo Nintendo |
35 | nvidia NVIDIA | 37 | nvidia NVIDIA |
36 | nxp NXP Semiconductors | 38 | nxp NXP Semiconductors |
39 | onnn ON Semiconductor Corp. | ||
37 | picochip Picochip Ltd | 40 | picochip Picochip Ltd |
38 | powervr Imagination Technologies | 41 | powervr PowerVR (deprecated, use img) |
39 | qcom Qualcomm, Inc. | 42 | qcom Qualcomm, Inc. |
40 | ramtron Ramtron International | 43 | ramtron Ramtron International |
41 | realtek Realtek Semiconductor Corp. | 44 | realtek Realtek Semiconductor Corp. |
@@ -45,6 +48,7 @@ schindler Schindler | |||
45 | sil Silicon Image | 48 | sil Silicon Image |
46 | simtek | 49 | simtek |
47 | sirf SiRF Technology, Inc. | 50 | sirf SiRF Technology, Inc. |
51 | snps Synopsys, Inc. | ||
48 | st STMicroelectronics | 52 | st STMicroelectronics |
49 | stericsson ST-Ericsson | 53 | stericsson ST-Ericsson |
50 | ti Texas Instruments | 54 | ti Texas Instruments |
diff --git a/Documentation/devicetree/usage-model.txt b/Documentation/devicetree/usage-model.txt index dca90fe22a90..ef9d06c9f8fd 100644 --- a/Documentation/devicetree/usage-model.txt +++ b/Documentation/devicetree/usage-model.txt | |||
@@ -347,7 +347,7 @@ later), which will happily live at the base of the Linux /sys/devices | |||
347 | tree. Therefore, if a DT node is at the root of the tree, then it | 347 | tree. Therefore, if a DT node is at the root of the tree, then it |
348 | really probably is best registered as a platform_device. | 348 | really probably is best registered as a platform_device. |
349 | 349 | ||
350 | Linux board support code calls of_platform_populate(NULL, NULL, NULL) | 350 | Linux board support code calls of_platform_populate(NULL, NULL, NULL, NULL) |
351 | to kick off discovery of devices at the root of the tree. The | 351 | to kick off discovery of devices at the root of the tree. The |
352 | parameters are all NULL because when starting from the root of the | 352 | parameters are all NULL because when starting from the root of the |
353 | tree, there is no need to provide a starting node (the first NULL), a | 353 | tree, there is no need to provide a starting node (the first NULL), a |
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index ec9ae6708691..14c3f4f1b617 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt | |||
@@ -1175,15 +1175,16 @@ When kbuild executes, the following steps are followed (roughly): | |||
1175 | in an init section in the image. Platform code *must* copy the | 1175 | in an init section in the image. Platform code *must* copy the |
1176 | blob to non-init memory prior to calling unflatten_device_tree(). | 1176 | blob to non-init memory prior to calling unflatten_device_tree(). |
1177 | 1177 | ||
1178 | Example: | 1178 | To use this command, simply add *.dtb into obj-y or targets, or make |
1179 | #arch/x86/platform/ce4100/Makefile | 1179 | some other target depend on %.dtb |
1180 | clean-files := *dtb.S | ||
1181 | 1180 | ||
1182 | DTC_FLAGS := -p 1024 | 1181 | A central rule exists to create $(obj)/%.dtb from $(src)/%.dts; |
1183 | obj-y += foo.dtb.o | 1182 | architecture Makefiles do no need to explicitly write out that rule. |
1184 | 1183 | ||
1185 | $(obj)/%.dtb: $(src)/%.dts | 1184 | Example: |
1186 | $(call cmd,dtc) | 1185 | targets += $(dtb-y) |
1186 | clean-files += *.dtb | ||
1187 | DTC_FLAGS ?= -p 1024 | ||
1187 | 1188 | ||
1188 | --- 6.8 Custom kbuild commands | 1189 | --- 6.8 Custom kbuild commands |
1189 | 1190 | ||
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 5f914fca911b..c35baf102f6f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -292,10 +292,10 @@ zinstall uinstall install: vmlinux | |||
292 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 292 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ |
293 | 293 | ||
294 | %.dtb: scripts | 294 | %.dtb: scripts |
295 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 295 | $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ |
296 | 296 | ||
297 | dtbs: scripts | 297 | dtbs: scripts |
298 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 298 | $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs |
299 | 299 | ||
300 | # We use MRPROPER_FILES and CLEAN_FILES now | 300 | # We use MRPROPER_FILES and CLEAN_FILES now |
301 | archclean: | 301 | archclean: |
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 9137df539b61..abfce280f57b 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -15,8 +15,6 @@ ifneq ($(MACHINE),) | |||
15 | include $(srctree)/$(MACHINE)/Makefile.boot | 15 | include $(srctree)/$(MACHINE)/Makefile.boot |
16 | endif | 16 | endif |
17 | 17 | ||
18 | include $(srctree)/arch/arm/boot/dts/Makefile | ||
19 | |||
20 | # Note: the following conditions must always be true: | 18 | # Note: the following conditions must always be true: |
21 | # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) | 19 | # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET) |
22 | # PARAMS_PHYS must be within 4MB of ZRELADDR | 20 | # PARAMS_PHYS must be within 4MB of ZRELADDR |
@@ -59,16 +57,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | |||
59 | 57 | ||
60 | endif | 58 | endif |
61 | 59 | ||
62 | targets += $(dtb-y) | ||
63 | |||
64 | # Rule to build device tree blobs | ||
65 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
66 | $(call if_changed_dep,dtc) | ||
67 | |||
68 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
69 | |||
70 | clean-files := *.dtb | ||
71 | |||
72 | ifneq ($(LOADADDR),) | 60 | ifneq ($(LOADADDR),) |
73 | UIMAGE_LOADADDR=$(LOADADDR) | 61 | UIMAGE_LOADADDR=$(LOADADDR) |
74 | else | 62 | else |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index fb5b07737ca7..262493752234 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -120,4 +120,12 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \ | |||
120 | wm8505-ref.dtb \ | 120 | wm8505-ref.dtb \ |
121 | wm8650-mid.dtb | 121 | wm8650-mid.dtb |
122 | 122 | ||
123 | targets += dtbs | ||
123 | endif | 124 | endif |
125 | |||
126 | # *.dtb used to be generated in the directory above. Clean out the | ||
127 | # old build results so people don't accidentally use them. | ||
128 | dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
129 | $(Q)rm -f $(obj)/../*.dtb | ||
130 | |||
131 | clean-files := *.dtb | ||
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts index f0ba901676ac..a20d4ff3fb3c 100644 --- a/arch/arm/boot/dts/tegra20-seaboard.dts +++ b/arch/arm/boot/dts/tegra20-seaboard.dts | |||
@@ -523,12 +523,12 @@ | |||
523 | }; | 523 | }; |
524 | 524 | ||
525 | temperature-sensor@4c { | 525 | temperature-sensor@4c { |
526 | compatible = "nct1008"; | 526 | compatible = "onnn,nct1008"; |
527 | reg = <0x4c>; | 527 | reg = <0x4c>; |
528 | }; | 528 | }; |
529 | 529 | ||
530 | magnetometer@c { | 530 | magnetometer@c { |
531 | compatible = "ak8975"; | 531 | compatible = "ak,ak8975"; |
532 | reg = <0xc>; | 532 | reg = <0xc>; |
533 | interrupt-parent = <&gpio>; | 533 | interrupt-parent = <&gpio>; |
534 | interrupts = <109 0x04>; /* gpio PN5 */ | 534 | interrupts = <109 0x04>; /* gpio PN5 */ |
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h index aeae9c609df4..6d65ba222db9 100644 --- a/arch/arm/include/asm/prom.h +++ b/arch/arm/include/asm/prom.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASMARM_PROM_H | 11 | #ifndef __ASMARM_PROM_H |
12 | #define __ASMARM_PROM_H | 12 | #define __ASMARM_PROM_H |
13 | 13 | ||
14 | #define HAVE_ARCH_DEVTREE_FIXUPS | ||
15 | |||
14 | #ifdef CONFIG_OF | 16 | #ifdef CONFIG_OF |
15 | 17 | ||
16 | extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); | 18 | extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 560e0df728f8..359f782c747d 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -589,7 +589,7 @@ void __init v2m_dt_init_early(void) | |||
589 | return; | 589 | return; |
590 | 590 | ||
591 | /* Confirm board type against DT property, if available */ | 591 | /* Confirm board type against DT property, if available */ |
592 | if (of_property_read_u32(allnodes, "arm,hbi", &dt_hbi) == 0) { | 592 | if (of_property_read_u32(of_allnodes, "arm,hbi", &dt_hbi) == 0) { |
593 | int site = v2m_get_master_site(); | 593 | int site = v2m_get_master_site(); |
594 | u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ? | 594 | u32 id = readl(v2m_sysreg_base + (site == SYS_CFG_SITE_DB2 ? |
595 | V2M_SYS_PROCID1 : V2M_SYS_PROCID0)); | 595 | V2M_SYS_PROCID1 : V2M_SYS_PROCID0)); |
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 364191f3be43..c95c5cb212fd 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
@@ -41,20 +41,24 @@ libs-y := arch/arm64/lib/ $(libs-y) | |||
41 | libs-y += $(LIBGCC) | 41 | libs-y += $(LIBGCC) |
42 | 42 | ||
43 | # Default target when executing plain make | 43 | # Default target when executing plain make |
44 | KBUILD_IMAGE := Image.gz | 44 | KBUILD_IMAGE := Image.gz |
45 | KBUILD_DTBS := dtbs | ||
45 | 46 | ||
46 | all: $(KBUILD_IMAGE) | 47 | all: $(KBUILD_IMAGE) $(KBUILD_DTBS) |
47 | 48 | ||
48 | boot := arch/arm64/boot | 49 | boot := arch/arm64/boot |
49 | 50 | ||
50 | Image Image.gz: vmlinux | 51 | Image Image.gz: vmlinux |
51 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 52 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
52 | 53 | ||
53 | zinstall install: vmlinux | 54 | zinstall install: vmlinux |
54 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 55 | $(Q)$(MAKE) $(build)=$(boot) $@ |
55 | 56 | ||
56 | %.dtb: | 57 | %.dtb: scripts |
57 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ | 58 | $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ |
59 | |||
60 | dtbs: scripts | ||
61 | $(Q)$(MAKE) $(build)=$(boot)/dts dtbs | ||
58 | 62 | ||
59 | # We use MRPROPER_FILES and CLEAN_FILES now | 63 | # We use MRPROPER_FILES and CLEAN_FILES now |
60 | archclean: | 64 | archclean: |
@@ -63,6 +67,7 @@ archclean: | |||
63 | define archhelp | 67 | define archhelp |
64 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' | 68 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' |
65 | echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' | 69 | echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' |
70 | echo '* dtbs - Build device tree blobs for enabled boards' | ||
66 | echo ' install - Install uncompressed kernel' | 71 | echo ' install - Install uncompressed kernel' |
67 | echo ' zinstall - Install compressed kernel' | 72 | echo ' zinstall - Install compressed kernel' |
68 | echo ' Install using (your) ~/bin/installkernel or' | 73 | echo ' Install using (your) ~/bin/installkernel or' |
diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile index eca209b2b0bf..5a0e3ab854a5 100644 --- a/arch/arm64/boot/Makefile +++ b/arch/arm64/boot/Makefile | |||
@@ -22,9 +22,6 @@ $(obj)/Image: vmlinux FORCE | |||
22 | $(obj)/Image.gz: $(obj)/Image FORCE | 22 | $(obj)/Image.gz: $(obj)/Image FORCE |
23 | $(call if_changed,gzip) | 23 | $(call if_changed,gzip) |
24 | 24 | ||
25 | $(obj)/%.dtb: $(src)/dts/%.dts | ||
26 | $(call cmd,dtc) | ||
27 | |||
28 | install: $(obj)/Image | 25 | install: $(obj)/Image |
29 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 26 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ |
30 | $(obj)/Image System.map "$(INSTALL_PATH)" | 27 | $(obj)/Image System.map "$(INSTALL_PATH)" |
@@ -32,5 +29,3 @@ install: $(obj)/Image | |||
32 | zinstall: $(obj)/Image.gz | 29 | zinstall: $(obj)/Image.gz |
33 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | 30 | $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ |
34 | $(obj)/Image.gz System.map "$(INSTALL_PATH)" | 31 | $(obj)/Image.gz System.map "$(INSTALL_PATH)" |
35 | |||
36 | clean-files += *.dtb | ||
diff --git a/arch/arm64/boot/dts/.gitignore b/arch/arm64/boot/dts/.gitignore new file mode 100644 index 000000000000..b60ed208c779 --- /dev/null +++ b/arch/arm64/boot/dts/.gitignore | |||
@@ -0,0 +1 @@ | |||
*.dtb | |||
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile new file mode 100644 index 000000000000..801e2d7fcbc6 --- /dev/null +++ b/arch/arm64/boot/dts/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | targets += dtbs | ||
2 | |||
3 | dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
4 | |||
5 | clean-files := *.dtb | ||
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile index a9eb9597e03c..e72eb3417239 100644 --- a/arch/c6x/Makefile +++ b/arch/c6x/Makefile | |||
@@ -41,7 +41,7 @@ DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS))) | |||
41 | export DTB | 41 | export DTB |
42 | 42 | ||
43 | ifneq ($(DTB),) | 43 | ifneq ($(DTB),) |
44 | core-y += $(boot)/ | 44 | core-y += $(boot)/dts/ |
45 | endif | 45 | endif |
46 | 46 | ||
47 | # With make 3.82 we cannot mix normal and wildcard targets | 47 | # With make 3.82 we cannot mix normal and wildcard targets |
diff --git a/arch/c6x/boot/Makefile b/arch/c6x/boot/Makefile index 6891257d514c..8734abee548e 100644 --- a/arch/c6x/boot/Makefile +++ b/arch/c6x/boot/Makefile | |||
@@ -6,25 +6,5 @@ OBJCOPYFLAGS_vmlinux.bin := -O binary | |||
6 | $(obj)/vmlinux.bin: vmlinux FORCE | 6 | $(obj)/vmlinux.bin: vmlinux FORCE |
7 | $(call if_changed,objcopy) | 7 | $(call if_changed,objcopy) |
8 | 8 | ||
9 | DTC_FLAGS ?= -p 1024 | ||
10 | |||
11 | ifneq ($(DTB),) | ||
12 | obj-y += linked_dtb.o | ||
13 | endif | ||
14 | |||
15 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
16 | $(call if_changed_dep,dtc) | ||
17 | |||
18 | quiet_cmd_cp = CP $< $@$2 | ||
19 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
20 | |||
21 | # Generate builtin.dtb from $(DTB).dtb | ||
22 | $(obj)/builtin.dtb: $(obj)/$(DTB).dtb | ||
23 | $(call if_changed,cp) | ||
24 | |||
25 | $(obj)/linked_dtb.o: $(obj)/builtin.dtb | ||
26 | |||
27 | $(obj)/dtbImage.%: vmlinux | 9 | $(obj)/dtbImage.%: vmlinux |
28 | $(call if_changed,objcopy) | 10 | $(call if_changed,objcopy) |
29 | |||
30 | clean-files := $(obj)/*.dtb | ||
diff --git a/arch/c6x/boot/dts/Makefile b/arch/c6x/boot/dts/Makefile new file mode 100644 index 000000000000..c7528b02d061 --- /dev/null +++ b/arch/c6x/boot/dts/Makefile | |||
@@ -0,0 +1,20 @@ | |||
1 | # | ||
2 | # Makefile for device trees | ||
3 | # | ||
4 | |||
5 | DTC_FLAGS ?= -p 1024 | ||
6 | |||
7 | ifneq ($(DTB),) | ||
8 | obj-y += linked_dtb.o | ||
9 | endif | ||
10 | |||
11 | quiet_cmd_cp = CP $< $@$2 | ||
12 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
13 | |||
14 | # Generate builtin.dtb from $(DTB).dtb | ||
15 | $(obj)/builtin.dtb: $(obj)/$(DTB).dtb | ||
16 | $(call if_changed,cp) | ||
17 | |||
18 | $(obj)/linked_dtb.o: $(obj)/builtin.dtb | ||
19 | |||
20 | clean-files := *.dtb | ||
diff --git a/arch/c6x/boot/dts/linked_dtb.S b/arch/c6x/boot/dts/linked_dtb.S new file mode 100644 index 000000000000..cf347f1d16ce --- /dev/null +++ b/arch/c6x/boot/dts/linked_dtb.S | |||
@@ -0,0 +1,2 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/c6x/boot/dts/builtin.dtb" | ||
diff --git a/arch/c6x/boot/linked_dtb.S b/arch/c6x/boot/linked_dtb.S deleted file mode 100644 index 57a4454eaec3..000000000000 --- a/arch/c6x/boot/linked_dtb.S +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/c6x/boot/builtin.dtb" | ||
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index b23c40eb7a52..d26fb905ee0a 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile | |||
@@ -57,7 +57,7 @@ boot := arch/microblaze/boot | |||
57 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS))) | 57 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS))) |
58 | 58 | ||
59 | ifneq ($(DTB),) | 59 | ifneq ($(DTB),) |
60 | core-y += $(boot)/ | 60 | core-y += $(boot)/dts/ |
61 | endif | 61 | endif |
62 | 62 | ||
63 | # defines filename extension depending memory management type | 63 | # defines filename extension depending memory management type |
diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index fa83ea497db7..80fe54fb7ca3 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile | |||
@@ -2,21 +2,10 @@ | |||
2 | # arch/microblaze/boot/Makefile | 2 | # arch/microblaze/boot/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += linked_dtb.o | ||
6 | |||
7 | targets := linux.bin linux.bin.gz simpleImage.% | 5 | targets := linux.bin linux.bin.gz simpleImage.% |
8 | 6 | ||
9 | OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary | 7 | OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary |
10 | 8 | ||
11 | # Ensure system.dtb exists | ||
12 | $(obj)/linked_dtb.o: $(obj)/system.dtb | ||
13 | |||
14 | # Generate system.dtb from $(DTB).dtb | ||
15 | ifneq ($(DTB),system) | ||
16 | $(obj)/system.dtb: $(obj)/$(DTB).dtb | ||
17 | $(call if_changed,cp) | ||
18 | endif | ||
19 | |||
20 | $(obj)/linux.bin: vmlinux FORCE | 9 | $(obj)/linux.bin: vmlinux FORCE |
21 | $(call if_changed,objcopy) | 10 | $(call if_changed,objcopy) |
22 | $(call if_changed,uimage) | 11 | $(call if_changed,uimage) |
@@ -45,10 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE | |||
45 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | 34 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
46 | 35 | ||
47 | 36 | ||
48 | # Rule to build device tree blobs | 37 | clean-files += simpleImage.*.unstrip linux.bin.ub |
49 | DTC_FLAGS := -p 1024 | ||
50 | |||
51 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
52 | $(call if_changed_dep,dtc) | ||
53 | |||
54 | clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub | ||
diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile new file mode 100644 index 000000000000..c3b3a5d67b89 --- /dev/null +++ b/arch/microblaze/boot/dts/Makefile | |||
@@ -0,0 +1,22 @@ | |||
1 | # | ||
2 | # arch/microblaze/boot/Makefile | ||
3 | # | ||
4 | |||
5 | obj-y += linked_dtb.o | ||
6 | |||
7 | # Ensure system.dtb exists | ||
8 | $(obj)/linked_dtb.o: $(obj)/system.dtb | ||
9 | |||
10 | # Generate system.dtb from $(DTB).dtb | ||
11 | ifneq ($(DTB),system) | ||
12 | $(obj)/system.dtb: $(obj)/$(DTB).dtb | ||
13 | $(call if_changed,cp) | ||
14 | endif | ||
15 | |||
16 | quiet_cmd_cp = CP $< $@$2 | ||
17 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
18 | |||
19 | # Rule to build device tree blobs | ||
20 | DTC_FLAGS := -p 1024 | ||
21 | |||
22 | clean-files += *.dtb | ||
diff --git a/arch/microblaze/boot/dts/linked_dtb.S b/arch/microblaze/boot/dts/linked_dtb.S new file mode 100644 index 000000000000..23345af3721f --- /dev/null +++ b/arch/microblaze/boot/dts/linked_dtb.S | |||
@@ -0,0 +1,2 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/microblaze/boot/dts/system.dtb" | ||
diff --git a/arch/microblaze/boot/linked_dtb.S b/arch/microblaze/boot/linked_dtb.S deleted file mode 100644 index cb2b537aebee..000000000000 --- a/arch/microblaze/boot/linked_dtb.S +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/microblaze/boot/system.dtb" | ||
3 | |||
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile index bc96e2908f14..6e927cf20df2 100644 --- a/arch/mips/cavium-octeon/Makefile +++ b/arch/mips/cavium-octeon/Makefile | |||
@@ -24,9 +24,6 @@ DTB_FILES = $(patsubst %.dts, %.dtb, $(DTS_FILES)) | |||
24 | 24 | ||
25 | obj-y += $(patsubst %.dts, %.dtb.o, $(DTS_FILES)) | 25 | obj-y += $(patsubst %.dts, %.dtb.o, $(DTS_FILES)) |
26 | 26 | ||
27 | $(obj)/%.dtb: $(src)/%.dts FORCE | ||
28 | $(call if_changed_dep,dtc) | ||
29 | |||
30 | # Let's keep the .dtb files around in case we want to look at them. | 27 | # Let's keep the .dtb files around in case we want to look at them. |
31 | .SECONDARY: $(addprefix $(obj)/, $(DTB_FILES)) | 28 | .SECONDARY: $(addprefix $(obj)/, $(DTB_FILES)) |
32 | 29 | ||
diff --git a/arch/mips/lantiq/dts/Makefile b/arch/mips/lantiq/dts/Makefile index 674fca45f72d..6fa72dd641b2 100644 --- a/arch/mips/lantiq/dts/Makefile +++ b/arch/mips/lantiq/dts/Makefile | |||
@@ -1,4 +1 @@ | |||
1 | obj-$(CONFIG_DT_EASY50712) := easy50712.dtb.o | obj-$(CONFIG_DT_EASY50712) := easy50712.dtb.o | |
2 | |||
3 | $(obj)/%.dtb: $(obj)/%.dts | ||
4 | $(call if_changed,dtc) | ||
diff --git a/arch/mips/netlogic/dts/Makefile b/arch/mips/netlogic/dts/Makefile index 67ae3fe296f0..d117d46413aa 100644 --- a/arch/mips/netlogic/dts/Makefile +++ b/arch/mips/netlogic/dts/Makefile | |||
@@ -1,4 +1 @@ | |||
1 | obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o | obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o | |
2 | |||
3 | $(obj)/%.dtb: $(obj)/%.dts | ||
4 | $(call if_changed,dtc) | ||
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile index 966886c8daf5..4739b8302a58 100644 --- a/arch/openrisc/Makefile +++ b/arch/openrisc/Makefile | |||
@@ -50,6 +50,6 @@ BUILTIN_DTB := y | |||
50 | else | 50 | else |
51 | BUILTIN_DTB := n | 51 | BUILTIN_DTB := n |
52 | endif | 52 | endif |
53 | core-$(BUILTIN_DTB) += arch/openrisc/boot/ | 53 | core-$(BUILTIN_DTB) += arch/openrisc/boot/dts/ |
54 | 54 | ||
55 | all: vmlinux | 55 | all: vmlinux |
diff --git a/arch/openrisc/boot/Makefile b/arch/openrisc/boot/dts/Makefile index 09958358601a..b092d30d6c23 100644 --- a/arch/openrisc/boot/Makefile +++ b/arch/openrisc/boot/dts/Makefile | |||
@@ -1,5 +1,3 @@ | |||
1 | |||
2 | |||
3 | ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""' | 1 | ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""' |
4 | BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o | 2 | BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o |
5 | else | 3 | else |
@@ -10,6 +8,3 @@ obj-y += $(BUILTIN_DTB) | |||
10 | clean-files := *.dtb.S | 8 | clean-files := *.dtb.S |
11 | 9 | ||
12 | #DTC_FLAGS ?= -p 1024 | 10 | #DTC_FLAGS ?= -p 1024 |
13 | |||
14 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
15 | $(call if_changed_dep,dtc) | ||
diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c index b0c3777528a1..d588e48dff74 100644 --- a/arch/powerpc/platforms/powermac/pfunc_core.c +++ b/arch/powerpc/platforms/powermac/pfunc_core.c | |||
@@ -686,7 +686,7 @@ static int pmf_add_functions(struct pmf_device *dev, void *driverdata) | |||
686 | int count = 0; | 686 | int count = 0; |
687 | 687 | ||
688 | for (pp = dev->node->properties; pp != 0; pp = pp->next) { | 688 | for (pp = dev->node->properties; pp != 0; pp = pp->next) { |
689 | char *name; | 689 | const char *name; |
690 | if (strncmp(pp->name, PP_PREFIX, plen) != 0) | 690 | if (strncmp(pp->name, PP_PREFIX, plen) != 0) |
691 | continue; | 691 | continue; |
692 | name = pp->name + plen; | 692 | name = pp->name + plen; |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 39f71fba9b38..2f4668136b20 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -281,12 +281,11 @@ static struct property *new_property(const char *name, const int length, | |||
281 | if (!new) | 281 | if (!new) |
282 | return NULL; | 282 | return NULL; |
283 | 283 | ||
284 | if (!(new->name = kmalloc(strlen(name) + 1, GFP_KERNEL))) | 284 | if (!(new->name = kstrdup(name, GFP_KERNEL))) |
285 | goto cleanup; | 285 | goto cleanup; |
286 | if (!(new->value = kmalloc(length + 1, GFP_KERNEL))) | 286 | if (!(new->value = kmalloc(length + 1, GFP_KERNEL))) |
287 | goto cleanup; | 287 | goto cleanup; |
288 | 288 | ||
289 | strcpy(new->name, name); | ||
290 | memcpy(new->value, value, length); | 289 | memcpy(new->value, value, length); |
291 | *(((char *)new->value) + length) = 0; | 290 | *(((char *)new->value) + length) = 0; |
292 | new->length = length; | 291 | new->length = length; |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index ffb93ae9379b..01b62a62c635 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -136,7 +136,7 @@ static void __init setup_pci_atmu(struct pci_controller *hose, | |||
136 | u32 pcicsrbar = 0, pcicsrbar_sz; | 136 | u32 pcicsrbar = 0, pcicsrbar_sz; |
137 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | | 137 | u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL | |
138 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; | 138 | PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP; |
139 | char *name = hose->dn->full_name; | 139 | const char *name = hose->dn->full_name; |
140 | const u64 *reg; | 140 | const u64 *reg; |
141 | int len; | 141 | int len; |
142 | 142 | ||
diff --git a/arch/powerpc/sysdev/scom.c b/arch/powerpc/sysdev/scom.c index 702256a1ca11..9193e12df695 100644 --- a/arch/powerpc/sysdev/scom.c +++ b/arch/powerpc/sysdev/scom.c | |||
@@ -157,7 +157,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn, | |||
157 | ent->map = SCOM_MAP_INVALID; | 157 | ent->map = SCOM_MAP_INVALID; |
158 | spin_lock_init(&ent->lock); | 158 | spin_lock_init(&ent->lock); |
159 | snprintf(ent->name, 8, "scom%d", i); | 159 | snprintf(ent->name, 8, "scom%d", i); |
160 | ent->blob.data = dn->full_name; | 160 | ent->blob.data = (void*) dn->full_name; |
161 | ent->blob.size = strlen(dn->full_name); | 161 | ent->blob.size = strlen(dn->full_name); |
162 | 162 | ||
163 | dir = debugfs_create_dir(ent->name, root); | 163 | dir = debugfs_create_dir(ent->name, root); |
diff --git a/arch/sparc/kernel/pci_impl.h b/arch/sparc/kernel/pci_impl.h index 918a2031c8bb..5f688531f48c 100644 --- a/arch/sparc/kernel/pci_impl.h +++ b/arch/sparc/kernel/pci_impl.h | |||
@@ -88,7 +88,7 @@ struct pci_pbm_info { | |||
88 | int chip_revision; | 88 | int chip_revision; |
89 | 89 | ||
90 | /* Name used for top-level resources. */ | 90 | /* Name used for top-level resources. */ |
91 | char *name; | 91 | const char *name; |
92 | 92 | ||
93 | /* OBP specific information. */ | 93 | /* OBP specific information. */ |
94 | struct platform_device *op; | 94 | struct platform_device *op; |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index bffd5501ac2d..15da1ac7cf9e 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
@@ -9,10 +9,6 @@ | |||
9 | * kind, whether express or implied. | 9 | * kind, whether express or implied. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | ||
13 | * This driver can be used from the device tree, see | ||
14 | * Documentation/devicetree/bindings/i2c/ocore-i2c.txt | ||
15 | */ | ||
16 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
17 | #include <linux/module.h> | 13 | #include <linux/module.h> |
18 | #include <linux/init.h> | 14 | #include <linux/init.h> |
diff --git a/drivers/of/base.c b/drivers/of/base.c index af3b22ac7627..538e3cfad23e 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -45,7 +45,8 @@ struct alias_prop { | |||
45 | 45 | ||
46 | static LIST_HEAD(aliases_lookup); | 46 | static LIST_HEAD(aliases_lookup); |
47 | 47 | ||
48 | struct device_node *allnodes; | 48 | struct device_node *of_allnodes; |
49 | EXPORT_SYMBOL(of_allnodes); | ||
49 | struct device_node *of_chosen; | 50 | struct device_node *of_chosen; |
50 | struct device_node *of_aliases; | 51 | struct device_node *of_aliases; |
51 | 52 | ||
@@ -199,7 +200,7 @@ struct device_node *of_find_all_nodes(struct device_node *prev) | |||
199 | struct device_node *np; | 200 | struct device_node *np; |
200 | 201 | ||
201 | read_lock(&devtree_lock); | 202 | read_lock(&devtree_lock); |
202 | np = prev ? prev->allnext : allnodes; | 203 | np = prev ? prev->allnext : of_allnodes; |
203 | for (; np != NULL; np = np->allnext) | 204 | for (; np != NULL; np = np->allnext) |
204 | if (of_node_get(np)) | 205 | if (of_node_get(np)) |
205 | break; | 206 | break; |
@@ -422,7 +423,7 @@ EXPORT_SYMBOL(of_get_child_by_name); | |||
422 | */ | 423 | */ |
423 | struct device_node *of_find_node_by_path(const char *path) | 424 | struct device_node *of_find_node_by_path(const char *path) |
424 | { | 425 | { |
425 | struct device_node *np = allnodes; | 426 | struct device_node *np = of_allnodes; |
426 | 427 | ||
427 | read_lock(&devtree_lock); | 428 | read_lock(&devtree_lock); |
428 | for (; np; np = np->allnext) { | 429 | for (; np; np = np->allnext) { |
@@ -452,7 +453,7 @@ struct device_node *of_find_node_by_name(struct device_node *from, | |||
452 | struct device_node *np; | 453 | struct device_node *np; |
453 | 454 | ||
454 | read_lock(&devtree_lock); | 455 | read_lock(&devtree_lock); |
455 | np = from ? from->allnext : allnodes; | 456 | np = from ? from->allnext : of_allnodes; |
456 | for (; np; np = np->allnext) | 457 | for (; np; np = np->allnext) |
457 | if (np->name && (of_node_cmp(np->name, name) == 0) | 458 | if (np->name && (of_node_cmp(np->name, name) == 0) |
458 | && of_node_get(np)) | 459 | && of_node_get(np)) |
@@ -481,7 +482,7 @@ struct device_node *of_find_node_by_type(struct device_node *from, | |||
481 | struct device_node *np; | 482 | struct device_node *np; |
482 | 483 | ||
483 | read_lock(&devtree_lock); | 484 | read_lock(&devtree_lock); |
484 | np = from ? from->allnext : allnodes; | 485 | np = from ? from->allnext : of_allnodes; |
485 | for (; np; np = np->allnext) | 486 | for (; np; np = np->allnext) |
486 | if (np->type && (of_node_cmp(np->type, type) == 0) | 487 | if (np->type && (of_node_cmp(np->type, type) == 0) |
487 | && of_node_get(np)) | 488 | && of_node_get(np)) |
@@ -512,7 +513,7 @@ struct device_node *of_find_compatible_node(struct device_node *from, | |||
512 | struct device_node *np; | 513 | struct device_node *np; |
513 | 514 | ||
514 | read_lock(&devtree_lock); | 515 | read_lock(&devtree_lock); |
515 | np = from ? from->allnext : allnodes; | 516 | np = from ? from->allnext : of_allnodes; |
516 | for (; np; np = np->allnext) { | 517 | for (; np; np = np->allnext) { |
517 | if (type | 518 | if (type |
518 | && !(np->type && (of_node_cmp(np->type, type) == 0))) | 519 | && !(np->type && (of_node_cmp(np->type, type) == 0))) |
@@ -545,7 +546,7 @@ struct device_node *of_find_node_with_property(struct device_node *from, | |||
545 | struct property *pp; | 546 | struct property *pp; |
546 | 547 | ||
547 | read_lock(&devtree_lock); | 548 | read_lock(&devtree_lock); |
548 | np = from ? from->allnext : allnodes; | 549 | np = from ? from->allnext : of_allnodes; |
549 | for (; np; np = np->allnext) { | 550 | for (; np; np = np->allnext) { |
550 | for (pp = np->properties; pp; pp = pp->next) { | 551 | for (pp = np->properties; pp; pp = pp->next) { |
551 | if (of_prop_cmp(pp->name, prop_name) == 0) { | 552 | if (of_prop_cmp(pp->name, prop_name) == 0) { |
@@ -594,27 +595,35 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches, | |||
594 | EXPORT_SYMBOL(of_match_node); | 595 | EXPORT_SYMBOL(of_match_node); |
595 | 596 | ||
596 | /** | 597 | /** |
597 | * of_find_matching_node - Find a node based on an of_device_id match | 598 | * of_find_matching_node_and_match - Find a node based on an of_device_id |
598 | * table. | 599 | * match table. |
599 | * @from: The node to start searching from or NULL, the node | 600 | * @from: The node to start searching from or NULL, the node |
600 | * you pass will not be searched, only the next one | 601 | * you pass will not be searched, only the next one |
601 | * will; typically, you pass what the previous call | 602 | * will; typically, you pass what the previous call |
602 | * returned. of_node_put() will be called on it | 603 | * returned. of_node_put() will be called on it |
603 | * @matches: array of of device match structures to search in | 604 | * @matches: array of of device match structures to search in |
605 | * @match Updated to point at the matches entry which matched | ||
604 | * | 606 | * |
605 | * Returns a node pointer with refcount incremented, use | 607 | * Returns a node pointer with refcount incremented, use |
606 | * of_node_put() on it when done. | 608 | * of_node_put() on it when done. |
607 | */ | 609 | */ |
608 | struct device_node *of_find_matching_node(struct device_node *from, | 610 | struct device_node *of_find_matching_node_and_match(struct device_node *from, |
609 | const struct of_device_id *matches) | 611 | const struct of_device_id *matches, |
612 | const struct of_device_id **match) | ||
610 | { | 613 | { |
611 | struct device_node *np; | 614 | struct device_node *np; |
612 | 615 | ||
616 | if (match) | ||
617 | *match = NULL; | ||
618 | |||
613 | read_lock(&devtree_lock); | 619 | read_lock(&devtree_lock); |
614 | np = from ? from->allnext : allnodes; | 620 | np = from ? from->allnext : of_allnodes; |
615 | for (; np; np = np->allnext) { | 621 | for (; np; np = np->allnext) { |
616 | if (of_match_node(matches, np) && of_node_get(np)) | 622 | if (of_match_node(matches, np) && of_node_get(np)) { |
623 | if (match) | ||
624 | *match = matches; | ||
617 | break; | 625 | break; |
626 | } | ||
618 | } | 627 | } |
619 | of_node_put(from); | 628 | of_node_put(from); |
620 | read_unlock(&devtree_lock); | 629 | read_unlock(&devtree_lock); |
@@ -661,7 +670,7 @@ struct device_node *of_find_node_by_phandle(phandle handle) | |||
661 | struct device_node *np; | 670 | struct device_node *np; |
662 | 671 | ||
663 | read_lock(&devtree_lock); | 672 | read_lock(&devtree_lock); |
664 | for (np = allnodes; np; np = np->allnext) | 673 | for (np = of_allnodes; np; np = np->allnext) |
665 | if (np->phandle == handle) | 674 | if (np->phandle == handle) |
666 | break; | 675 | break; |
667 | of_node_get(np); | 676 | of_node_get(np); |
@@ -671,12 +680,89 @@ struct device_node *of_find_node_by_phandle(phandle handle) | |||
671 | EXPORT_SYMBOL(of_find_node_by_phandle); | 680 | EXPORT_SYMBOL(of_find_node_by_phandle); |
672 | 681 | ||
673 | /** | 682 | /** |
683 | * of_property_read_u8_array - Find and read an array of u8 from a property. | ||
684 | * | ||
685 | * @np: device node from which the property value is to be read. | ||
686 | * @propname: name of the property to be searched. | ||
687 | * @out_value: pointer to return value, modified only if return value is 0. | ||
688 | * @sz: number of array elements to read | ||
689 | * | ||
690 | * Search for a property in a device node and read 8-bit value(s) from | ||
691 | * it. Returns 0 on success, -EINVAL if the property does not exist, | ||
692 | * -ENODATA if property does not have a value, and -EOVERFLOW if the | ||
693 | * property data isn't large enough. | ||
694 | * | ||
695 | * dts entry of array should be like: | ||
696 | * property = /bits/ 8 <0x50 0x60 0x70>; | ||
697 | * | ||
698 | * The out_value is modified only if a valid u8 value can be decoded. | ||
699 | */ | ||
700 | int of_property_read_u8_array(const struct device_node *np, | ||
701 | const char *propname, u8 *out_values, size_t sz) | ||
702 | { | ||
703 | struct property *prop = of_find_property(np, propname, NULL); | ||
704 | const u8 *val; | ||
705 | |||
706 | if (!prop) | ||
707 | return -EINVAL; | ||
708 | if (!prop->value) | ||
709 | return -ENODATA; | ||
710 | if ((sz * sizeof(*out_values)) > prop->length) | ||
711 | return -EOVERFLOW; | ||
712 | |||
713 | val = prop->value; | ||
714 | while (sz--) | ||
715 | *out_values++ = *val++; | ||
716 | return 0; | ||
717 | } | ||
718 | EXPORT_SYMBOL_GPL(of_property_read_u8_array); | ||
719 | |||
720 | /** | ||
721 | * of_property_read_u16_array - Find and read an array of u16 from a property. | ||
722 | * | ||
723 | * @np: device node from which the property value is to be read. | ||
724 | * @propname: name of the property to be searched. | ||
725 | * @out_value: pointer to return value, modified only if return value is 0. | ||
726 | * @sz: number of array elements to read | ||
727 | * | ||
728 | * Search for a property in a device node and read 16-bit value(s) from | ||
729 | * it. Returns 0 on success, -EINVAL if the property does not exist, | ||
730 | * -ENODATA if property does not have a value, and -EOVERFLOW if the | ||
731 | * property data isn't large enough. | ||
732 | * | ||
733 | * dts entry of array should be like: | ||
734 | * property = /bits/ 16 <0x5000 0x6000 0x7000>; | ||
735 | * | ||
736 | * The out_value is modified only if a valid u16 value can be decoded. | ||
737 | */ | ||
738 | int of_property_read_u16_array(const struct device_node *np, | ||
739 | const char *propname, u16 *out_values, size_t sz) | ||
740 | { | ||
741 | struct property *prop = of_find_property(np, propname, NULL); | ||
742 | const __be16 *val; | ||
743 | |||
744 | if (!prop) | ||
745 | return -EINVAL; | ||
746 | if (!prop->value) | ||
747 | return -ENODATA; | ||
748 | if ((sz * sizeof(*out_values)) > prop->length) | ||
749 | return -EOVERFLOW; | ||
750 | |||
751 | val = prop->value; | ||
752 | while (sz--) | ||
753 | *out_values++ = be16_to_cpup(val++); | ||
754 | return 0; | ||
755 | } | ||
756 | EXPORT_SYMBOL_GPL(of_property_read_u16_array); | ||
757 | |||
758 | /** | ||
674 | * of_property_read_u32_array - Find and read an array of 32 bit integers | 759 | * of_property_read_u32_array - Find and read an array of 32 bit integers |
675 | * from a property. | 760 | * from a property. |
676 | * | 761 | * |
677 | * @np: device node from which the property value is to be read. | 762 | * @np: device node from which the property value is to be read. |
678 | * @propname: name of the property to be searched. | 763 | * @propname: name of the property to be searched. |
679 | * @out_value: pointer to return value, modified only if return value is 0. | 764 | * @out_value: pointer to return value, modified only if return value is 0. |
765 | * @sz: number of array elements to read | ||
680 | * | 766 | * |
681 | * Search for a property in a device node and read 32-bit value(s) from | 767 | * Search for a property in a device node and read 32-bit value(s) from |
682 | * it. Returns 0 on success, -EINVAL if the property does not exist, | 768 | * it. Returns 0 on success, -EINVAL if the property does not exist, |
@@ -893,8 +979,8 @@ EXPORT_SYMBOL_GPL(of_property_count_strings); | |||
893 | * Returns the device_node pointer with refcount incremented. Use | 979 | * Returns the device_node pointer with refcount incremented. Use |
894 | * of_node_put() on it when done. | 980 | * of_node_put() on it when done. |
895 | */ | 981 | */ |
896 | struct device_node * | 982 | struct device_node *of_parse_phandle(const struct device_node *np, |
897 | of_parse_phandle(struct device_node *np, const char *phandle_name, int index) | 983 | const char *phandle_name, int index) |
898 | { | 984 | { |
899 | const __be32 *phandle; | 985 | const __be32 *phandle; |
900 | int size; | 986 | int size; |
@@ -1169,9 +1255,9 @@ void of_attach_node(struct device_node *np) | |||
1169 | 1255 | ||
1170 | write_lock_irqsave(&devtree_lock, flags); | 1256 | write_lock_irqsave(&devtree_lock, flags); |
1171 | np->sibling = np->parent->child; | 1257 | np->sibling = np->parent->child; |
1172 | np->allnext = allnodes; | 1258 | np->allnext = of_allnodes; |
1173 | np->parent->child = np; | 1259 | np->parent->child = np; |
1174 | allnodes = np; | 1260 | of_allnodes = np; |
1175 | write_unlock_irqrestore(&devtree_lock, flags); | 1261 | write_unlock_irqrestore(&devtree_lock, flags); |
1176 | } | 1262 | } |
1177 | 1263 | ||
@@ -1192,11 +1278,11 @@ void of_detach_node(struct device_node *np) | |||
1192 | if (!parent) | 1278 | if (!parent) |
1193 | goto out_unlock; | 1279 | goto out_unlock; |
1194 | 1280 | ||
1195 | if (allnodes == np) | 1281 | if (of_allnodes == np) |
1196 | allnodes = np->allnext; | 1282 | of_allnodes = np->allnext; |
1197 | else { | 1283 | else { |
1198 | struct device_node *prev; | 1284 | struct device_node *prev; |
1199 | for (prev = allnodes; | 1285 | for (prev = of_allnodes; |
1200 | prev->allnext != np; | 1286 | prev->allnext != np; |
1201 | prev = prev->allnext) | 1287 | prev = prev->allnext) |
1202 | ; | 1288 | ; |
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 91a375fb6ae6..a65c39c473bf 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -186,6 +186,8 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, | |||
186 | */ | 186 | */ |
187 | fpsize = 1; | 187 | fpsize = 1; |
188 | allocl = 2; | 188 | allocl = 2; |
189 | l = 1; | ||
190 | *pathp = '\0'; | ||
189 | } else { | 191 | } else { |
190 | /* account for '/' and path size minus terminal 0 | 192 | /* account for '/' and path size minus terminal 0 |
191 | * already in 'l' | 193 | * already in 'l' |
@@ -198,10 +200,10 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, | |||
198 | np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, | 200 | np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl, |
199 | __alignof__(struct device_node)); | 201 | __alignof__(struct device_node)); |
200 | if (allnextpp) { | 202 | if (allnextpp) { |
203 | char *fn; | ||
201 | memset(np, 0, sizeof(*np)); | 204 | memset(np, 0, sizeof(*np)); |
202 | np->full_name = ((char *)np) + sizeof(struct device_node); | 205 | np->full_name = fn = ((char *)np) + sizeof(*np); |
203 | if (new_format) { | 206 | if (new_format) { |
204 | char *fn = np->full_name; | ||
205 | /* rebuild full path for new format */ | 207 | /* rebuild full path for new format */ |
206 | if (dad && dad->parent) { | 208 | if (dad && dad->parent) { |
207 | strcpy(fn, dad->full_name); | 209 | strcpy(fn, dad->full_name); |
@@ -215,9 +217,9 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob, | |||
215 | fn += strlen(fn); | 217 | fn += strlen(fn); |
216 | } | 218 | } |
217 | *(fn++) = '/'; | 219 | *(fn++) = '/'; |
218 | memcpy(fn, pathp, l); | 220 | } |
219 | } else | 221 | memcpy(fn, pathp, l); |
220 | memcpy(np->full_name, pathp, l); | 222 | |
221 | prev_pp = &np->properties; | 223 | prev_pp = &np->properties; |
222 | **allnextpp = np; | 224 | **allnextpp = np; |
223 | *allnextpp = &np->allnext; | 225 | *allnextpp = &np->allnext; |
@@ -459,7 +461,7 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, | |||
459 | 461 | ||
460 | do { | 462 | do { |
461 | u32 tag = be32_to_cpup((__be32 *)p); | 463 | u32 tag = be32_to_cpup((__be32 *)p); |
462 | char *pathp; | 464 | const char *pathp; |
463 | 465 | ||
464 | p += 4; | 466 | p += 4; |
465 | if (tag == OF_DT_END_NODE) { | 467 | if (tag == OF_DT_END_NODE) { |
@@ -487,7 +489,7 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, | |||
487 | pathp = (char *)p; | 489 | pathp = (char *)p; |
488 | p = ALIGN(p + strlen(pathp) + 1, 4); | 490 | p = ALIGN(p + strlen(pathp) + 1, 4); |
489 | if ((*pathp) == '/') { | 491 | if ((*pathp) == '/') { |
490 | char *lp, *np; | 492 | const char *lp, *np; |
491 | for (lp = NULL, np = pathp; *np; np++) | 493 | for (lp = NULL, np = pathp; *np; np++) |
492 | if ((*np) == '/') | 494 | if ((*np) == '/') |
493 | lp = np+1; | 495 | lp = np+1; |
@@ -710,7 +712,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
710 | */ | 712 | */ |
711 | void __init unflatten_device_tree(void) | 713 | void __init unflatten_device_tree(void) |
712 | { | 714 | { |
713 | __unflatten_device_tree(initial_boot_params, &allnodes, | 715 | __unflatten_device_tree(initial_boot_params, &of_allnodes, |
714 | early_init_dt_alloc_memory_arch); | 716 | early_init_dt_alloc_memory_arch); |
715 | 717 | ||
716 | /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ | 718 | /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ |
diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c index 3550f3bf4f92..b667264222cc 100644 --- a/drivers/of/of_i2c.c +++ b/drivers/of/of_i2c.c | |||
@@ -29,7 +29,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap) | |||
29 | 29 | ||
30 | dev_dbg(&adap->dev, "of_i2c: walking child nodes\n"); | 30 | dev_dbg(&adap->dev, "of_i2c: walking child nodes\n"); |
31 | 31 | ||
32 | for_each_child_of_node(adap->dev.of_node, node) { | 32 | for_each_available_child_of_node(adap->dev.of_node, node) { |
33 | struct i2c_board_info info = {}; | 33 | struct i2c_board_info info = {}; |
34 | struct dev_archdata dev_ad = {}; | 34 | struct dev_archdata dev_ad = {}; |
35 | const __be32 *addr; | 35 | const __be32 *addr; |
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 8e6c25f35040..83ca06f4312b 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -53,7 +53,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
53 | return rc; | 53 | return rc; |
54 | 54 | ||
55 | /* Loop over the child nodes and register a phy_device for each one */ | 55 | /* Loop over the child nodes and register a phy_device for each one */ |
56 | for_each_child_of_node(np, child) { | 56 | for_each_available_child_of_node(np, child) { |
57 | const __be32 *paddr; | 57 | const __be32 *paddr; |
58 | u32 addr; | 58 | u32 addr; |
59 | int len; | 59 | int len; |
diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c index 07cc1d678e4d..37b56fd716e6 100644 --- a/drivers/of/pdt.c +++ b/drivers/of/pdt.c | |||
@@ -241,15 +241,15 @@ void __init of_pdt_build_devicetree(phandle root_node, struct of_pdt_ops *ops) | |||
241 | BUG_ON(!ops); | 241 | BUG_ON(!ops); |
242 | of_pdt_prom_ops = ops; | 242 | of_pdt_prom_ops = ops; |
243 | 243 | ||
244 | allnodes = of_pdt_create_node(root_node, NULL); | 244 | of_allnodes = of_pdt_create_node(root_node, NULL); |
245 | #if defined(CONFIG_SPARC) | 245 | #if defined(CONFIG_SPARC) |
246 | allnodes->path_component_name = ""; | 246 | of_allnodes->path_component_name = ""; |
247 | #endif | 247 | #endif |
248 | allnodes->full_name = "/"; | 248 | of_allnodes->full_name = "/"; |
249 | 249 | ||
250 | nextp = &allnodes->allnext; | 250 | nextp = &of_allnodes->allnext; |
251 | allnodes->child = of_pdt_build_tree(allnodes, | 251 | of_allnodes->child = of_pdt_build_tree(of_allnodes, |
252 | of_pdt_prom_ops->getchild(allnodes->phandle), &nextp); | 252 | of_pdt_prom_ops->getchild(of_allnodes->phandle), &nextp); |
253 | 253 | ||
254 | /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ | 254 | /* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */ |
255 | of_alias_scan(kernel_tree_alloc); | 255 | of_alias_scan(kernel_tree_alloc); |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 84c2861d6f4d..d3e64080c409 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -819,7 +819,7 @@ static void of_register_spi_devices(struct spi_master *master) | |||
819 | if (!master->dev.of_node) | 819 | if (!master->dev.of_node) |
820 | return; | 820 | return; |
821 | 821 | ||
822 | for_each_child_of_node(master->dev.of_node, nc) { | 822 | for_each_available_child_of_node(master->dev.of_node, nc) { |
823 | /* Alloc an spi_device */ | 823 | /* Alloc an spi_device */ |
824 | spi = spi_alloc_device(master); | 824 | spi = spi_alloc_device(master); |
825 | if (!spi) { | 825 | if (!spi) { |
diff --git a/include/linux/of.h b/include/linux/of.h index b4e50d56fc74..60053bd7e79a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -46,7 +46,7 @@ struct device_node { | |||
46 | const char *name; | 46 | const char *name; |
47 | const char *type; | 47 | const char *type; |
48 | phandle phandle; | 48 | phandle phandle; |
49 | char *full_name; | 49 | const char *full_name; |
50 | 50 | ||
51 | struct property *properties; | 51 | struct property *properties; |
52 | struct property *deadprops; /* removed properties */ | 52 | struct property *deadprops; /* removed properties */ |
@@ -60,7 +60,7 @@ struct device_node { | |||
60 | unsigned long _flags; | 60 | unsigned long _flags; |
61 | void *data; | 61 | void *data; |
62 | #if defined(CONFIG_SPARC) | 62 | #if defined(CONFIG_SPARC) |
63 | char *path_component_name; | 63 | const char *path_component_name; |
64 | unsigned int unique_id; | 64 | unsigned int unique_id; |
65 | struct of_irq_controller *irq_trans; | 65 | struct of_irq_controller *irq_trans; |
66 | #endif | 66 | #endif |
@@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { } | |||
88 | #ifdef CONFIG_OF | 88 | #ifdef CONFIG_OF |
89 | 89 | ||
90 | /* Pointer for first entry in chain of all nodes. */ | 90 | /* Pointer for first entry in chain of all nodes. */ |
91 | extern struct device_node *allnodes; | 91 | extern struct device_node *of_allnodes; |
92 | extern struct device_node *of_chosen; | 92 | extern struct device_node *of_chosen; |
93 | extern struct device_node *of_aliases; | 93 | extern struct device_node *of_aliases; |
94 | extern rwlock_t devtree_lock; | 94 | extern rwlock_t devtree_lock; |
95 | 95 | ||
96 | static inline bool of_have_populated_dt(void) | 96 | static inline bool of_have_populated_dt(void) |
97 | { | 97 | { |
98 | return allnodes != NULL; | 98 | return of_allnodes != NULL; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline bool of_node_is_root(const struct device_node *node) | 101 | static inline bool of_node_is_root(const struct device_node *node) |
@@ -179,11 +179,22 @@ extern struct device_node *of_find_compatible_node(struct device_node *from, | |||
179 | #define for_each_compatible_node(dn, type, compatible) \ | 179 | #define for_each_compatible_node(dn, type, compatible) \ |
180 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | 180 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ |
181 | dn = of_find_compatible_node(dn, type, compatible)) | 181 | dn = of_find_compatible_node(dn, type, compatible)) |
182 | extern struct device_node *of_find_matching_node(struct device_node *from, | 182 | extern struct device_node *of_find_matching_node_and_match( |
183 | const struct of_device_id *matches); | 183 | struct device_node *from, |
184 | const struct of_device_id *matches, | ||
185 | const struct of_device_id **match); | ||
186 | static inline struct device_node *of_find_matching_node( | ||
187 | struct device_node *from, | ||
188 | const struct of_device_id *matches) | ||
189 | { | ||
190 | return of_find_matching_node_and_match(from, matches, NULL); | ||
191 | } | ||
184 | #define for_each_matching_node(dn, matches) \ | 192 | #define for_each_matching_node(dn, matches) \ |
185 | for (dn = of_find_matching_node(NULL, matches); dn; \ | 193 | for (dn = of_find_matching_node(NULL, matches); dn; \ |
186 | dn = of_find_matching_node(dn, matches)) | 194 | dn = of_find_matching_node(dn, matches)) |
195 | #define for_each_matching_node_and_match(dn, matches, match) \ | ||
196 | for (dn = of_find_matching_node_and_match(NULL, matches, match); \ | ||
197 | dn; dn = of_find_matching_node_and_match(dn, matches, match)) | ||
187 | extern struct device_node *of_find_node_by_path(const char *path); | 198 | extern struct device_node *of_find_node_by_path(const char *path); |
188 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 199 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
189 | extern struct device_node *of_get_parent(const struct device_node *node); | 200 | extern struct device_node *of_get_parent(const struct device_node *node); |
@@ -223,6 +234,10 @@ extern struct device_node *of_find_node_with_property( | |||
223 | extern struct property *of_find_property(const struct device_node *np, | 234 | extern struct property *of_find_property(const struct device_node *np, |
224 | const char *name, | 235 | const char *name, |
225 | int *lenp); | 236 | int *lenp); |
237 | extern int of_property_read_u8_array(const struct device_node *np, | ||
238 | const char *propname, u8 *out_values, size_t sz); | ||
239 | extern int of_property_read_u16_array(const struct device_node *np, | ||
240 | const char *propname, u16 *out_values, size_t sz); | ||
226 | extern int of_property_read_u32_array(const struct device_node *np, | 241 | extern int of_property_read_u32_array(const struct device_node *np, |
227 | const char *propname, | 242 | const char *propname, |
228 | u32 *out_values, | 243 | u32 *out_values, |
@@ -255,7 +270,7 @@ extern int of_n_size_cells(struct device_node *np); | |||
255 | extern const struct of_device_id *of_match_node( | 270 | extern const struct of_device_id *of_match_node( |
256 | const struct of_device_id *matches, const struct device_node *node); | 271 | const struct of_device_id *matches, const struct device_node *node); |
257 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 272 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
258 | extern struct device_node *of_parse_phandle(struct device_node *np, | 273 | extern struct device_node *of_parse_phandle(const struct device_node *np, |
259 | const char *phandle_name, | 274 | const char *phandle_name, |
260 | int index); | 275 | int index); |
261 | extern int of_parse_phandle_with_args(struct device_node *np, | 276 | extern int of_parse_phandle_with_args(struct device_node *np, |
@@ -364,6 +379,18 @@ static inline struct device_node *of_find_compatible_node( | |||
364 | return NULL; | 379 | return NULL; |
365 | } | 380 | } |
366 | 381 | ||
382 | static inline int of_property_read_u8_array(const struct device_node *np, | ||
383 | const char *propname, u8 *out_values, size_t sz) | ||
384 | { | ||
385 | return -ENOSYS; | ||
386 | } | ||
387 | |||
388 | static inline int of_property_read_u16_array(const struct device_node *np, | ||
389 | const char *propname, u16 *out_values, size_t sz) | ||
390 | { | ||
391 | return -ENOSYS; | ||
392 | } | ||
393 | |||
367 | static inline int of_property_read_u32_array(const struct device_node *np, | 394 | static inline int of_property_read_u32_array(const struct device_node *np, |
368 | const char *propname, | 395 | const char *propname, |
369 | u32 *out_values, size_t sz) | 396 | u32 *out_values, size_t sz) |
@@ -411,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np, | |||
411 | return -ENOSYS; | 438 | return -ENOSYS; |
412 | } | 439 | } |
413 | 440 | ||
414 | static inline struct device_node *of_parse_phandle(struct device_node *np, | 441 | static inline struct device_node *of_parse_phandle(const struct device_node *np, |
415 | const char *phandle_name, | 442 | const char *phandle_name, |
416 | int index) | 443 | int index) |
417 | { | 444 | { |
@@ -470,6 +497,20 @@ static inline bool of_property_read_bool(const struct device_node *np, | |||
470 | return prop ? true : false; | 497 | return prop ? true : false; |
471 | } | 498 | } |
472 | 499 | ||
500 | static inline int of_property_read_u8(const struct device_node *np, | ||
501 | const char *propname, | ||
502 | u8 *out_value) | ||
503 | { | ||
504 | return of_property_read_u8_array(np, propname, out_value, 1); | ||
505 | } | ||
506 | |||
507 | static inline int of_property_read_u16(const struct device_node *np, | ||
508 | const char *propname, | ||
509 | u16 *out_value) | ||
510 | { | ||
511 | return of_property_read_u16_array(np, propname, out_value, 1); | ||
512 | } | ||
513 | |||
473 | static inline int of_property_read_u32(const struct device_node *np, | 514 | static inline int of_property_read_u32(const struct device_node *np, |
474 | const char *propname, | 515 | const char *propname, |
475 | u32 *out_value) | 516 | u32 *out_value) |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0be6f110cce7..bdf42fdf64c9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb | |||
266 | quiet_cmd_dtc = DTC $@ | 266 | quiet_cmd_dtc = DTC $@ |
267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< | 267 | cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $< |
268 | 268 | ||
269 | $(obj)/%.dtb: $(src)/%.dts FORCE | ||
270 | $(call if_changed_dep,dtc) | ||
271 | |||
269 | # Bzip2 | 272 | # Bzip2 |
270 | # --------------------------------------------------------------------------- | 273 | # --------------------------------------------------------------------------- |
271 | 274 | ||
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 6d1c6bb9f224..2a48022c41e7 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile | |||
@@ -27,3 +27,5 @@ HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) | |||
27 | # dependencies on generated files need to be listed explicitly | 27 | # dependencies on generated files need to be listed explicitly |
28 | $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h | 28 | $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h |
29 | 29 | ||
30 | # generated files need to be cleaned explicitly | ||
31 | clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h | ||