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 | ||
05ff8c25 JS |
8 | #address-cells & #size-cells must both be present in the mtd device. There are |
9 | two valid values for both: | |
10 | <1>: for partitions that require a single 32-bit cell to represent their | |
11 | size/address (aka the value is below 4 GiB) | |
12 | <2>: for partitions that require two 32-bit cells to represent their | |
13 | size/address (aka the value is 4 GiB or greater). | |
83619ea0 JL |
14 | |
15 | Required properties: | |
16 | - reg : The partition's offset and size within the mtd bank. | |
17 | ||
18 | Optional properties: | |
19 | - label : The label / name for this partition. If omitted, the label is taken | |
20 | from the node name (excluding the unit address). | |
21 | - read-only : This parameter, if present, is a hint to Linux that this | |
22 | partition should only be mounted read-only. This is usually used for flash | |
23 | partitions containing early-boot firmware images or data which should not be | |
24 | clobbered. | |
25 | ||
26 | Examples: | |
27 | ||
28 | ||
29 | flash@0 { | |
30 | #address-cells = <1>; | |
31 | #size-cells = <1>; | |
32 | ||
33 | partition@0 { | |
34 | label = "u-boot"; | |
35 | reg = <0x0000000 0x100000>; | |
36 | read-only; | |
37 | }; | |
38 | ||
39 | uimage@100000 { | |
40 | reg = <0x0100000 0x200000>; | |
41 | }; | |
bf6c9734 | 42 | }; |
05ff8c25 JS |
43 | |
44 | flash@1 { | |
45 | #address-cells = <1>; | |
46 | #size-cells = <2>; | |
47 | ||
48 | /* a 4 GiB partition */ | |
49 | partition@0 { | |
50 | label = "filesystem"; | |
51 | reg = <0x00000000 0x1 0x00000000>; | |
52 | }; | |
53 | }; | |
54 | ||
55 | flash@2 { | |
56 | #address-cells = <2>; | |
57 | #size-cells = <2>; | |
58 | ||
59 | /* an 8 GiB partition */ | |
60 | partition@0 { | |
61 | label = "filesystem #1"; | |
62 | reg = <0x0 0x00000000 0x2 0x00000000>; | |
63 | }; | |
64 | ||
65 | /* a 4 GiB partition */ | |
66 | partition@200000000 { | |
67 | label = "filesystem #2"; | |
68 | reg = <0x2 0x00000000 0x1 0x00000000>; | |
69 | }; | |
70 | }; |