Skip to content

Commit d8d42d4

Browse files
sjg20miquelraynal
authored andcommitted
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 <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 3ef4600 commit d8d42d4

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

Documentation/devicetree/bindings/mtd/partitions/partition.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,57 @@ properties:
5757
user space from
5858
type: boolean
5959

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+
60111
if:
61112
not:
62113
required: [ reg ]

0 commit comments

Comments
 (0)