From 293f16b1e7f6006f192950a94830e3a14c979c4d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 27 Feb 2015 22:06:37 -0700 Subject: Correct malloc_limit value for pre-relocation malloc() The limit is measured from the start of the malloc() area and is not an absolute address. Correct this. Signed-off-by: Simon Glass --- common/spl/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/spl') diff --git a/common/spl/spl.c b/common/spl/spl.c index 8e1fb40c47f..af1336ce100 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -158,7 +158,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) CONFIG_SYS_SPL_MALLOC_SIZE); gd->flags |= GD_FLG_FULL_MALLOC_INIT; #elif defined(CONFIG_SYS_MALLOC_F_LEN) - gd->malloc_limit = gd->malloc_base + CONFIG_SYS_MALLOC_F_LEN; + gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd->malloc_ptr = 0; #endif #ifdef CONFIG_SPL_DM -- cgit v1.3.1 From f3d46bd658ef4df575ec26c29e472ac858723159 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 27 Feb 2015 22:06:42 -0700 Subject: dm: Init device tree as well as driver model in SPL If enabled, make sure that the device tree is available in SPL before setting up driver model. Signed-off-by: Simon Glass --- common/spl/spl.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'common/spl') diff --git a/common/spl/spl.c b/common/spl/spl.c index af1336ce100..6a02c9ed96a 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -151,6 +151,8 @@ static void spl_ram_load_image(void) void board_init_r(gd_t *dummy1, ulong dummy2) { u32 boot_device; + int ret; + debug(">>spl:board_init_r()\n"); #if defined(CONFIG_SYS_SPL_MALLOC_START) @@ -161,9 +163,21 @@ void board_init_r(gd_t *dummy1, ulong dummy2) gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd->malloc_ptr = 0; #endif -#ifdef CONFIG_SPL_DM - dm_init_and_scan(true); -#endif + if (IS_ENABLED(CONFIG_OF_CONTROL) && + !IS_ENABLED(CONFIG_SPL_DISABLE_OF_CONTROL)) { + ret = fdtdec_setup(); + if (ret) { + debug("fdtdec_setup() returned error %d\n", ret); + hang(); + } + } + if (IS_ENABLED(CONFIG_SPL_DM)) { + ret = dm_init_and_scan(true); + if (ret) { + debug("dm_init_and_scan() returned error %d\n", ret); + hang(); + } + } #ifndef CONFIG_PPC /* -- cgit v1.3.1