[PATCH 10/11] dtoc: Support adding subnodes alongside existing ones

Simon Glass sjg at chromium.org
Sat Mar 27 06:19:49 CET 2021


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 <sjg at chromium.org>
---

 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!


More information about the U-Boot mailing list