blob: 81a224da63be54a4b7a5b248f57a985423b36213 [file] [log] [blame]
Jamie Lentin83619ea2012-03-27 22:54:15 +01001Representing 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
Michal Suchanekfe2585e2015-10-28 15:48:06 -07008The partition table should be a subnode of the mtd node and should be named
Brian Norrise488ca92015-12-03 14:47:32 -08009'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.
Michal Suchanekfe2585e2015-10-28 15:48:06 -070012
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:
Joe Schaack05ff8c22013-02-21 16:29:45 -060020<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).
Jamie Lentin83619ea2012-03-27 22:54:15 +010024
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.
Michal Suchanek89a41cb2015-10-30 13:34:00 -070035- lock : Do not unlock the partition at initialization time (not supported on
36 all devices)
Jamie Lentin83619ea2012-03-27 22:54:15 +010037
38Examples:
39
40
41flash@0 {
Michal Suchanekfe2585e2015-10-28 15:48:06 -070042 partitions {
Brian Norrise488ca92015-12-03 14:47:32 -080043 compatible = "fixed-partitions";
Michal Suchanekfe2585e2015-10-28 15:48:06 -070044 #address-cells = <1>;
45 #size-cells = <1>;
Jamie Lentin83619ea2012-03-27 22:54:15 +010046
Michal Suchanekfe2585e2015-10-28 15:48:06 -070047 partition@0 {
48 label = "u-boot";
49 reg = <0x0000000 0x100000>;
50 read-only;
51 };
Jamie Lentin83619ea2012-03-27 22:54:15 +010052
Michal Suchanekfe2585e2015-10-28 15:48:06 -070053 uimage@100000 {
54 reg = <0x0100000 0x200000>;
55 };
Jamie Lentin83619ea2012-03-27 22:54:15 +010056 };
Rob Herringbf6c97342012-07-06 07:16:14 -050057};
Joe Schaack05ff8c22013-02-21 16:29:45 -060058
59flash@1 {
Michal Suchanekfe2585e2015-10-28 15:48:06 -070060 partitions {
Brian Norrise488ca92015-12-03 14:47:32 -080061 compatible = "fixed-partitions";
Michal Suchanekfe2585e2015-10-28 15:48:06 -070062 #address-cells = <1>;
63 #size-cells = <2>;
Joe Schaack05ff8c22013-02-21 16:29:45 -060064
Michal Suchanekfe2585e2015-10-28 15:48:06 -070065 /* a 4 GiB partition */
66 partition@0 {
67 label = "filesystem";
68 reg = <0x00000000 0x1 0x00000000>;
69 };
Joe Schaack05ff8c22013-02-21 16:29:45 -060070 };
71};
72
73flash@2 {
Michal Suchanekfe2585e2015-10-28 15:48:06 -070074 partitions {
Brian Norrise488ca92015-12-03 14:47:32 -080075 compatible = "fixed-partitions";
Michal Suchanekfe2585e2015-10-28 15:48:06 -070076 #address-cells = <2>;
77 #size-cells = <2>;
Joe Schaack05ff8c22013-02-21 16:29:45 -060078
Michal Suchanekfe2585e2015-10-28 15:48:06 -070079 /* an 8 GiB partition */
80 partition@0 {
81 label = "filesystem #1";
82 reg = <0x0 0x00000000 0x2 0x00000000>;
83 };
Joe Schaack05ff8c22013-02-21 16:29:45 -060084
Michal Suchanekfe2585e2015-10-28 15:48:06 -070085 /* a 4 GiB partition */
86 partition@200000000 {
87 label = "filesystem #2";
88 reg = <0x2 0x00000000 0x1 0x00000000>;
89 };
Joe Schaack05ff8c22013-02-21 16:29:45 -060090 };
91};