dtoc: Allow deleting nodes and adding them in the same sync
authorSimon Glass <sjg@chromium.org>
Tue, 8 Feb 2022 18:49:52 +0000 (11:49 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Feb 2022 17:05:44 +0000 (10:05 -0700)
commitdd857ee7614fea27de3eb6dbd87749a9640c69b1
tree7139166fb02e711844068a3f2ccf63b2d2402273
parenta30c39f2f77f4fb57a22a50c6d6b477d5d2f4342
dtoc: Allow deleting nodes and adding them in the same sync

This does not work at present, since the current algorithm assumes that
either there are no nodes or all nodes have an offset. If a node is new,
but an old node is still in the tree, then syncing fails due to this
assumption.

Fix it and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/dtoc/fdt.py
tools/dtoc/test_fdt.py