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