summaryrefslogtreecommitdiff
path: root/include/dm/platdata.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-03 11:31:33 -0600
committerSimon Glass <sjg@chromium.org>2020-10-29 14:42:18 -0600
commita294ead8d2531a641f87bf182fee257029973ac0 (patch)
tree005705b193a11822a09bb0cf32dad428968b35ec /include/dm/platdata.h
parent88280529bddf0bd05c90db42b6c8e48de954cf66 (diff)
downloadu-boot-a294ead8d2531a641f87bf182fee257029973ac0.tar.gz
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/dm/platdata.h')
-rw-r--r--include/dm/platdata.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/dm/platdata.h b/include/dm/platdata.h
index 25479b03d2..2c3cc90c29 100644
--- a/include/dm/platdata.h
+++ b/include/dm/platdata.h
@@ -22,18 +22,28 @@
* @name: Driver name
* @platdata: Driver-specific platform data
* @platdata_size: Size of platform data structure
- * @dev: Device created from this structure data
*/
struct driver_info {
const char *name;
const void *platdata;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
uint platdata_size;
- struct udevice *dev;
#endif
};
/**
+ * driver_rt - runtime information set up by U-Boot
+ *
+ * There is one of these for every driver_info in the linker list, indexed by
+ * the driver_info idx value.
+ *
+ * @dev: Device created from this idx
+ */
+struct driver_rt {
+ struct udevice *dev;
+};
+
+/**
* 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.