At present dtoc has a very simplistic view of phandles. It assumes that a property has only a single phandle with a single argument (i.e. two cells per property).
This is not true in many cases. Enhance the implementation to scan all phandles in a property and to use the correct number of arguments (which can be 0, 1, 2 or more) when generating the C code. For the struct definitions, use a struct which can hold the maximum number of arguments used by the property. Signed-off-by: Simon Glass <s...@chromium.org> --- Changes in v2: None include/dt-structs.h | 5 +++++ tools/dtoc/dtb_platdata.py | 21 ++++++++++++++------- tools/dtoc/dtoc_test_phandle.dts | 17 +++++++++++++++-- tools/dtoc/test_dtoc.py | 27 ++++++++++++++++++++++++--- 4 files changed, 58 insertions(+), 12 deletions(-) Applied to u-boot-fdt thanks! _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot