1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

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>
This commit is contained in:
Simon Glass
2014-07-23 06:55:04 -06:00
parent 00606d7e39
commit ab7cd62790
5 changed files with 60 additions and 22 deletions

View File

@@ -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 */