summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-11-13 21:21:58 (GMT)
committerSimon Glass <sjg@chromium.org>2016-12-03 03:53:19 (GMT)
commit2f11cd9121658b65a1d0789b37f290b207993a34 (patch)
treec90d05480e74767fefc3b1ba0e855070a3a5c977 /include/dm
parenta9401b2bc93a750d1566174b18d23bcdc2a45b7b (diff)
downloadu-boot-2f11cd9121658b65a1d0789b37f290b207993a34.tar.xz
dm: core: Handle global_data moving in SPL
When CONFIG_SPL_STACK_R is enabled, and spl_init() is called before board_init_r(), spl_relocate_stack_gd() will move global_data to a new place in memory. This affects driver model since it uses a list for the uclasses. Unless this is updated the list will become invalid. When looking for a non-existent uclass, such as when adding a new one, the loop in uclass_find() may continue forever, thus causing a hang. Add a function to correct this rather obscure bug. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/root.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/dm/root.h b/include/dm/root.h
index c7f0c1d..3cf730d 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -21,6 +21,16 @@ struct udevice;
*/
struct udevice *dm_root(void);
+struct global_data;
+/**
+ * dm_fixup_for_gd_move() - Handle global_data moving to a new place
+ *
+ * The uclass list is part of global_data. Due to the way lists work, moving
+ * the list will cause it to become invalid. This function fixes that up so
+ * that the uclass list will work correctly.
+ */
+void dm_fixup_for_gd_move(struct global_data *new_gd);
+
/**
* dm_scan_platdata() - Scan all platform data and bind drivers
*