diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-23 06:55:04 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 14:07:24 +0100 |
commit | ab7cd62790c4f7831b91eab8a2ec81742d01bb54 (patch) | |
tree | a298371967a59815b09ef034e165493b50826eea /common/board_f.c | |
parent | 00606d7e39da4a8ecfbbc19d5af252bdfdd1fcc9 (diff) | |
download | u-boot-imx-ab7cd62790c4f7831b91eab8a2ec81742d01bb54.zip u-boot-imx-ab7cd62790c4f7831b91eab8a2ec81742d01bb54.tar.gz u-boot-imx-ab7cd62790c4f7831b91eab8a2ec81742d01bb54.tar.bz2 |
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_f.c')
-rw-r--r-- | common/board_f.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c index 6b2e277..6203d85 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -14,6 +14,7 @@ #include <linux/compiler.h> #include <version.h> #include <environment.h> +#include <dm.h> #include <fdtdec.h> #include <fs.h> #if defined(CONFIG_CMD_IDE) @@ -53,6 +54,7 @@ #ifdef CONFIG_SANDBOX #include <asm/state.h> #endif +#include <dm/root.h> #include <linux/compiler.h> /* @@ -778,6 +780,19 @@ static int initf_malloc(void) return 0; } +static int initf_dm(void) +{ +#if defined(CONFIG_DM) && defined(CONFIG_SYS_MALLOC_F_LEN) + int ret; + + ret = dm_init_and_scan(true); + if (ret) + return ret; +#endif + + return 0; +} + static init_fnc_t init_sequence_f[] = { #ifdef CONFIG_SANDBOX setup_ram_buf, @@ -836,6 +851,7 @@ static init_fnc_t init_sequence_f[] = { init_timebase, #endif initf_malloc, + initf_dm, init_baud_rate, /* initialze baudrate settings */ serial_init, /* serial communications setup */ console_init_f, /* stage 1 init of console */ |