From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 26 Mar 2021 22:19:59 -0700 Subject: [PATCH 04/11] binman: Support obtaining section contents immediately In-Reply-To: <20210321052439.2238169-5-sjg@chromium.org> References: <20210321052439.2238169-5-sjg@chromium.org> <20210321052439.2238169-1-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Generally the content of sections is not built until the final assembly of the image. This is partly to avoid wasting time, since the entries within sections may change multiple times as binman works through its various stages. This works quite well since sections exist in a strict hierarchy, so they can be processed in a depth-first manner. However the 'collection' entry type does not have this luxury. If it contains a section within its 'content' list, then it must produce the section contents, if available. That section is typically a sibling node, i.e. not part oc the collection's hierarchy. Add a new 'required' argument to section.GetData() to support this. When required is True, any referenced sections are immediately built. If this is not possible (because one of the subentries does not have its data yet) then an error is produced. The test for this uses a 'collection' entry type, referencing a section as its first member. This forces a call to _BuildSectionData() with required set to False, at first, then True later, when the image is assembled. Signed-off-by: Simon Glass --- tools/binman/entry.py | 6 +++- tools/binman/etype/collection.py | 18 +++++++---- tools/binman/etype/section.py | 33 +++++++++++++++----- tools/binman/etype/vblock.py | 12 ++++--- tools/binman/ftest.py | 13 ++++++++ tools/binman/test/199_collection_section.dts | 32 +++++++++++++++++++ 6 files changed, 95 insertions(+), 19 deletions(-) create mode 100644 tools/binman/test/199_collection_section.dts Applied to u-boot-dm/next, thanks!