diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-23 12:55:04 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 13:07:24 (GMT) |
commit | ab7cd62790c4f7831b91eab8a2ec81742d01bb54 (patch) | |
tree | a298371967a59815b09ef034e165493b50826eea /drivers/core | |
parent | 00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9 (diff) | |
download | u-boot-ab7cd62790c4f7831b91eab8a2ec81742d01bb54.tar.xz |
dm: Support driver model prior to relocation
Initialise devices marked 'pre-reloc' and make them available prior to
relocation. Note that this requires pre-reloc malloc() to be available.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r-- | drivers/core/root.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c index ce4eef3..6059756 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -105,6 +105,31 @@ int dm_scan_fdt(const void *blob, bool pre_reloc_only) } #endif +int dm_init_and_scan(bool pre_reloc_only) +{ + int ret; + + ret = dm_init(); + if (ret) { + debug("dm_init() failed: %d\n", ret); + return ret; + } + ret = dm_scan_platdata(pre_reloc_only); + if (ret) { + debug("dm_scan_platdata() failed: %d\n", ret); + return ret; + } +#ifdef CONFIG_OF_CONTROL + ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only); + if (ret) { + debug("dm_scan_fdt() failed: %d\n", ret); + return ret; + } +#endif + + return 0; +} + /* This is the root driver - all drivers are children of this */ U_BOOT_DRIVER(root_driver) = { .name = "root_driver", |