diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-11 06:47:50 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-11 06:47:50 -0400 |
| commit | e98d6e7f7625ed60c7bc1d39aeb2375ed3918fd5 (patch) | |
| tree | bc6e9a6428229d2fca73e1447b5cbfe59866c4b4 | |
| parent | 4e0b7fe38345b81930363b9f1b4b324181ddcc9e (diff) | |
| parent | 2118f4b8dfc666c3e4a9e262beca79636a0852fe (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.txt | 4 | ||||
| -rw-r--r-- | Documentation/devicetree/booting-without-of.txt | 53 | ||||
| -rw-r--r-- | Documentation/devicetree/dynamic-resolution-notes.txt | 25 | ||||
| -rw-r--r-- | Documentation/devicetree/of_selftest.txt | 30 | ||||
| -rw-r--r-- | drivers/of/Kconfig | 4 | ||||
| -rw-r--r-- | drivers/of/Makefile | 1 | ||||
| -rw-r--r-- | drivers/of/base.c | 3 | ||||
| -rw-r--r-- | drivers/of/resolver.c | 336 | ||||
| -rw-r--r-- | drivers/of/selftest.c | 120 | ||||
| -rw-r--r-- | drivers/of/testcase-data/testcases.dts | 35 | ||||
| -rw-r--r-- | include/linux/of.h | 3 |
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 | |||
| 46 | ebv EBV Elektronik | 46 | ebv EBV Elektronik |
| 47 | edt Emerging Display Technologies | 47 | edt Emerging Display Technologies |
| 48 | emmicro EM Microelectronic | 48 | emmicro EM Microelectronic |
| 49 | energymicro Silicon Laboratories (formerly Energy Micro AS) | ||
| 49 | epcos EPCOS AG | 50 | epcos EPCOS AG |
| 50 | epfl Ecole Polytechnique Fédérale de Lausanne | 51 | epfl Ecole Polytechnique Fédérale de Lausanne |
| 51 | epson Seiko Epson Corp. | 52 | epson Seiko Epson Corp. |
| @@ -62,6 +63,7 @@ globalscale Globalscale Technologies, Inc. | |||
| 62 | gmt Global Mixed-mode Technology, Inc. | 63 | gmt Global Mixed-mode Technology, Inc. |
| 63 | google Google, Inc. | 64 | google Google, Inc. |
| 64 | gumstix Gumstix, Inc. | 65 | gumstix Gumstix, Inc. |
| 66 | gw Gateworks Corporation | ||
| 65 | haoyu Haoyu Microelectronic Co. Ltd. | 67 | haoyu Haoyu Microelectronic Co. Ltd. |
| 66 | hisilicon Hisilicon Limited. | 68 | hisilicon Hisilicon Limited. |
| 67 | honeywell Honeywell | 69 | honeywell Honeywell |
| @@ -71,6 +73,7 @@ ibm International Business Machines (IBM) | |||
| 71 | idt Integrated Device Technologies, Inc. | 73 | idt Integrated Device Technologies, Inc. |
| 72 | iom Iomega Corporation | 74 | iom Iomega Corporation |
| 73 | img Imagination Technologies Ltd. | 75 | img Imagination Technologies Ltd. |
| 76 | innolux Innolux Corporation | ||
| 74 | intel Intel Corporation | 77 | intel Intel Corporation |
| 75 | intercontrol Inter Control Group | 78 | intercontrol Inter Control Group |
| 76 | isee ISEE 2007 S.L. | 79 | isee ISEE 2007 S.L. |
| @@ -132,6 +135,7 @@ simtek | |||
| 132 | sii Seiko Instruments, Inc. | 135 | sii Seiko Instruments, Inc. |
| 133 | silergy Silergy Corp. | 136 | silergy Silergy Corp. |
| 134 | sirf SiRF Technology, Inc. | 137 | sirf SiRF Technology, Inc. |
| 138 | sitronix Sitronix Technology Corporation | ||
| 135 | smsc Standard Microsystems Corporation | 139 | smsc Standard Microsystems Corporation |
| 136 | snps Synopsys, Inc. | 140 | snps Synopsys, Inc. |
| 137 | solidrun SolidRun | 141 | solidrun 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 |
| 1333 | sleep-map should wait until its necessity is demonstrated). | 1335 | sleep-map should wait until its necessity is demonstrated). |
| 1334 | 1336 | ||
| 1337 | IX - Specifying dma bus information | ||
| 1338 | |||
| 1339 | Some devices may have DMA memory range shifted relatively to the beginning of | ||
| 1340 | RAM, or even placed outside of kernel RAM. For example, the Keystone 2 SoC | ||
| 1341 | worked in LPAE mode with 4G memory has: | ||
| 1342 | - RAM range: [0x8 0000 0000, 0x8 FFFF FFFF] | ||
| 1343 | - DMA range: [ 0x8000 0000, 0xFFFF FFFF] | ||
| 1344 | and DMA range is aliased into first 2G of RAM in HW. | ||
| 1345 | |||
| 1346 | In such cases, DMA addresses translation should be performed between CPU phys | ||
| 1347 | and DMA addresses. The "dma-ranges" property is intended to be used | ||
| 1348 | for describing the configuration of such system in DT. | ||
| 1349 | |||
| 1350 | In addition, each DMA master device on the DMA bus may or may not support | ||
| 1351 | coherent DMA operations. The "dma-coherent" property is intended to be used | ||
| 1352 | for identifying devices supported coherent DMA operations in DT. | ||
| 1353 | |||
| 1354 | * DMA Bus master | ||
| 1355 | Optional 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 | ||
| 1367 | Optional 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 | |||
| 1372 | Example: | ||
| 1373 | soc { | ||
| 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 | |||
| 1335 | Appendix A - Sample SOC node for MPC8540 | 1388 | Appendix 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 @@ | |||
| 1 | Device Tree Dynamic Resolver Notes | ||
| 2 | ---------------------------------- | ||
| 3 | |||
| 4 | This document describes the implementation of the in-kernel | ||
| 5 | Device Tree resolver, residing in drivers/of/resolver.c and is a | ||
| 6 | companion document to Documentation/devicetree/dt-object-internal.txt[1] | ||
| 7 | |||
| 8 | How the resolver works | ||
| 9 | ---------------------- | ||
| 10 | |||
| 11 | The resolver is given as an input an arbitrary tree compiled with the | ||
| 12 | proper dtc option and having a /plugin/ tag. This generates the | ||
| 13 | appropriate __fixups__ & __local_fixups__ nodes as described in [1]. | ||
| 14 | |||
| 15 | In sequence the resolver works by the following steps: | ||
| 16 | |||
| 17 | 1. Get the maximum device tree phandle value from the live tree + 1. | ||
| 18 | 2. Adjust all the local phandles of the tree to resolve by that amount. | ||
| 19 | 3. Using the __local__fixups__ node information adjust all local references | ||
| 20 | by the same amount. | ||
| 21 | 4. 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. | ||
| 23 | 5. Retrieve the phandle of the target of the fixup. | ||
| 24 | 6. 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 | ||
| 70 | Figure 1, describes a generic structure of machine’s un-flattened device tree | 70 | Figure 1, describes a generic structure of machine's un-flattened device tree |
| 71 | considering only child and sibling pointers. There exists another pointer, | 71 | considering 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 |
