mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
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 <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
29 lines
432 B
C
29 lines
432 B
C
/*
|
|
* Copyright (c) 2016 Google, Inc
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#ifndef __DT_STRUCTS
|
|
#define __DT_STRUCTS
|
|
|
|
/* These structures may only be used in SPL */
|
|
#if CONFIG_IS_ENABLED(OF_PLATDATA)
|
|
struct phandle_0_arg {
|
|
const void *node;
|
|
int arg[0];
|
|
};
|
|
|
|
struct phandle_1_arg {
|
|
const void *node;
|
|
int arg[1];
|
|
};
|
|
|
|
struct phandle_2_arg {
|
|
const void *node;
|
|
int arg[2];
|
|
};
|
|
#include <generated/dt-structs.h>
|
|
#endif
|
|
|
|
#endif
|