xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/partitions/fixed-partitions.yaml (revision a8089ea5aee578e08acab2438e82fc9a9ae50ed8)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mtd/partitions/fixed-partitions.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Fixed partitions
8
9description: |
10  This binding can be used on platforms which have strong conventions about
11  which portions of a flash are used for what purposes, but which don't use an
12  on-flash partition table such as RedBoot.
13
14  The partition table should be a node named "partitions". Partitions are then
15  defined as subnodes.
16
17maintainers:
18  - Rafał Miłecki <rafal@milecki.pl>
19
20properties:
21  compatible:
22    oneOf:
23      - const: fixed-partitions
24      - items:
25          - const: sercomm,sc-partitions
26          - const: fixed-partitions
27
28  "#address-cells": true
29
30  "#size-cells": true
31
32patternProperties:
33  "@[0-9a-f]+$":
34    $ref: partition.yaml#
35
36    properties:
37      sercomm,scpart-id:
38        description: Partition id in Sercomm partition map. Mtd parser
39          uses this id to find a record in the partition map containing
40          offset and size of the current partition. The values from
41          partition map overrides partition offset and size defined in
42          reg property of the dts. Frequently these values are the same,
43          but may differ if device has bad eraseblocks on a flash.
44        $ref: /schemas/types.yaml#/definitions/uint32
45
46required:
47  - "#address-cells"
48  - "#size-cells"
49
50additionalProperties: true
51
52examples:
53  - |
54    partitions {
55        compatible = "fixed-partitions";
56        #address-cells = <1>;
57        #size-cells = <1>;
58
59        partition@0 {
60            label = "u-boot";
61            reg = <0x0000000 0x100000>;
62            read-only;
63        };
64
65        uimage@100000 {
66            reg = <0x0100000 0x200000>;
67        };
68    };
69
70  - |
71    partitions {
72        compatible = "fixed-partitions";
73        #address-cells = <1>;
74        #size-cells = <2>;
75
76        /* a 4 GiB partition */
77        partition@0 {
78            label = "filesystem";
79            reg = <0x00000000 0x1 0x00000000>;
80            linux,rootfs;
81        };
82    };
83
84  - |
85    partitions {
86        compatible = "fixed-partitions";
87        #address-cells = <2>;
88        #size-cells = <2>;
89
90        /* an 8 GiB partition */
91        partition@0 {
92            label = "filesystem #1";
93            reg = <0x0 0x00000000 0x2 0x00000000>;
94        };
95
96        /* a 4 GiB partition */
97        partition@200000000 {
98            label = "filesystem #2";
99            reg = <0x2 0x00000000 0x1 0x00000000>;
100        };
101    };
102
103  - |
104    partitions {
105        compatible = "fixed-partitions";
106        #address-cells = <1>;
107        #size-cells = <1>;
108
109        partition@0 {
110            label = "bootloader";
111            reg = <0x000000 0x100000>;
112            read-only;
113        };
114
115        firmware@100000 {
116            compatible = "brcm,trx";
117            label = "firmware";
118            reg = <0x100000 0xe00000>;
119        };
120
121        calibration@f00000 {
122            compatible = "fixed-partitions";
123            label = "calibration";
124            reg = <0xf00000 0x100000>;
125            ranges = <0 0xf00000 0x100000>;
126            #address-cells = <1>;
127            #size-cells = <1>;
128
129            partition@0 {
130                label = "wifi0";
131                reg = <0x000000 0x080000>;
132            };
133
134            partition@80000 {
135                label = "wifi1";
136                reg = <0x080000 0x080000>;
137            };
138        };
139    };
140
141  - |
142    partitions {
143        compatible = "sercomm,sc-partitions", "fixed-partitions";
144        #address-cells = <1>;
145        #size-cells = <1>;
146
147        partition@0 {
148            label = "u-boot";
149            reg = <0x0 0x100000>;
150            sercomm,scpart-id = <0>;
151            read-only;
152        };
153
154        partition@100000 {
155            label = "dynamic partition map";
156            reg = <0x100000 0x100000>;
157            sercomm,scpart-id = <1>;
158        };
159
160        partition@200000 {
161            label = "Factory";
162            reg = <0x200000 0x100000>;
163            sercomm,scpart-id = <2>;
164            read-only;
165        };
166    };
167