aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-11 06:47:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-11 06:47:50 -0400
commite98d6e7f7625ed60c7bc1d39aeb2375ed3918fd5 (patch)
treebc6e9a6428229d2fca73e1447b5cbfe59866c4b4
parent4e0b7fe38345b81930363b9f1b4b324181ddcc9e (diff)
parent2118f4b8dfc666c3e4a9e262beca79636a0852fe (diff)
Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux
Pull devicetree changes from Grant Likely: "This branch contains bug fixes and new features for the devicetree code. Most of the changes are either new testcases for the selftest code or documentation changes. The most notable change is the addition of a phandle resolver for use when grafting in a second device tree blob into the core tree. The resolver isn't currently used by anything other than the selftest module, but it will be used to support device tree overlays; probably in the v3.19 timeframe. Also note that I've moved my normal tree from git.secretlab.ca to git.kernel.org" * tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux: of/selftest: Move hash table off stack to fix large frame size To remove non-ascii characters in of_selftest.txt of/selftest: Use the resolver to fixup phandles of: Introduce Device Tree resolve support. of/selftest: Add a test for duplicate phandles of: Don't try to search when phandle == 0 of/selftest: Test structure of device tree of: Fix NULL dereference in selftest removal code of: add vendor prefix for Chipidea of: Add vendor prefix for Innolux Corporation of: Add vendor prefix for Sitronix devicetree: bindings: Document Gateworks vendor prefix of: Add vendor prefix for Energy Micro dt/documentation: add specification of dma bus information
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt4
-rw-r--r--Documentation/devicetree/booting-without-of.txt53
-rw-r--r--Documentation/devicetree/dynamic-resolution-notes.txt25
-rw-r--r--Documentation/devicetree/of_selftest.txt30
-rw-r--r--drivers/of/Kconfig4
-rw-r--r--drivers/of/Makefile1
-rw-r--r--drivers/of/base.c3
-rw-r--r--drivers/of/resolver.c336
-rw-r--r--drivers/of/selftest.c120
-rw-r--r--drivers/of/testcase-data/testcases.dts35
-rw-r--r--include/linux/of.h3
11 files changed, 590 insertions, 24 deletions
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 71259df60e96..f67e3f84e8bc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -46,6 +46,7 @@ dmo Data Modul AG
46ebv EBV Elektronik 46ebv EBV Elektronik
47edt Emerging Display Technologies 47edt Emerging Display Technologies
48emmicro EM Microelectronic 48emmicro EM Microelectronic
49energymicro Silicon Laboratories (formerly Energy Micro AS)
49epcos EPCOS AG 50epcos EPCOS AG
50epfl Ecole Polytechnique Fédérale de Lausanne 51epfl Ecole Polytechnique Fédérale de Lausanne
51epson Seiko Epson Corp. 52epson Seiko Epson Corp.
@@ -62,6 +63,7 @@ globalscale Globalscale Technologies, Inc.
62gmt Global Mixed-mode Technology, Inc. 63gmt Global Mixed-mode Technology, Inc.
63google Google, Inc. 64google Google, Inc.
64gumstix Gumstix, Inc. 65gumstix Gumstix, Inc.
66gw Gateworks Corporation
65haoyu Haoyu Microelectronic Co. Ltd. 67haoyu Haoyu Microelectronic Co. Ltd.
66hisilicon Hisilicon Limited. 68hisilicon Hisilicon Limited.
67honeywell Honeywell 69honeywell Honeywell
@@ -71,6 +73,7 @@ ibm International Business Machines (IBM)
71idt Integrated Device Technologies, Inc. 73idt Integrated Device Technologies, Inc.
72iom Iomega Corporation 74iom Iomega Corporation
73img Imagination Technologies Ltd. 75img Imagination Technologies Ltd.
76innolux Innolux Corporation
74intel Intel Corporation 77intel Intel Corporation
75intercontrol Inter Control Group 78intercontrol Inter Control Group
76isee ISEE 2007 S.L. 79isee ISEE 2007 S.L.
@@ -132,6 +135,7 @@ simtek
132sii Seiko Instruments, Inc. 135sii Seiko Instruments, Inc.
133silergy Silergy Corp. 136silergy Silergy Corp.
134sirf SiRF Technology, Inc. 137sirf SiRF Technology, Inc.
138sitronix Sitronix Technology Corporation
135smsc Standard Microsystems Corporation 139smsc Standard Microsystems Corporation
136snps Synopsys, Inc. 140snps Synopsys, Inc.
137solidrun SolidRun 141solidrun SolidRun
diff --git a/Documentation/devicetree/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt
index 1f013bd0d320..77685185cf3b 100644
--- a/Documentation/devicetree/booting-without-of.txt
+++ b/Documentation/devicetree/booting-without-of.txt
@@ -51,6 +51,8 @@ Table of Contents
51 51
52 VIII - Specifying device power management information (sleep property) 52 VIII - Specifying device power management information (sleep property)
53 53
54 IX - Specifying dma bus information
55
54 Appendix A - Sample SOC node for MPC8540 56 Appendix A - Sample SOC node for MPC8540
55 57
56 58
@@ -1332,6 +1334,57 @@ reasonably grouped in this manner, then create a virtual sleep controller
1332(similar to an interrupt nexus, except that defining a standardized 1334(similar to an interrupt nexus, except that defining a standardized
1333sleep-map should wait until its necessity is demonstrated). 1335sleep-map should wait until its necessity is demonstrated).
1334 1336
1337IX - Specifying dma bus information
1338
1339Some devices may have DMA memory range shifted relatively to the beginning of
1340RAM, or even placed outside of kernel RAM. For example, the Keystone 2 SoC
1341worked in LPAE mode with 4G memory has:
1342- RAM range: [0x8 0000 0000, 0x8 FFFF FFFF]
1343- DMA range: [ 0x8000 0000, 0xFFFF FFFF]
1344and DMA range is aliased into first 2G of RAM in HW.
1345
1346In such cases, DMA addresses translation should be performed between CPU phys
1347and DMA addresses. The "dma-ranges" property is intended to be used
1348for describing the configuration of such system in DT.
1349
1350In addition, each DMA master device on the DMA bus may or may not support
1351coherent DMA operations. The "dma-coherent" property is intended to be used
1352for identifying devices supported coherent DMA operations in DT.
1353
1354* DMA Bus master
1355Optional property:
1356- dma-ranges: <prop-encoded-array> encoded as arbitrary number of triplets of
1357 (child-bus-address, parent-bus-address, length). Each triplet specified
1358 describes a contiguous DMA address range.
1359 The dma-ranges property is used to describe the direct memory access (DMA)
1360 structure of a memory-mapped bus whose device tree parent can be accessed
1361 from DMA operations originating from the bus. It provides a means of
1362 defining a mapping or translation between the physical address space of
1363 the bus and the physical address space of the parent of the bus.
1364 (for more information see ePAPR specification)
1365
1366* DMA Bus child
1367Optional property:
1368- dma-ranges: <empty> value. if present - It means that DMA addresses
1369 translation has to be enabled for this device.
1370- dma-coherent: Present if dma operations are coherent
1371
1372Example:
1373soc {
1374 compatible = "ti,keystone","simple-bus";
1375 ranges = <0x0 0x0 0x0 0xc0000000>;
1376 dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>;
1377
1378 [...]
1379
1380 usb: usb@2680000 {
1381 compatible = "ti,keystone-dwc3";
1382
1383 [...]
1384 dma-coherent;
1385 };
1386};
1387
1335Appendix A - Sample SOC node for MPC8540 1388Appendix A - Sample SOC node for MPC8540
1336======================================== 1389========================================
1337 1390
diff --git a/Documentation/devicetree/dynamic-resolution-notes.txt b/Documentation/devicetree/dynamic-resolution-notes.txt
new file mode 100644
index 000000000000..083d23262abe
--- /dev/null
+++ b/Documentation/devicetree/dynamic-resolution-notes.txt
@@ -0,0 +1,25 @@
1Device Tree Dynamic Resolver Notes
2----------------------------------
3
4This document describes the implementation of the in-kernel
5Device Tree resolver, residing in drivers/of/resolver.c and is a
6companion document to Documentation/devicetree/dt-object-internal.txt[1]
7
8How the resolver works
9----------------------
10
11The resolver is given as an input an arbitrary tree compiled with the
12proper dtc option and having a /plugin/ tag. This generates the
13appropriate __fixups__ & __local_fixups__ nodes as described in [1].
14
15In sequence the resolver works by the following steps:
16
171. Get the maximum device tree phandle value from the live tree + 1.
182. Adjust all the local phandles of the tree to resolve by that amount.
193. Using the __local__fixups__ node information adjust all local references
20 by the same amount.
214. For each property in the __fixups__ node locate the node it references
22 in the live tree. This is the label used to tag the node.
235. Retrieve the phandle of the target of the fixup.
246. For each fixup in the property locate the node:property:offset location
25 and replace it with the phandle value.
diff --git a/Documentation/devicetree/of_selftest.txt b/Documentation/devicetree/of_selftest.txt
index 3a2f54d07fc5..1e3d5c92b5e3 100644
--- a/Documentation/devicetree/of_selftest.txt
+++ b/Documentation/devicetree/of_selftest.txt
@@ -67,14 +67,14 @@ struct device_node {
67 ... 67 ...
68 }; 68 };
69 69
70Figure 1, describes a generic structure of machines un-flattened device tree 70Figure 1, describes a generic structure of machine's un-flattened device tree
71considering only child and sibling pointers. There exists another pointer, 71considering only child and sibling pointers. There exists another pointer,
72*parent, that is used to traverse the tree in the reverse direction. So, at 72*parent, that is used t