Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

doc: dt: mtd: support partitions in a special 'partitions' subnode

To avoid conflict with other drivers using subnodes of the mtd device
create only one ofpart-specific node rather than any number of
arbitrary partition subnodes.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by

Michal Suchanek and committed by
Brian Norris
fe2585e9 4d1ea982

+42 -29
+42 -29
Documentation/devicetree/bindings/mtd/partition.txt
··· 4 4 on platforms which have strong conventions about which portions of a flash are 5 5 used for what purposes, but which don't use an on-flash partition table such 6 6 as RedBoot. 7 - NOTE: if the sub-node has a compatible string, then it is not a partition. 8 7 9 - #address-cells & #size-cells must both be present in the mtd device. There are 10 - two valid values for both: 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: 11 18 <1>: for partitions that require a single 32-bit cell to represent their 12 19 size/address (aka the value is below 4 GiB) 13 20 <2>: for partitions that require two 32-bit cells to represent their ··· 35 28 36 29 37 30 flash@0 { 38 - #address-cells = <1>; 39 - #size-cells = <1>; 31 + partitions { 32 + #address-cells = <1>; 33 + #size-cells = <1>; 40 34 41 - partition@0 { 42 - label = "u-boot"; 43 - reg = <0x0000000 0x100000>; 44 - read-only; 45 - }; 35 + partition@0 { 36 + label = "u-boot"; 37 + reg = <0x0000000 0x100000>; 38 + read-only; 39 + }; 46 40 47 - uimage@100000 { 48 - reg = <0x0100000 0x200000>; 41 + uimage@100000 { 42 + reg = <0x0100000 0x200000>; 43 + }; 49 44 }; 50 45 }; 51 46 52 47 flash@1 { 53 - #address-cells = <1>; 54 - #size-cells = <2>; 48 + partitions { 49 + #address-cells = <1>; 50 + #size-cells = <2>; 55 51 56 - /* a 4 GiB partition */ 57 - partition@0 { 58 - label = "filesystem"; 59 - reg = <0x00000000 0x1 0x00000000>; 52 + /* a 4 GiB partition */ 53 + partition@0 { 54 + label = "filesystem"; 55 + reg = <0x00000000 0x1 0x00000000>; 56 + }; 60 57 }; 61 58 }; 62 59 63 60 flash@2 { 64 - #address-cells = <2>; 65 - #size-cells = <2>; 61 + partitions { 62 + #address-cells = <2>; 63 + #size-cells = <2>; 66 64 67 - /* an 8 GiB partition */ 68 - partition@0 { 69 - label = "filesystem #1"; 70 - reg = <0x0 0x00000000 0x2 0x00000000>; 71 - }; 65 + /* an 8 GiB partition */ 66 + partition@0 { 67 + label = "filesystem #1"; 68 + reg = <0x0 0x00000000 0x2 0x00000000>; 69 + }; 72 70 73 - /* a 4 GiB partition */ 74 - partition@200000000 { 75 - label = "filesystem #2"; 76 - reg = <0x2 0x00000000 0x1 0x00000000>; 71 + /* a 4 GiB partition */ 72 + partition@200000000 { 73 + label = "filesystem #2"; 74 + reg = <0x2 0x00000000 0x1 0x00000000>; 75 + }; 77 76 }; 78 77 };