Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: mtd: fixed-partitions: Add alignment properties

Add three properties for controlling alignment of partitions, aka
'entries' in fixed-partition.

For now there is no explicit mention of hierarchy, so a 'section' is
just the 'fixed-partitions' node.

These new properties are inputs to the Binman packaging process, but are
also needed if the firmware is repacked, to ensure that alignment
constraints are not violated. Therefore they are provided as part of
the schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240412153249.100787-1-sjg@chromium.org

authored by

Simon Glass and committed by
Miquel Raynal
d8d42d47 3ef4600f

+51
+51
Documentation/devicetree/bindings/mtd/partitions/partition.yaml
··· 57 57 user space from 58 58 type: boolean 59 59 60 + align: 61 + $ref: /schemas/types.yaml#/definitions/uint32 62 + minimum: 2 63 + maximum: 0x80000000 64 + multipleOf: 2 65 + description: 66 + This sets the alignment of the entry in bytes. 67 + 68 + The entry offset is adjusted so that the entry starts on an aligned 69 + boundary within the containing section or image. For example ‘align = 70 + <16>’ means that the entry will start on a 16-byte boundary. This may 71 + mean that padding is added before the entry. The padding is part of 72 + the containing section but is not included in the entry, meaning that 73 + an empty space may be created before the entry starts. Alignment 74 + must be a power of 2. If ‘align’ is not provided, no alignment is 75 + performed. 76 + 77 + align-size: 78 + $ref: /schemas/types.yaml#/definitions/uint32 79 + minimum: 2 80 + maximum: 0x80000000 81 + multipleOf: 2 82 + description: 83 + This sets the alignment of the entry size in bytes. It must be a power 84 + of 2. 85 + 86 + For example, to ensure that the size of an entry is a multiple of 64 87 + bytes, set this to 64. While this does not affect the content of the 88 + entry itself (the padding is performed only when its parent section is 89 + assembled), the end result is that the entry ends with the padding 90 + bytes, so may grow. If ‘align-size’ is not provided, no alignment is 91 + performed. 92 + 93 + align-end: 94 + $ref: /schemas/types.yaml#/definitions/uint32 95 + minimum: 2 96 + maximum: 0x80000000 97 + multipleOf: 2 98 + description: 99 + This sets the alignment (in bytes) of the end of an entry with respect 100 + to the containing section. It must be a power of 2. 101 + 102 + Some entries require that they end on an alignment boundary, 103 + regardless of where they start. This does not move the start of the 104 + entry, so the content of the entry will still start at the beginning. 105 + But there may be padding at the end. While this does not affect the 106 + content of the entry itself (the padding is performed only when its 107 + parent section is assembled), the end result is that the entry ends 108 + with the padding bytes, so may grow. If ‘align-end’ is not provided, 109 + no alignment is performed. 110 + 60 111 if: 61 112 not: 62 113 required: [ reg ]