summaryrefslogtreecommitdiff
path: root/tools/binman/etype
diff options
context:
space:
mode:
authorAlice Guo <[email protected]>2025-04-28 18:37:39 +0800
committerFabio Estevam <[email protected]>2025-05-03 16:55:32 -0300
commit0318c26c2fcd4e38f7a9e991409fd458c7790e07 (patch)
tree0b8edb31c93a0e75f6c67850cf3aa656ed1713bc /tools/binman/etype
parentd292f30d5249236fc5c5a3b8a7d7769a1c96bb5b (diff)
binman: add a new entry type for packing DDR PHY firmware images
i.MX95 needs to combine DDR PHY firmware images and their byte counts together, so add a new entry type nxp-header-ddrfw for this requirement. Signed-off-by: Alice Guo <[email protected]>
Diffstat (limited to 'tools/binman/etype')
-rw-r--r--tools/binman/etype/nxp_header_ddrfw.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/binman/etype/nxp_header_ddrfw.py b/tools/binman/etype/nxp_header_ddrfw.py
new file mode 100644
index 00000000000..655699e6ffa
--- /dev/null
+++ b/tools/binman/etype/nxp_header_ddrfw.py
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright 2025 NXP
+
+from binman.etype.section import Entry_section
+
+class Entry_nxp_header_ddrfw(Entry_section):
+ """Add a header to DDR PHY firmware images
+
+ This entry is used for i.MX95 to combine DDR PHY firmware images and their
+ byte counts together.
+
+ See imx95_evk.rst for how to get DDR PHY Firmware Images.
+ """
+
+ def __init__(self, section, etype, node):
+ super().__init__(section, etype, node)
+
+ def BuildSectionData(self, required):
+ section_data = bytearray()
+ header_data = bytearray()
+
+ for entry in self._entries.values():
+ entry_data = entry.GetData(required)
+
+ section_data += entry_data
+ header_data += entry.contents_size.to_bytes(4, 'little')
+
+ return header_data + section_data