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
This commit is contained in:
Simon Glass 2024-04-12 09:32:48 -06:00 committed by Miquel Raynal
parent 3ef4600f12
commit d8d42d47a9

View File

@ -57,6 +57,57 @@ properties:
user space from
type: boolean
align:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 2
maximum: 0x80000000
multipleOf: 2
description:
This sets the alignment of the entry in bytes.
The entry offset is adjusted so that the entry starts on an aligned
boundary within the containing section or image. For example align =
<16> means that the entry will start on a 16-byte boundary. This may
mean that padding is added before the entry. The padding is part of
the containing section but is not included in the entry, meaning that
an empty space may be created before the entry starts. Alignment
must be a power of 2. If align is not provided, no alignment is
performed.
align-size:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 2
maximum: 0x80000000
multipleOf: 2
description:
This sets the alignment of the entry size in bytes. It must be a power
of 2.
For example, to ensure that the size of an entry is a multiple of 64
bytes, set this to 64. While this does not affect the content of the
entry itself (the padding is performed only when its parent section is
assembled), the end result is that the entry ends with the padding
bytes, so may grow. If align-size is not provided, no alignment is
performed.
align-end:
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 2
maximum: 0x80000000
multipleOf: 2
description:
This sets the alignment (in bytes) of the end of an entry with respect
to the containing section. It must be a power of 2.
Some entries require that they end on an alignment boundary,
regardless of where they start. This does not move the start of the
entry, so the content of the entry will still start at the beginning.
But there may be padding at the end. While this does not affect the
content of the entry itself (the padding is performed only when its
parent section is assembled), the end result is that the entry ends
with the padding bytes, so may grow. If align-end is not provided,
no alignment is performed.
if:
not:
required: [ reg ]