About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Documentation / devicetree / bindings / mtd / partition.txt




Custom Search

Based on kernel version 4.7.2. Page generated on 2016-08-22 22:42 EST.

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	
8	The 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"
11	Partitions are then defined in subnodes of the partitions node.
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:
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	
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.
35	- lock : Do not unlock the partition at initialization time (not supported on
36	  all devices)
37	
38	Examples:
39	
40	
41	flash@0 {
42		partitions {
43			compatible = "fixed-partitions";
44			#address-cells = <1>;
45			#size-cells = <1>;
46	
47			partition@0 {
48				label = "u-boot";
49				reg = <0x0000000 0x100000>;
50				read-only;
51			};
52	
53			uimage@100000 {
54				reg = <0x0100000 0x200000>;
55			};
56		};
57	};
58	
59	flash@1 {
60		partitions {
61			compatible = "fixed-partitions";
62			#address-cells = <1>;
63			#size-cells = <2>;
64	
65			/* a 4 GiB partition */
66			partition@0 {
67				label = "filesystem";
68				reg = <0x00000000 0x1 0x00000000>;
69			};
70		};
71	};
72	
73	flash@2 {
74		partitions {
75			compatible = "fixed-partitions";
76			#address-cells = <2>;
77			#size-cells = <2>;
78	
79			/* an 8 GiB partition */
80			partition@0 {
81				label = "filesystem #1";
82				reg = <0x0 0x00000000 0x2 0x00000000>;
83			};
84	
85			/* a 4 GiB partition */
86			partition@200000000 {
87				label = "filesystem #2";
88				reg = <0x2 0x00000000 0x1 0x00000000>;
89			};
90		};
91	};
Hide Line Numbers
About Kernel Documentation Linux Kernel Contact Linux Resources Linux Blog

Information is copyright its respective author. All material is available from the Linux Kernel Source distributed under a GPL License. This page is provided as a free service by mjmwired.net.