summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAngelo Dureghello <angelo@sysam.it>2016-05-21 12:05:49 +0200
committerSimon Glass <sjg@chromium.org>2016-06-19 17:05:55 -0600
commit5aeedebc33849efbbee2d422a4c7da8194e1b670 (patch)
tree92cbecf3e858b555422a43e0af864d547cc0f21a /drivers
parent9ab165d8b05706284de0ee9bd402346c54ae6b15 (diff)
downloadblackbird-obmc-uboot-5aeedebc33849efbbee2d422a4c7da8194e1b670.tar.gz
blackbird-obmc-uboot-5aeedebc33849efbbee2d422a4c7da8194e1b670.zip
dm: add manual relocation for devices
Some architectures as m68k still need to use CONFIG_NEEDS_MANUAL_RELOC, and are not still using the device tree. Signed-off-by: Angelo Dureghello <angelo@sysam.it> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/root.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 13c2713e61..95886add23 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -122,6 +122,20 @@ void fix_uclass(void)
entry->ops += gd->reloc_off;
}
}
+
+void fix_devices(void)
+{
+ struct driver_info *dev =
+ ll_entry_start(struct driver_info, driver_info);
+ const int n_ents = ll_entry_count(struct driver_info, driver_info);
+ struct driver_info *entry;
+
+ for (entry = dev; entry != dev + n_ents; entry++) {
+ if (entry->platdata)
+ entry->platdata += gd->reloc_off;
+ }
+}
+
#endif
int dm_init(void)
@@ -137,6 +151,7 @@ int dm_init(void)
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
fix_drivers();
fix_uclass();
+ fix_devices();
#endif
ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
OpenPOWER on IntegriCloud