diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-15 20:14:13 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-15 20:14:13 -0400 |
| commit | 34ec4de42be5006abdd8d0c08b306ffaa64d0d5d (patch) | |
| tree | c5fe826846f5bf532e56e1e39ee789047a700d59 | |
| parent | ba0a062ef55a6f8e8361a63ee48e654879ba00bf (diff) | |
| parent | 1931ee143b0ab72924944bc06e363d837ba05063 (diff) | |
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull device tree fixes and reverts from Grant Likely:
"One bug fix and three reverts. The reverts back out the slightly
controversial feeding the entire device tree into the random pool and
the reserved-memory binding which isn't fully baked yet. Expect the
reserved-memory patches at least to resurface for v3.13.
The bug fixes removes a scary but harmless warning on SPARC that was
introduced in the v3.12 merge window. v3.13 will contain a proper fix
that makes the new code work on SPARC.
On the plus side, the diffstat looks *awesome*. I love removing lines
of code"
* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
Revert "drivers: of: add initialization code for dma reserved memory"
Revert "ARM: init: add support for reserved memory defined by device tree"
Revert "of: Feed entire flattened device tree into the random pool"
of: fix unnecessary warning on missing /cpus node
| -rw-r--r-- | Documentation/devicetree/bindings/memory.txt | 168 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 3 | ||||
| -rw-r--r-- | drivers/of/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/of/Makefile | 1 | ||||
| -rw-r--r-- | drivers/of/base.c | 4 | ||||
| -rw-r--r-- | drivers/of/fdt.c | 12 | ||||
| -rw-r--r-- | drivers/of/of_reserved_mem.c | 173 | ||||
| -rw-r--r-- | drivers/of/platform.c | 4 | ||||
| -rw-r--r-- | include/linux/of_reserved_mem.h | 14 |
9 files changed, 1 insertions, 384 deletions
diff --git a/Documentation/devicetree/bindings/memory.txt b/Documentation/devicetree/bindings/memory.txt deleted file mode 100644 index eb2469365593..000000000000 --- a/Documentation/devicetree/bindings/memory.txt +++ /dev/null | |||
| @@ -1,168 +0,0 @@ | |||
| 1 | *** Memory binding *** | ||
| 2 | |||
| 3 | The /memory node provides basic information about the address and size | ||
| 4 | of the physical memory. This node is usually filled or updated by the | ||
| 5 | bootloader, depending on the actual memory configuration of the given | ||
| 6 | hardware. | ||
| 7 | |||
| 8 | The memory layout is described by the following node: | ||
| 9 | |||
| 10 | / { | ||
| 11 | #address-cells = <(n)>; | ||
| 12 | #size-cells = <(m)>; | ||
| 13 | memory { | ||
| 14 | device_type = "memory"; | ||
| 15 | reg = <(baseaddr1) (size1) | ||
| 16 | (baseaddr2) (size2) | ||
| 17 | ... | ||
| 18 | (baseaddrN) (sizeN)>; | ||
| 19 | }; | ||
| 20 | ... | ||
| 21 | }; | ||
| 22 | |||
| 23 | A memory node follows the typical device tree rules for "reg" property: | ||
| 24 | n: number of cells used to store base address value | ||
| 25 | m: number of cells used to store size value | ||
| 26 | baseaddrX: defines a base address of the defined memory bank | ||
| 27 | sizeX: the size of the defined memory bank | ||
| 28 | |||
| 29 | |||
| 30 | More than one memory bank can be defined. | ||
| 31 | |||
| 32 | |||
| 33 | *** Reserved memory regions *** | ||
| 34 | |||
| 35 | In /memory/reserved-memory node one can create child nodes describing | ||
| 36 | particular reserved (excluded from normal use) memory regions. Such | ||
| 37 | memory regions are usually designed for the special usage by various | ||
| 38 | device drivers. A good example are contiguous memory allocations or | ||
| 39 | memory sharing with other operating system on the same hardware board. | ||
| 40 | Those special memory regions might depend on the board configuration and | ||
| 41 | devices used on the target system. | ||
| 42 | |||
| 43 | Parameters for each memory region can be encoded into the device tree | ||
| 44 | with the following convention: | ||
| 45 | |||
| 46 | [(label):] (name) { | ||
| 47 | compatible = "linux,contiguous-memory-region", "reserved-memory-region"; | ||
| 48 | reg = <(address) (size)>; | ||
| 49 | (linux,default-contiguous-region); | ||
| 50 | }; | ||
| 51 | |||
| 52 | compatible: one or more of: | ||
| 53 | - "linux,contiguous-memory-region" - enables binding of this | ||
| 54 | region to Contiguous Memory Allocator (special region for | ||
| 55 | contiguous memory allocations, shared with movable system | ||
| 56 | memory, Linux kernel-specific). | ||
| 57 | - "reserved-memory-region" - compatibility is defined, given | ||
| 58 | region is assigned for exclusive usage for by the respective | ||
| 59 | devices. | ||
| 60 | |||
| 61 | reg: standard property defining the base address and size of | ||
| 62 | the memory region | ||
| 63 | |||
| 64 | linux,default-contiguous-region: property indicating that the region | ||
| 65 | is the default region for all contiguous memory | ||
| 66 | allocations, Linux specific (optional) | ||
| 67 | |||
| 68 | It is optional to specify the base address, so if one wants to use | ||
| 69 | autoconfiguration of the base address, '0' can be specified as a base | ||
| 70 | address in the 'reg' property. | ||
| 71 | |||
| 72 | The /memory/reserved-memory node must contain the same #address-cells | ||
| 73 | and #size-cells value as the root node. | ||
| 74 | |||
| 75 | |||
| 76 | *** Device node's properties *** | ||
| 77 | |||
| 78 | Once regions in the /memory/reserved-memory node have been defined, they | ||
| 79 | may be referenced by other device nodes. Bindings that wish to reference | ||
| 80 | memory regions should explicitly document their use of the following | ||
| 81 | property: | ||
| 82 | |||
| 83 | memory-region = <&phandle_to_defined_region>; | ||
| 84 | |||
| 85 | This property indicates that the device driver should use the memory | ||
| 86 | region pointed by the given phandle. | ||
| 87 | |||
| 88 | |||
| 89 | *** Example *** | ||
| 90 | |||
| 91 | This example defines a memory consisting of 4 memory banks. 3 contiguous | ||
| 92 | regions are defined for Linux kernel, one default of all device drivers | ||
| 93 | (named contig_mem, placed at 0x72000000, 64MiB), one dedicated to the | ||
| 94 | framebuffer device (labelled display_mem, placed at 0x78000000, 8MiB) | ||
| 95 | and one for multimedia processing (labelled multimedia_mem, placed at | ||
| 96 | 0x77000000, 64MiB). 'display_mem' region is then assigned to fb@12300000 | ||
| 97 | device for DMA memory allocations (Linux kernel drivers will use CMA is | ||
| 98 | available or dma-exclusive usage otherwise). 'multimedia_mem' is | ||
| 99 | assigned to scaler@12500000 and codec@12600000 devices for contiguous | ||
| 100 | memory allocations when CMA driver is enabled. | ||
| 101 | |||
| 102 | The reason for creating a separate region for framebuffer device is to | ||
| 103 | match the framebuffer base address to the one configured by bootloader, | ||
| 104 | so once Linux kernel drivers starts no glitches on the displayed boot | ||
| 105 | logo appears. Scaller and codec drivers should share the memory | ||
| 106 | allocations. | ||
| 107 | |||
| 108 | / { | ||
| 109 | #address-cells = <1>; | ||
| 110 | #size-cells = <1>; | ||
| 111 | |||
| 112 | /* ... */ | ||
| 113 | |||
| 114 | memory { | ||
| 115 | reg = <0x40000000 0x10000000 | ||
| 116 | 0x50000000 0x10000000 | ||
| 117 | 0x60000000 0x10000000 | ||
| 118 | 0x70000000 0x10000000>; | ||
| 119 | |||
| 120 | reserved-memory { | ||
| 121 | #address-cells = <1>; | ||
| 122 | #size-cells = <1>; | ||
| 123 | |||
| 124 | /* | ||
| 125 | * global autoconfigured region for contiguous allocations | ||
| 126 | * (used only with Contiguous Memory Allocator) | ||
| 127 | */ | ||
| 128 | contig_region@0 { | ||
| 129 | compatible = "linux,contiguous-memory-region"; | ||
| 130 | reg = <0x0 0x4000000>; | ||
| 131 | linux,default-contiguous-region; | ||
| 132 | }; | ||
| 133 | |||
| 134 | /* | ||
| 135 | * special region for framebuffer | ||
| 136 | */ | ||
| 137 | display_region: region@78000000 { | ||
| 138 | compatible = "linux,contiguous-memory-region", "reserved-memory-region"; | ||
| 139 | reg = <0x78000000 0x800000>; | ||
| 140 | }; | ||
| 141 | |||
| 142 | /* | ||
| 143 | * special region for multimedia processing devices | ||
| 144 | */ | ||
| 145 | multimedia_region: region@77000000 { | ||
| 146 | compatible = "linux,contiguous-memory-region"; | ||
| 147 | reg = <0x77000000 0x4000000>; | ||
| 148 | }; | ||
| 149 | }; | ||
| 150 | }; | ||
| 151 | |||
| 152 | /* ... */ | ||
| 153 | |||
| 154 | fb0: fb@12300000 { | ||
| 155 | status = "okay"; | ||
| 156 | memory-region = <&display_region>; | ||
| 157 | }; | ||
| 158 | |||
| 159 | scaler: scaler@12500000 { | ||
| 160 | status = "okay"; | ||
| 161 | memory-region = <&multimedia_region>; | ||
| 162 | }; | ||
| 163 | |||
| 164 | codec: codec@12600000 { | ||
| 165 | status = "okay"; | ||
| 166 | memory-region = <&multimedia_region>; | ||
| 167 | }; | ||
| 168 | }; | ||
