Commit | Line | Data |
---|---|---|
83619ea0 JL |
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 | ||
fe2585e9 | 8 | The partition table should be a subnode of the mtd node and should be named |
e488ca9f BN |
9 | 'partitions'. This node should have the following property: |
10 | - compatible : (required) must be "fixed-partitions" | |
11 | Partitions are then defined in subnodes of the partitions node. | |
fe2585e9 MS |
12 | |
13 | For backwards compatibility partitions as direct subnodes of the mtd device are | |
14 | supported. This use is discouraged. | |
15 | NOTE: also for backwards compatibility, direct subnodes that have a compatible | |
16 | string 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 | |
19 | mtd device. There are two valid values for both: | |
05ff8c25 JS |
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). | |
83619ea0 JL |
24 | |
25 | Required properties: | |
26 | - reg : The partition's offset and size within the mtd bank. | |
27 | ||
28 | Optional 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. | |
89a41cbb MS |
35 | - lock : Do not unlock the partition at initialization time (not supported on |
36 | all devices) | |
83619ea0 JL |
37 | |
38 | Examples: | |
39 | ||
40 | ||
41 | flash@0 { | |
fe2585e9 | 42 | partitions { |
e488ca9f | 43 | compatible = "fixed-partitions"; |
fe2585e9 MS |
44 | #address-cells = <1>; |
45 | #size-cells = <1>; | |
83619ea0 | 46 | |
fe2585e9 MS |
47 | partition@0 { |
48 | label = "u-boot"; | |
49 | reg = <0x0000000 0x100000>; | |
50 | read-only; | |
51 | }; | |
83619ea0 | 52 | |
fe2585e9 MS |
53 | uimage@100000 { |
54 | reg = <0x0100000 0x200000>; | |
55 | }; | |
83619ea0 | 56 | }; |
bf6c9734 | 57 | }; |
05ff8c25 JS |
58 | |
59 | flash@1 { | |
fe2585e9 | 60 | partitions { |
e488ca9f | 61 | compatible = "fixed-partitions"; |
fe2585e9 MS |
62 | #address-cells = <1>; |
63 | #size-cells = <2>; | |
05ff8c25 | 64 | |
fe2585e9 MS |
65 | /* a 4 GiB partition */ |
66 | partition@0 { | |
67 | label = "filesystem"; | |
68 | reg = <0x00000000 0x1 0x00000000>; | |
69 | }; | |
05ff8c25 JS |
70 | }; |
71 | }; | |
72 | ||
73 | flash@2 { | |
fe2585e9 | 74 | partitions { |
e488ca9f | 75 | compatible = "fixed-partitions"; |
fe2585e9 MS |
76 | #address-cells = <2>; |
77 | #size-cells = <2>; | |
05ff8c25 | 78 | |
fe2585e9 MS |
79 | /* an 8 GiB partition */ |
80 | partition@0 { | |
81 | label = "filesystem #1"; | |
82 | reg = <0x0 0x00000000 0x2 0x00000000>; | |
83 | }; | |
05ff8c25 | 84 | |
fe2585e9 MS |
85 | /* a 4 GiB partition */ |
86 | partition@200000000 { | |
87 | label = "filesystem #2"; | |
88 | reg = <0x2 0x00000000 0x1 0x00000000>; | |
89 | }; | |
05ff8c25 JS |
90 | }; |
91 | }; |