Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livep...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / mtd / partition.txt
1 Flash partitions in device tree
2 ===============================
3
4 Flash devices can be partitioned into one or more functional ranges (e.g. "boot
5 code", "nvram", "kernel").
6
7 Different devices may be partitioned in a different ways. Some may use a fixed
8 flash layout set at production time. Some may use on-flash table that describes
9 the geometry and naming/purpose of each functional region. It is also possible
10 to see these methods mixed.
11
12 To assist system software in locating partitions, we allow describing which
13 method is used for a given flash device. To describe the method there should be
14 a subnode of the flash device that is named 'partitions'. It must have a
15 'compatible' property, which is used to identify the method to use.
16
17 We currently only document a binding for fixed layouts.
18
19
20 Fixed Partitions
21 ================
22
23 Partitions can be represented by sub-nodes of a flash device. This can be used
24 on platforms which have strong conventions about which portions of a flash are
25 used for what purposes, but which don't use an on-flash partition table such
26 as RedBoot.
27
28 The partition table should be a subnode of the flash node and should be named
29 'partitions'. This node should have the following property:
30 - compatible : (required) must be "fixed-partitions"
31 Partitions are then defined in subnodes of the partitions node.
32
33 For backwards compatibility partitions as direct subnodes of the flash device are
34 supported. This use is discouraged.
35 NOTE: also for backwards compatibility, direct subnodes that have a compatible
36 string are not considered partitions, as they may be used for other bindings.
37
38 #address-cells & #size-cells must both be present in the partitions subnode of the
39 flash device. There are two valid values for both:
40 <1>: for partitions that require a single 32-bit cell to represent their
41      size/address (aka the value is below 4 GiB)
42 <2>: for partitions that require two 32-bit cells to represent their
43      size/address (aka the value is 4 GiB or greater).
44
45 Required properties:
46 - reg : The partition's offset and size within the flash
47
48 Optional properties:
49 - label : The label / name for this partition.  If omitted, the label is taken
50   from the node name (excluding the unit address).
51 - read-only : This parameter, if present, is a hint to Linux that this
52   partition should only be mounted read-only. This is usually used for flash
53   partitions containing early-boot firmware images or data which should not be
54   clobbered.
55 - lock : Do not unlock the partition at initialization time (not supported on
56   all devices)
57
58 Examples:
59
60
61 flash@0 {
62         partitions {
63                 compatible = "fixed-partitions";
64                 #address-cells = <1>;
65                 #size-cells = <1>;
66
67                 partition@0 {
68                         label = "u-boot";
69                         reg = <0x0000000 0x100000>;
70                         read-only;
71                 };
72
73                 uimage@100000 {
74                         reg = <0x0100000 0x200000>;
75                 };
76         };
77 };
78
79 flash@1 {
80         partitions {
81                 compatible = "fixed-partitions";
82                 #address-cells = <1>;
83                 #size-cells = <2>;
84
85                 /* a 4 GiB partition */
86                 partition@0 {
87                         label = "filesystem";
88                         reg = <0x00000000 0x1 0x00000000>;
89                 };
90         };
91 };
92
93 flash@2 {
94         partitions {
95                 compatible = "fixed-partitions";
96                 #address-cells = <2>;
97                 #size-cells = <2>;
98
99                 /* an 8 GiB partition */
100                 partition@0 {
101                         label = "filesystem #1";
102                         reg = <0x0 0x00000000 0x2 0x00000000>;
103                 };
104
105                 /* a 4 GiB partition */
106                 partition@200000000 {
107                         label = "filesystem #2";
108                         reg = <0x2 0x00000000 0x1 0x00000000>;
109                 };
110         };
111 };