blob: fa1622cb1dc12ef87ee20818e38e90295f7b9892 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glassda59fae2016-07-04 11:58:02 -06002/*
3 * Copyright (c) 2016 Google, Inc
Simon Glassda59fae2016-07-04 11:58:02 -06004 */
5
Philipp Tomsich7033e0d2017-07-11 23:30:07 +02006#ifndef __DT_STRUCTS
7#define __DT_STRUCTS
Simon Glassda59fae2016-07-04 11:58:02 -06008
9/* These structures may only be used in SPL */
10#if CONFIG_IS_ENABLED(OF_PLATDATA)
Simon Glassfd80a222020-10-03 09:25:21 -060011struct driver_info;
12
Simon Glass3f4ec332021-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 Glasse94414b2017-08-29 14:15:56 -060022struct phandle_0_arg {
Simon Glass5792f4b2020-10-03 11:31:40 -060023 uint idx;
Simon Glassfdec5802017-08-29 14:15:58 -060024 int arg[0];
Simon Glasse94414b2017-08-29 14:15:56 -060025};
26
Simon Glass3f4ec332021-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 Glasse94414b2017-08-29 14:15:56 -060036struct phandle_1_arg {
Simon Glass5792f4b2020-10-03 11:31:40 -060037 uint idx;
Simon Glassfdec5802017-08-29 14:15:58 -060038 int arg[1];
Simon Glassda59fae2016-07-04 11:58:02 -060039};
Simon Glass3deeb472017-08-29 14:15:59 -060040
Simon Glass3f4ec332021-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 Glass3deeb472017-08-29 14:15:59 -060050struct phandle_2_arg {
Simon Glass5792f4b2020-10-03 11:31:40 -060051 uint idx;
Simon Glass3deeb472017-08-29 14:15:59 -060052 int arg[2];
53};
Simon Glass29b099a2021-03-15 17:25:20 +130054
Simon Glass0dec7ad2017-08-29 14:16:00 -060055#include <generated/dt-structs-gen.h>
Simon Glass29b099a2021-03-15 17:25:20 +130056#include <generated/dt-decl.h>
Simon Glassda59fae2016-07-04 11:58:02 -060057#endif
58
59#endif