aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic/global_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/global_data.h')
-rw-r--r--include/asm-generic/global_data.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 0157af1aa4..87d827d0f4 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -24,6 +24,9 @@
#include <membuff.h>
#include <linux/list.h>
+struct acpi_ctx;
+struct driver_rt;
+
typedef struct global_data gd_t;
/**
@@ -192,6 +195,10 @@ struct global_data {
* @uclass_root: head of core tree
*/
struct list_head uclass_root;
+# if CONFIG_IS_ENABLED(OF_PLATDATA)
+ /** Dynamic info about the driver */
+ struct driver_rt *dm_driver_rt;
+# endif
#endif
#ifdef CONFIG_TIMER
/**
@@ -211,7 +218,7 @@ struct global_data {
* @fdt_size: space reserved for relocated device space
*/
unsigned long fdt_size;
-#ifdef CONFIG_OF_LIVE
+#if CONFIG_IS_ENABLED(OF_LIVE)
/**
* @of_root: root node of the live tree
*/
@@ -378,7 +385,7 @@ struct global_data {
*/
int logc_prev;
/**
- * @logl_pref: logging level of the previous message
+ * @logl_prev: logging level of the previous message
*
* This value is used as logging level for continuation messages.
*/
@@ -414,6 +421,12 @@ struct global_data {
*/
struct udevice *watchdog_dev;
#endif
+#ifdef CONFIG_GENERATE_ACPI_TABLE
+ /**
+ * @acpi_ctx: ACPI context pointer
+ */
+ struct acpi_ctx *acpi_ctx;
+#endif
};
/**
@@ -427,6 +440,31 @@ struct global_data {
#define gd_board_type() 0
#endif
+/* These macros help avoid #ifdefs in the code */
+#if CONFIG_IS_ENABLED(OF_LIVE)
+#define gd_of_root() gd->of_root
+#define gd_of_root_ptr() &gd->of_root
+#define gd_set_of_root(_root) gd->of_root = (_root)
+#else
+#define gd_of_root() NULL
+#define gd_of_root_ptr() NULL
+#define gd_set_of_root(_root)
+#endif
+
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
+#define gd_set_dm_driver_rt(dyn) gd->dm_driver_rt = dyn
+#define gd_dm_driver_rt() gd->dm_driver_rt
+#else
+#define gd_set_dm_driver_rt(dyn)
+#define gd_dm_driver_rt() NULL
+#endif
+
+#ifdef CONFIG_GENERATE_ACPI_TABLE
+#define gd_acpi_ctx() gd->acpi_ctx
+#else
+#define gd_acpi_ctx() NULL
+#endif
+
/**
* enum gd_flags - global data flags
*