xref: /openbmc/u-boot/include/dm/platdata.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
26494d708SSimon Glass /*
36494d708SSimon Glass  * Copyright (c) 2013 Google, Inc
46494d708SSimon Glass  *
56494d708SSimon Glass  * (C) Copyright 2012
66494d708SSimon Glass  * Pavel Herrmann <morpheus.ibis@gmail.com>
76494d708SSimon Glass  * Marek Vasut <marex@denx.de>
86494d708SSimon Glass  */
96494d708SSimon Glass 
106494d708SSimon Glass #ifndef _DM_PLATDATA_H
116494d708SSimon Glass #define _DM_PLATDATA_H
126494d708SSimon Glass 
1342c23dd2SMasahiro Yamada #include <linker_lists.h>
1442c23dd2SMasahiro Yamada 
150040b944SSimon Glass /**
160040b944SSimon Glass  * struct driver_info - Information required to instantiate a device
170040b944SSimon Glass  *
1897f3ee34SSimon Glass  * NOTE: Avoid using this except in extreme circumstances, where device tree
1997f3ee34SSimon Glass  * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is
2097f3ee34SSimon Glass  * available). U-Boot's driver model uses device tree for configuration.
2197f3ee34SSimon Glass  *
2281b4e751SMasahiro Yamada  * @name:	Driver name
230040b944SSimon Glass  * @platdata:	Driver-specific platform data
249fa28190SSimon Glass  * @platdata_size: Size of platform data structure
250040b944SSimon Glass  */
266494d708SSimon Glass struct driver_info {
276494d708SSimon Glass 	const char *name;
286494d708SSimon Glass 	const void *platdata;
299fa28190SSimon Glass #if CONFIG_IS_ENABLED(OF_PLATDATA)
309fa28190SSimon Glass 	uint platdata_size;
319fa28190SSimon Glass #endif
326494d708SSimon Glass };
336494d708SSimon Glass 
3497f3ee34SSimon Glass /**
3597f3ee34SSimon Glass  * NOTE: Avoid using these except in extreme circumstances, where device tree
3697f3ee34SSimon Glass  * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is
3797f3ee34SSimon Glass  * available). U-Boot's driver model uses device tree for configuration.
3897f3ee34SSimon Glass  */
396494d708SSimon Glass #define U_BOOT_DEVICE(__name)						\
406494d708SSimon Glass 	ll_entry_declare(struct driver_info, __name, driver_info)
416494d708SSimon Glass 
4210778398SSimon Glass /* Declare a list of devices. The argument is a driver_info[] array */
4310778398SSimon Glass #define U_BOOT_DEVICES(__name)						\
4410778398SSimon Glass 	ll_entry_declare_list(struct driver_info, __name, driver_info)
4510778398SSimon Glass 
466494d708SSimon Glass #endif
47