X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fdm%2Fplatdata.h;h=488b2ab0aea446f524b7edede8cc7ee583b920b5;hb=b66c60dde9d48889b93694326d40f7e5208cff25;hp=2bc8b147edfed01f152c1ca5e310ba8248637534;hpb=c23154aab5825fec81d5500c53eaa686646c76b5;p=u-boot diff --git a/include/dm/platdata.h b/include/dm/platdata.h index 2bc8b147ed..488b2ab0ae 100644 --- a/include/dm/platdata.h +++ b/include/dm/platdata.h @@ -11,18 +11,38 @@ #ifndef _DM_PLATDATA_H #define _DM_PLATDATA_H +#include + /** * struct driver_info - Information required to instantiate a device * - * @name: Device name + * NOTE: Avoid using this except in extreme circumstances, where device tree + * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is + * available). U-Boot's driver model uses device tree for configuration. + * + * @name: Driver name * @platdata: Driver-specific platform data + * @platdata_size: Size of platform data structure + * @flags: Platform data flags (DM_FLAG_...) */ struct driver_info { const char *name; const void *platdata; +#if CONFIG_IS_ENABLED(OF_PLATDATA) + uint platdata_size; +#endif }; +/** + * NOTE: Avoid using these except in extreme circumstances, where device tree + * is not feasible (e.g. serial driver in SPL where <8KB of SRAM is + * available). U-Boot's driver model uses device tree for configuration. + */ #define U_BOOT_DEVICE(__name) \ ll_entry_declare(struct driver_info, __name, driver_info) +/* Declare a list of devices. The argument is a driver_info[] array */ +#define U_BOOT_DEVICES(__name) \ + ll_entry_declare_list(struct driver_info, __name, driver_info) + #endif