[PATCH 11/20] dm: Use an allocated array for run-time device info

Simon Glass sjg at chromium.org
Fri Oct 30 04:34:38 CET 2020


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 at chromium.org>
---

 drivers/core/device.c             | 11 ++++++-----
 drivers/core/lists.c              | 16 +++++++++++-----
 drivers/core/root.c               | 11 +++++++++++
 include/asm-generic/global_data.h | 13 +++++++++++++
 include/dm/device-internal.h      |  2 +-
 include/dm/platdata.h             | 14 ++++++++++++--
 test/dm/of_platdata.c             | 19 ++++++++++---------
 7 files changed, 64 insertions(+), 22 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list