'end-at-4gb' property is not applicable where CONFIG_SYS_TEXT_BASE +
Image size != 4gb.
+align-default:
+ Specifies the default alignment for entries in this section, if they do
+ not specify an alignment. Note that this only applies to top-level entries
+ in the section (direct subentries), not any subentries of those entries.
+ This means that each section must specify its own default alignment, if
+ required.
+
Examples of the above options can be found in the tests. See the
tools/binman/test directory.
file, since the first 16 bytes are skipped when writing.
name-prefix: Adds a prefix to the name of every entry in the section
when writing out the map
+ align_default: Default alignment for this section, if no alignment is
+ given in the entry
Properties:
allow_missing: True if this section permits external blobs to be
if tools.NotPowerOfTwo(self.align):
raise ValueError("Node '%s': Alignment %s must be a power of two" %
(self._node.path, self.align))
+ if self.section and self.align is None:
+ self.align = self.section.align_default
self.pad_before = fdt_util.GetInt(self._node, 'pad-before', 0)
self.pad_after = fdt_util.GetInt(self._node, 'pad-after', 0)
self.align_size = fdt_util.GetInt(self._node, 'align-size')
super().__init__(section, etype, node)
self._cbfs_arg = fdt_util.GetString(node, 'cbfs-arch', 'x86')
+ self.align_default = None
self._cbfs_entries = OrderedDict()
self._ReadSubnodes()
self.reader = None
super().__init__(section, etype, node)
self._args = fdt_util.GetString(self._node, 'args').split(' ')
self._mkimage_entries = OrderedDict()
+ self.align_default = None
self._ReadSubnodes()
def ObtainContents(self):
file, since the first 16 bytes are skipped when writing.
name-prefix: Adds a prefix to the name of every entry in the section
when writing out the map
+ align_default: Default alignment for this section, if no alignment is
+ given in the entry
Properties:
allow_missing: True if this section permits external blobs to be
if self._skip_at_start is None:
self._skip_at_start = 0
self._name_prefix = fdt_util.GetString(self._node, 'name-prefix')
+ self.align_default = fdt_util.GetInt(self._node, 'align-default', 0)
filename = fdt_util.GetString(self._node, 'filename')
if filename:
self._filename = filename
section + tools.GetBytes(0xfe, 3) + U_BOOT_DATA,
data)
+ def testAlignDefault(self):
+ """Test that default alignment works on sections"""
+ data = self._DoReadFile('200_align_default.dts')
+ expected = (U_BOOT_DATA + tools.GetBytes(0, 8 - len(U_BOOT_DATA)) +
+ U_BOOT_DATA)
+ # Special alignment for section
+ expected += tools.GetBytes(0, 32 - len(expected))
+ # No alignment within the nested section
+ expected += U_BOOT_DATA + U_BOOT_NODTB_DATA;
+ # Now the final piece, which should be default-aligned
+ expected += tools.GetBytes(0, 88 - len(expected)) + U_BOOT_NODTB_DATA
+ self.assertEqual(expected, data)
if __name__ == "__main__":
unittest.main()
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ align-default = <8>;
+ u-boot {
+ };
+
+ u-boot-align {
+ type = "u-boot";
+ };
+
+ section {
+ align = <32>;
+ u-boot {
+ };
+
+ u-boot-nodtb {
+ };
+ };
+
+ u-boot-nodtb {
+ };
+ };
+};