]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - Documentation/devicetree/bindings/mtd/partition.txt
Merge remote-tracking branch 'regulator/for-next'
[karo-tx-linux.git] / Documentation / devicetree / bindings / mtd / partition.txt
1 Representing flash partitions in devicetree
2
3 Partitions can be represented by sub-nodes of an mtd device. This can be used
4 on platforms which have strong conventions about which portions of a flash are
5 used for what purposes, but which don't use an on-flash partition table such
6 as RedBoot.
7
8 The partition table should be a subnode of the mtd node and should be named
9 'partitions'. Partitions are defined in subnodes of the partitions node.
10
11 For backwards compatibility partitions as direct subnodes of the mtd device are
12 supported. This use is discouraged.
13 NOTE: also for backwards compatibility, direct subnodes that have a compatible
14 string are not considered partitions, as they may be used for other bindings.
15
16 #address-cells & #size-cells must both be present in the partitions subnode of the
17 mtd device. There are two valid values for both:
18 <1>: for partitions that require a single 32-bit cell to represent their
19      size/address (aka the value is below 4 GiB)
20 <2>: for partitions that require two 32-bit cells to represent their
21      size/address (aka the value is 4 GiB or greater).
22
23 Required properties:
24 - reg : The partition's offset and size within the mtd bank.
25
26 Optional properties:
27 - label : The label / name for this partition.  If omitted, the label is taken
28   from the node name (excluding the unit address).
29 - read-only : This parameter, if present, is a hint to Linux that this
30   partition should only be mounted read-only. This is usually used for flash
31   partitions containing early-boot firmware images or data which should not be
32   clobbered.
33
34 Examples:
35
36
37 flash@0 {
38         partitions {
39                 #address-cells = <1>;
40                 #size-cells = <1>;
41
42                 partition@0 {
43                         label = "u-boot";
44                         reg = <0x0000000 0x100000>;
45                         read-only;
46                 };
47
48                 uimage@100000 {
49                         reg = <0x0100000 0x200000>;
50                 };
51         };
52 };
53
54 flash@1 {
55         partitions {
56                 #address-cells = <1>;
57                 #size-cells = <2>;
58
59                 /* a 4 GiB partition */
60                 partition@0 {
61                         label = "filesystem";
62                         reg = <0x00000000 0x1 0x00000000>;
63                 };
64         };
65 };
66
67 flash@2 {
68         partitions {
69                 #address-cells = <2>;
70                 #size-cells = <2>;
71
72                 /* an 8 GiB partition */
73                 partition@0 {
74                         label = "filesystem #1";
75                         reg = <0x0 0x00000000 0x2 0x00000000>;
76                 };
77
78                 /* a 4 GiB partition */
79                 partition@200000000 {
80                         label = "filesystem #2";
81                         reg = <0x2 0x00000000 0x1 0x00000000>;
82                 };
83         };
84 };