summaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-23 06:55:04 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:07:24 +0100
commitab7cd62790c4f7831b91eab8a2ec81742d01bb54 (patch)
treea298371967a59815b09ef034e165493b50826eea /common/board_r.c
parent00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9 (diff)
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 'common/board_r.c')
-rw-r--r--common/board_r.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/common/board_r.c b/common/board_r.c
index fbabc898d8..8e7a3ac74c 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -273,27 +273,10 @@ static int initr_malloc(void)
#ifdef CONFIG_DM
static int initr_dm(void)
{
- int ret;
-
- ret = dm_init();
- if (ret) {
- debug("dm_init() failed: %d\n", ret);
- return ret;
- }
- ret = dm_scan_platdata(false);
- if (ret) {
- debug("dm_scan_platdata() failed: %d\n", ret);
- return ret;
- }
-#ifdef CONFIG_OF_CONTROL
- ret = dm_scan_fdt(gd->fdt_blob, false);
- if (ret) {
- debug("dm_scan_fdt() failed: %d\n", ret);
- return ret;
- }
-#endif
-
- return 0;
+ /* Save the pre-reloc driver model and start a new one */
+ gd->dm_root_f = gd->dm_root;
+ gd->dm_root = NULL;
+ return dm_init_and_scan(false);
}
#endif