15def4c47SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 25def4c47SEmmanuel Vadot%YAML 1.2 35def4c47SEmmanuel Vadot--- 45def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/partitions/partition.yaml# 55def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 65def4c47SEmmanuel Vadot 75def4c47SEmmanuel Vadottitle: Partition 85def4c47SEmmanuel Vadot 95def4c47SEmmanuel Vadotdescription: | 105def4c47SEmmanuel Vadot This binding describes a single flash partition. Each partition must have its 115def4c47SEmmanuel Vadot relative offset and size specified. Depending on partition function extra 125def4c47SEmmanuel Vadot properties can be used. 135def4c47SEmmanuel Vadot 14b97ee269SEmmanuel Vadot A partition may be dynamically allocated by a specific parser at runtime. 15b97ee269SEmmanuel Vadot In this specific case, a specific suffix is required to the node name. 16b97ee269SEmmanuel Vadot Everything after 'partition-' will be used as the partition name to compare 17b97ee269SEmmanuel Vadot with the one dynamically allocated by the specific parser. 18b97ee269SEmmanuel Vadot If the partition contains invalid char a label can be provided that will 19b97ee269SEmmanuel Vadot be used instead of the node name to make the comparison. 20b97ee269SEmmanuel Vadot This is used to assign an OF node to the dynamiccally allocated partition 21b97ee269SEmmanuel Vadot so that subsystem like NVMEM can provide an OF node and declare NVMEM cells. 22b97ee269SEmmanuel Vadot The OF node will be assigned only if the partition label declared match the 23b97ee269SEmmanuel Vadot one assigned by the parser at runtime. 24b97ee269SEmmanuel Vadot 255def4c47SEmmanuel Vadotmaintainers: 265def4c47SEmmanuel Vadot - Rafał Miłecki <rafal@milecki.pl> 275def4c47SEmmanuel Vadot 285def4c47SEmmanuel Vadotproperties: 295def4c47SEmmanuel Vadot reg: 305def4c47SEmmanuel Vadot description: partition's offset and size within the flash 315def4c47SEmmanuel Vadot maxItems: 1 325def4c47SEmmanuel Vadot 335def4c47SEmmanuel Vadot label: 345def4c47SEmmanuel Vadot description: The label / name for this partition. If omitted, the label 355def4c47SEmmanuel Vadot is taken from the node name (excluding the unit address). 365def4c47SEmmanuel Vadot 375def4c47SEmmanuel Vadot read-only: 385def4c47SEmmanuel Vadot description: This parameter, if present, is a hint that this partition 395def4c47SEmmanuel Vadot should only be mounted read-only. This is usually used for flash 405def4c47SEmmanuel Vadot partitions containing early-boot firmware images or data which should 415def4c47SEmmanuel Vadot not be clobbered. 425def4c47SEmmanuel Vadot type: boolean 435def4c47SEmmanuel Vadot 445def4c47SEmmanuel Vadot lock: 455def4c47SEmmanuel Vadot description: Do not unlock the partition at initialization time (not 465def4c47SEmmanuel Vadot supported on all devices) 475def4c47SEmmanuel Vadot type: boolean 485def4c47SEmmanuel Vadot 495def4c47SEmmanuel Vadot slc-mode: 505def4c47SEmmanuel Vadot description: This parameter, if present, allows one to emulate SLC mode 515def4c47SEmmanuel Vadot on a partition attached to an MLC NAND thus making this partition 525def4c47SEmmanuel Vadot immune to paired-pages corruptions 535def4c47SEmmanuel Vadot type: boolean 545def4c47SEmmanuel Vadot 558bab661aSEmmanuel Vadot linux,rootfs: 568bab661aSEmmanuel Vadot description: Marks partition that contains root filesystem to mount and boot 578bab661aSEmmanuel Vadot user space from 58f126890aSEmmanuel Vadot type: boolean 598bab661aSEmmanuel Vadot 60*7d0873ebSEmmanuel Vadot align: 61*7d0873ebSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 62*7d0873ebSEmmanuel Vadot minimum: 2 63*7d0873ebSEmmanuel Vadot maximum: 0x80000000 64*7d0873ebSEmmanuel Vadot multipleOf: 2 65*7d0873ebSEmmanuel Vadot description: 66*7d0873ebSEmmanuel Vadot This sets the alignment of the entry in bytes. 67*7d0873ebSEmmanuel Vadot 68*7d0873ebSEmmanuel Vadot The entry offset is adjusted so that the entry starts on an aligned 69*7d0873ebSEmmanuel Vadot boundary within the containing section or image. For example ‘align = 70*7d0873ebSEmmanuel Vadot <16>’ means that the entry will start on a 16-byte boundary. This may 71*7d0873ebSEmmanuel Vadot mean that padding is added before the entry. The padding is part of 72*7d0873ebSEmmanuel Vadot the containing section but is not included in the entry, meaning that 73*7d0873ebSEmmanuel Vadot an empty space may be created before the entry starts. Alignment 74*7d0873ebSEmmanuel Vadot must be a power of 2. If ‘align’ is not provided, no alignment is 75*7d0873ebSEmmanuel Vadot performed. 76*7d0873ebSEmmanuel Vadot 77*7d0873ebSEmmanuel Vadot align-size: 78*7d0873ebSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 79*7d0873ebSEmmanuel Vadot minimum: 2 80*7d0873ebSEmmanuel Vadot maximum: 0x80000000 81*7d0873ebSEmmanuel Vadot multipleOf: 2 82*7d0873ebSEmmanuel Vadot description: 83*7d0873ebSEmmanuel Vadot This sets the alignment of the entry size in bytes. It must be a power 84*7d0873ebSEmmanuel Vadot of 2. 85*7d0873ebSEmmanuel Vadot 86*7d0873ebSEmmanuel Vadot For example, to ensure that the size of an entry is a multiple of 64 87*7d0873ebSEmmanuel Vadot bytes, set this to 64. While this does not affect the content of the 88*7d0873ebSEmmanuel Vadot entry itself (the padding is performed only when its parent section is 89*7d0873ebSEmmanuel Vadot assembled), the end result is that the entry ends with the padding 90*7d0873ebSEmmanuel Vadot bytes, so may grow. If ‘align-size’ is not provided, no alignment is 91*7d0873ebSEmmanuel Vadot performed. 92*7d0873ebSEmmanuel Vadot 93*7d0873ebSEmmanuel Vadot align-end: 94*7d0873ebSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 95*7d0873ebSEmmanuel Vadot minimum: 2 96*7d0873ebSEmmanuel Vadot maximum: 0x80000000 97*7d0873ebSEmmanuel Vadot multipleOf: 2 98*7d0873ebSEmmanuel Vadot description: 99*7d0873ebSEmmanuel Vadot This sets the alignment (in bytes) of the end of an entry with respect 100*7d0873ebSEmmanuel Vadot to the containing section. It must be a power of 2. 101*7d0873ebSEmmanuel Vadot 102*7d0873ebSEmmanuel Vadot Some entries require that they end on an alignment boundary, 103*7d0873ebSEmmanuel Vadot regardless of where they start. This does not move the start of the 104*7d0873ebSEmmanuel Vadot entry, so the content of the entry will still start at the beginning. 105*7d0873ebSEmmanuel Vadot But there may be padding at the end. While this does not affect the 106*7d0873ebSEmmanuel Vadot content of the entry itself (the padding is performed only when its 107*7d0873ebSEmmanuel Vadot parent section is assembled), the end result is that the entry ends 108*7d0873ebSEmmanuel Vadot with the padding bytes, so may grow. If ‘align-end’ is not provided, 109*7d0873ebSEmmanuel Vadot no alignment is performed. 110*7d0873ebSEmmanuel Vadot 111b97ee269SEmmanuel Vadotif: 112b97ee269SEmmanuel Vadot not: 113b97ee269SEmmanuel Vadot required: [ reg ] 114b97ee269SEmmanuel Vadotthen: 115b97ee269SEmmanuel Vadot properties: 116b97ee269SEmmanuel Vadot $nodename: 117b97ee269SEmmanuel Vadot pattern: '^partition-.*$' 1185def4c47SEmmanuel Vadot 1198bab661aSEmmanuel Vadot# This is a generic file other binding inherit from and extend 1205def4c47SEmmanuel VadotadditionalProperties: true 121*7d0873ebSEmmanuel Vadot 122*7d0873ebSEmmanuel Vadotexamples: 123*7d0873ebSEmmanuel Vadot - | 124*7d0873ebSEmmanuel Vadot partitions { 125*7d0873ebSEmmanuel Vadot compatible = "fixed-partitions"; 126*7d0873ebSEmmanuel Vadot #address-cells = <1>; 127*7d0873ebSEmmanuel Vadot #size-cells = <1>; 128*7d0873ebSEmmanuel Vadot 129*7d0873ebSEmmanuel Vadot partition@100000 { 130*7d0873ebSEmmanuel Vadot compatible = "u-boot"; 131*7d0873ebSEmmanuel Vadot reg = <0x100000 0xf00000>; 132*7d0873ebSEmmanuel Vadot align-size = <0x1000>; 133*7d0873ebSEmmanuel Vadot align-end = <0x10000>; 134*7d0873ebSEmmanuel Vadot }; 135*7d0873ebSEmmanuel Vadot 136*7d0873ebSEmmanuel Vadot partition@200000 { 137*7d0873ebSEmmanuel Vadot compatible = "tfa-bl31"; 138*7d0873ebSEmmanuel Vadot reg = <0x200000 0x100000>; 139*7d0873ebSEmmanuel Vadot align = <0x4000>; 140*7d0873ebSEmmanuel Vadot }; 141*7d0873ebSEmmanuel Vadot }; 142