partition.yaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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/partition.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Partition
  7. description: |
  8. This binding describes a single flash partition. Each partition must have its
  9. relative offset and size specified. Depending on partition function extra
  10. properties can be used.
  11. A partition may be dynamically allocated by a specific parser at runtime.
  12. In this specific case, a specific suffix is required to the node name.
  13. Everything after 'partition-' will be used as the partition name to compare
  14. with the one dynamically allocated by the specific parser.
  15. If the partition contains invalid char a label can be provided that will
  16. be used instead of the node name to make the comparison.
  17. This is used to assign an OF node to the dynamiccally allocated partition
  18. so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
  19. The OF node will be assigned only if the partition label declared match the
  20. one assigned by the parser at runtime.
  21. maintainers:
  22. - Rafał Miłecki <rafal@milecki.pl>
  23. properties:
  24. reg:
  25. description: partition's offset and size within the flash
  26. maxItems: 1
  27. label:
  28. description: The label / name for this partition. If omitted, the label
  29. is taken from the node name (excluding the unit address).
  30. read-only:
  31. description: This parameter, if present, is a hint that this partition
  32. should only be mounted read-only. This is usually used for flash
  33. partitions containing early-boot firmware images or data which should
  34. not be clobbered.
  35. type: boolean
  36. lock:
  37. description: Do not unlock the partition at initialization time (not
  38. supported on all devices)
  39. type: boolean
  40. slc-mode:
  41. description: This parameter, if present, allows one to emulate SLC mode
  42. on a partition attached to an MLC NAND thus making this partition
  43. immune to paired-pages corruptions
  44. type: boolean
  45. linux,rootfs:
  46. description: Marks partition that contains root filesystem to mount and boot
  47. user space from
  48. type: boolean
  49. align:
  50. $ref: /schemas/types.yaml#/definitions/uint32
  51. minimum: 2
  52. maximum: 0x80000000
  53. multipleOf: 2
  54. description:
  55. This sets the alignment of the entry in bytes.
  56. The entry offset is adjusted so that the entry starts on an aligned
  57. boundary within the containing section or image. For example ‘align =
  58. <16>’ means that the entry will start on a 16-byte boundary. This may
  59. mean that padding is added before the entry. The padding is part of
  60. the containing section but is not included in the entry, meaning that
  61. an empty space may be created before the entry starts. Alignment
  62. must be a power of 2. If ‘align’ is not provided, no alignment is
  63. performed.
  64. align-size:
  65. $ref: /schemas/types.yaml#/definitions/uint32
  66. minimum: 2
  67. maximum: 0x80000000
  68. multipleOf: 2
  69. description:
  70. This sets the alignment of the entry size in bytes. It must be a power
  71. of 2.
  72. For example, to ensure that the size of an entry is a multiple of 64
  73. bytes, set this to 64. While this does not affect the content of the
  74. entry itself (the padding is performed only when its parent section is
  75. assembled), the end result is that the entry ends with the padding
  76. bytes, so may grow. If ‘align-size’ is not provided, no alignment is
  77. performed.
  78. align-end:
  79. $ref: /schemas/types.yaml#/definitions/uint32
  80. minimum: 2
  81. maximum: 0x80000000
  82. multipleOf: 2
  83. description:
  84. This sets the alignment (in bytes) of the end of an entry with respect
  85. to the containing section. It must be a power of 2.
  86. Some entries require that they end on an alignment boundary,
  87. regardless of where they start. This does not move the start of the
  88. entry, so the content of the entry will still start at the beginning.
  89. But there may be padding at the end. While this does not affect the
  90. content of the entry itself (the padding is performed only when its
  91. parent section is assembled), the end result is that the entry ends
  92. with the padding bytes, so may grow. If ‘align-end’ is not provided,
  93. no alignment is performed.
  94. compression:
  95. $ref: /schemas/types.yaml#/definitions/string
  96. description: |
  97. Compression algorithm used to store the data in this partition, chosen
  98. from a list of well-known algorithms.
  99. The contents are compressed using this algorithm.
  100. enum:
  101. - none
  102. - bzip2
  103. - gzip
  104. - lzop
  105. - lz4
  106. - lzma
  107. - xz
  108. - zstd
  109. sercomm,scpart-id:
  110. description: Partition id in Sercomm partition map. Mtd parser
  111. uses this id to find a record in the partition map containing
  112. offset and size of the current partition. The values from
  113. partition map overrides partition offset and size defined in
  114. reg property of the dts. Frequently these values are the same,
  115. but may differ if device has bad eraseblocks on a flash.
  116. $ref: /schemas/types.yaml#/definitions/uint32
  117. nvmem-layout:
  118. $ref: /schemas/nvmem/layouts/nvmem-layout.yaml
  119. if:
  120. not:
  121. required: [ reg ]
  122. then:
  123. properties:
  124. $nodename:
  125. pattern: '^partitions?(-.+)?$'
  126. # This is a generic file other binding inherit from and extend
  127. additionalProperties: true
  128. $defs:
  129. partition-node:
  130. type: object
  131. if:
  132. not:
  133. required: [ compatible ]
  134. then:
  135. $ref: '#'
  136. unevaluatedProperties: false
  137. else:
  138. $ref: '#'
  139. examples:
  140. - |
  141. partitions {
  142. compatible = "fixed-partitions";
  143. #address-cells = <1>;
  144. #size-cells = <1>;
  145. partition@100000 {
  146. compatible = "u-boot";
  147. reg = <0x100000 0xf00000>;
  148. align-size = <0x1000>;
  149. align-end = <0x10000>;
  150. };
  151. partition@200000 {
  152. compatible = "tfa-bl31";
  153. reg = <0x200000 0x100000>;
  154. align = <0x4000>;
  155. };
  156. };