dt-bindings: mtd: partitions: add OpenWrt defined U-Boot Image
[openwrt/staging/jow.git] / target / linux / generic / files / Documentation / devicetree / bindings / mtd / partitions / openwrt,uimage.yaml
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/openwrt,uimage.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: OpenWrt variations of U-Boot Image partitions
8
9 maintainers:
10 - Bjørn Mork <bjorn@mork.no>
11
12 description: |
13 The image format defined by the boot loader "Das U-Boot" is often
14 modified or extended by device vendors. This defines a few optional
15 properties which can be used to describe such modifications.
16
17 # partition.txt defines common properties, but has not yet been
18 # converted to YAML
19 #allOf:
20 # - $ref: ../partition.yaml#
21
22 properties:
23 compatible:
24 items:
25 - enum:
26 - openwrt,uimage
27 - const: denx,uimage
28
29 openwrt,padding:
30 description: Number of padding bytes between header and data
31 $ref: /schemas/types.yaml#/definitions/uint32
32 default: 0
33
34 openwrt,ih-magic:
35 description: U-Boot Image Header magic number.
36 $ref: /schemas/types.yaml#/definitions/uint32
37 default: 0x27051956 # IH_MAGIC
38
39 openwrt,ih-type:
40 description: U-Boot Image type
41 $ref: /schemas/types.yaml#/definitions/uint32
42 default: 2 # IH_TYPE_KERNEL
43
44 openwrt,offset:
45 description:
46 Offset between partition start and U-Boot Image in bytes
47 $ref: /schemas/types.yaml#/definitions/uint32
48 default: 0
49
50 openwrt,partition-magic:
51 description:
52 Magic number found at the start of the partition. Will only be
53 validated if both this property and openwrt,offset is non-zero
54 $ref: /schemas/types.yaml#/definitions/uint32
55 default: 0
56
57 required:
58 - compatible
59 - reg
60
61 #unevaluatedProperties: false
62 additionalProperties: false
63
64 examples:
65 - |
66 // device with non-default magic
67 partition@300000 {
68 compatible = "openwrt,uimage", "denx,uimage";
69 reg = <0x00300000 0xe80000>;
70 label = "firmware";
71 openwrt,ih-magic = <0x4e474520>;
72 };
73 - |
74 // device with U-Boot Image at an offset, with a partition magic value
75 partition@70000 {
76 compatible = "openwrt,uimage", "denx,uimage";
77 reg = <0x00070000 0x00790000>;
78 label = "firmware";
79 openwrt,offset = <20>;
80 openwrt,partition-magic = <0x43535953>;
81 };
82 - |
83 // device using a non-default image type
84 #include "dt-bindings/mtd/partitions/uimage.h"
85 partition@6c0000 {
86 compatible = "openwrt,uimage", "denx,uimage";
87 reg = <0x6c0000 0x1900000>;
88 label = "firmware";
89 openwrt,ih-magic = <0x33373033>;
90 openwrt,ih-type = <IH_TYPE_FILESYSTEM>;
91 };