blob: fa1622cb1dc12ef87ee20818e38e90295f7b9892 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glassf24770d2016-07-04 11:58:02 -06002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glassf24770d2016-07-04 11:58:02 -06004 */
5
Philipp Tomsich00b26f72017-07-11 23:30:07 +02006#ifndef __DT_STRUCTS
7#define __DT_STRUCTS
Simon Glassf24770d2016-07-04 11:58:02 -06008
9/* These structures may only be used in SPL */
10#if CONFIG_IS_ENABLED(OF_PLATDATA)
Simon Glass08c3b882020-10-03 09:25:21 -060011struct driver_info;
12
Simon Glass4ee0cc82021-08-07 07:24:08 -060013/**
14 * struct phandle_0_arg - hold a phandle record with no arguments
15 *
16 * This holds a phandle pointing to another device. See 'Indexes' in the
17 * of-plat-rst documentation.
18 *
19 * @idx: udevice index (or driver_info index if !OF_PLATDATA_INST)
20 * @arg: arguments
21 */
Simon Glass0d154632017-08-29 14:15:56 -060022struct phandle_0_arg {
Simon Glass8a38abf2020-10-03 11:31:40 -060023 uint idx;
Simon Glassbc796172017-08-29 14:15:58 -060024 int arg[0];
Simon Glass0d154632017-08-29 14:15:56 -060025};
26
Simon Glass4ee0cc82021-08-07 07:24:08 -060027/**
28 * struct phandle_2_arg - hold a phandle record with up to one argument
29 *
30 * This holds a phandle pointing to another device. See 'Indexes' in the
31 * of-plat-rst documentation.
32 *
33 * @idx: udevice index (or driver_info index if !OF_PLATDATA_INST)
34 * @arg: arguments
35 */
Simon Glass0d154632017-08-29 14:15:56 -060036struct phandle_1_arg {
Simon Glass8a38abf2020-10-03 11:31:40 -060037 uint idx;
Simon Glassbc796172017-08-29 14:15:58 -060038 int arg[1];
Simon Glassf24770d2016-07-04 11:58:02 -060039};
Simon Glass634eba42017-08-29 14:15:59 -060040
Simon Glass4ee0cc82021-08-07 07:24:08 -060041/**
42 * struct phandle_2_arg - hold a phandle record with up to two arguments
43 *
44 * This holds a phandle pointing to another device. See 'Indexes' in the
45 * of-plat-rst documentation.
46 *
47 * @idx: udevice index (or driver_info index if !OF_PLATDATA_INST)
48 * @arg: arguments
49 */
Simon Glass634eba42017-08-29 14:15:59 -060050struct phandle_2_arg {
Simon Glass8a38abf2020-10-03 11:31:40 -060051 uint idx;
Simon Glass634eba42017-08-29 14:15:59 -060052 int arg[2];
53};
Simon Glass910de102021-03-15 17:25:20 +130054
Simon Glassb145b452017-08-29 14:16:00 -060055#include <generated/dt-structs-gen.h>
Simon Glass910de102021-03-15 17:25:20 +130056#include <generated/dt-decl.h>
Simon Glassf24770d2016-07-04 11:58:02 -060057#endif
58
59#endif