summaryrefslogtreecommitdiff
path: root/include/asm-generic
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-03 20:31:33 +0300
committerSimon Glass <sjg@chromium.org>2020-10-29 23:42:18 +0300
commita294ead8d2531a641f87bf182fee257029973ac0 (patch)
tree005705b193a11822a09bb0cf32dad428968b35ec /include/asm-generic
parent88280529bddf0bd05c90db42b6c8e48de954cf66 (diff)
downloadu-boot-a294ead8d2531a641f87bf182fee257029973ac0.tar.xz
dm: Use an allocated array for run-time device info
At present we update the driver_info struct with a pointer to the device that it created (i.e. caused to be bound). This works fine when U-Boot SPL is stored in read-write memory. But on some platforms, such as Intel Apollo Lake, it is not possible to update the data memory. In any case, it is bad form to put this information in a structure that is in the data region, since it expands the size of the binary. Create a new driver_rt structure which holds runtime information about drivers. Update the code to store the device pointer in this instead. Also update the test check that this works. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/global_data.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index cadfc05dd7..0aa1144184 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -24,6 +24,8 @@
#include <membuff.h>
#include <linux/list.h>
+struct driver_rt;
+
typedef struct global_data gd_t;
/**
@@ -192,6 +194,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
/**
@@ -438,6 +444,14 @@ struct global_data {
#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
+
/**
* enum gd_flags - global data flags
*