From 634eba4be060af3bcba51cba2d57d217df897f31 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 29 Aug 2017 14:15:59 -0600 Subject: dtoc: Support properties containing multiple phandle values 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 Tested-by: Kever Yang --- include/dt-structs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/dt-structs.h') diff --git a/include/dt-structs.h b/include/dt-structs.h index 9ab4e2524d1..76979e73e17 100644 --- a/include/dt-structs.h +++ b/include/dt-structs.h @@ -18,6 +18,11 @@ struct phandle_1_arg { const void *node; int arg[1]; }; + +struct phandle_2_arg { + const void *node; + int arg[2]; +}; #include #endif -- cgit v1.2.3