Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | f24770d | 2016-07-04 11:58:02 -0600 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2016 Google, Inc |
Simon Glass | f24770d | 2016-07-04 11:58:02 -0600 | [diff] [blame] | 4 | */ |
| 5 | |
Philipp Tomsich | 00b26f7 | 2017-07-11 23:30:07 +0200 | [diff] [blame] | 6 | #ifndef __DT_STRUCTS |
| 7 | #define __DT_STRUCTS |
Simon Glass | f24770d | 2016-07-04 11:58:02 -0600 | [diff] [blame] | 8 | |
| 9 | /* These structures may only be used in SPL */ |
| 10 | #if CONFIG_IS_ENABLED(OF_PLATDATA) |
Simon Glass | 08c3b88 | 2020-10-03 09:25:21 -0600 | [diff] [blame] | 11 | struct driver_info; |
| 12 | |
Simon Glass | 4ee0cc8 | 2021-08-07 07:24:08 -0600 | [diff] [blame] | 13 | /** |
| 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 Glass | 0d15463 | 2017-08-29 14:15:56 -0600 | [diff] [blame] | 22 | struct phandle_0_arg { |
Simon Glass | 8a38abf | 2020-10-03 11:31:40 -0600 | [diff] [blame] | 23 | uint idx; |
Simon Glass | bc79617 | 2017-08-29 14:15:58 -0600 | [diff] [blame] | 24 | int arg[0]; |
Simon Glass | 0d15463 | 2017-08-29 14:15:56 -0600 | [diff] [blame] | 25 | }; |
| 26 | |
Simon Glass | 4ee0cc8 | 2021-08-07 07:24:08 -0600 | [diff] [blame] | 27 | /** |
| 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 Glass | 0d15463 | 2017-08-29 14:15:56 -0600 | [diff] [blame] | 36 | struct phandle_1_arg { |
Simon Glass | 8a38abf | 2020-10-03 11:31:40 -0600 | [diff] [blame] | 37 | uint idx; |
Simon Glass | bc79617 | 2017-08-29 14:15:58 -0600 | [diff] [blame] | 38 | int arg[1]; |
Simon Glass | f24770d | 2016-07-04 11:58:02 -0600 | [diff] [blame] | 39 | }; |
Simon Glass | 634eba4 | 2017-08-29 14:15:59 -0600 | [diff] [blame] | 40 | |
Simon Glass | 4ee0cc8 | 2021-08-07 07:24:08 -0600 | [diff] [blame] | 41 | /** |
| 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 Glass | 634eba4 | 2017-08-29 14:15:59 -0600 | [diff] [blame] | 50 | struct phandle_2_arg { |
Simon Glass | 8a38abf | 2020-10-03 11:31:40 -0600 | [diff] [blame] | 51 | uint idx; |
Simon Glass | 634eba4 | 2017-08-29 14:15:59 -0600 | [diff] [blame] | 52 | int arg[2]; |
| 53 | }; |
Simon Glass | 910de10 | 2021-03-15 17:25:20 +1300 | [diff] [blame] | 54 | |
Simon Glass | b145b45 | 2017-08-29 14:16:00 -0600 | [diff] [blame] | 55 | #include <generated/dt-structs-gen.h> |
Simon Glass | 910de10 | 2021-03-15 17:25:20 +1300 | [diff] [blame] | 56 | #include <generated/dt-decl.h> |
Simon Glass | f24770d | 2016-07-04 11:58:02 -0600 | [diff] [blame] | 57 | #endif |
| 58 | |
| 59 | #endif |