libfdt: Test on trees with different block layouts

At present, all the example dtbs we use in the testsuite are version
17 and have reservation map, then structure block then strings block
(the natural ordering based on alignment constraints).  However, all
libfdt's read-only and in-place write functions should also work on
v16 trees, and on trees with other layouts.

This patch adds a testcase / utility function to rearrange the blocks
of a dtb and/or regress a v17 tree to v16, and uses it to run tests on
trees with different layouts and versions.

Signed-off-by: David Gibson <david@tgibson.dropbear.id.au>
3 files changed