aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/Documentation/devicetree/bindings/mtd/partitions/openwrt,uimage.yaml
blob: d052ab1fc981bb168d527d68e3803053368f0617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/partitions/openwrt,uimage.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: OpenWrt variations of U-Boot Image partitions

maintainers:
  - Bjørn Mork <bjorn@mork.no>

description: |
  The image format defined by the boot loader "Das U-Boot" is often
  modified or extended by device vendors. This defines a few optional
  properties which can be used to describe such modifications.

# partition.txt defines common properties, but has not yet been
# converted to YAML
#allOf:
#  - $ref: ../partition.yaml#

properties:
  compatible:
    items:
      - enum:
          - openwrt,uimage
      - const: denx,uimage

  openwrt,padding:
    description: Number of padding bytes between header and data
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0

  openwrt,ih-magic:
    description: U-Boot Image Header magic number.
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0x27051956 # IH_MAGIC

  openwrt,ih-type:
    description: U-Boot Image type
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 2 # IH_TYPE_KERNEL

  openwrt,offset:
    description:
      Offset between partition start and U-Boot Image in bytes
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0

  openwrt,partition-magic:
    description:
      Magic number found at the start of the partition. Will only be
      validated if both this property and openwrt,offset is non-zero
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0

required:
  - compatible
  - reg

#unevaluatedProperties: false
additionalProperties: false

examples:
  - |
    // device with non-default magic
    partition@300000 {
          compatible = "openwrt,uimage", "denx,uimage";
          reg = <0x00300000 0xe80000>;
          label = "firmware";
          openwrt,ih-magic = <0x4e474520>;
    };
  - |
    // device with U-Boot Image at an offset, with a partition magic value
    partition@70000 {
          compatible = "openwrt,uimage", "denx,uimage";
          reg = <0x00070000 0x00790000>;
          label = "firmware";
          openwrt,offset = <20>;
          openwrt,partition-magic = <0x43535953>;
    };
  - |
    // device using a non-default image type
    #include "dt-bindings/mtd/partitions/uimage.h"
    partition@6c0000 {
          compatible = "openwrt,uimage", "denx,uimage";
          reg = <0x6c0000 0x1900000>;
          label = "firmware";
          openwrt,ih-magic = <0x33373033>;
          openwrt,ih-type = <IH_TYPE_FILESYSTEM>;
    };