From ab7cd62790c4f7831b91eab8a2ec81742d01bb54 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 23 Jul 2014 06:55:04 -0600 Subject: 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 --- common/board_f.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common/board_f.c') diff --git a/common/board_f.c b/common/board_f.c index 6b2e277bd7..6203d85619 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #if defined(CONFIG_CMD_IDE) @@ -53,6 +54,7 @@ #ifdef CONFIG_SANDBOX #include #endif +#include #include /* @@ -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 */ -- cgit v1.2.1