From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 26 Mar 2021 22:19:49 -0700 Subject: [PATCH 10/11] dtoc: Support adding subnodes alongside existing ones In-Reply-To: <20210321052439.2238169-11-sjg@chromium.org> References: <20210321052439.2238169-11-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 So far we have only needed to add subnodes to empty notds, so have not had to deal with ordering. However this feature is needed for binman's expanded nodes, since there may be another node in the same section. While libfdt adds new properties after existing properties, it adds new subnodes before existing subnodes. This means that we must reorder the nodes in the cached version, so that the ordering remains consistent. Update the sync implementation to sync existing subnodes first, then add new ones, then tidy up the ordering in the cached version. Update the test to cover this behaviour. Also improve the comment about property syncing while we are here. Signed-off-by: Simon Glass --- tools/dtoc/fdt.py | 44 +++++++++++++++++++++++++++++++++--------- tools/dtoc/test_fdt.py | 16 +++++++++++++++ 2 files changed, 51 insertions(+), 9 deletions(-) Applied to u-boot-dm/next, thanks!