summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-11-24 12:01:48 -0500
committerTom Rini <trini@ti.com>2014-11-24 12:01:48 -0500
commit1739564e753bc3a8097f8937a3cbe738bdaaed5d (patch)
tree56fe759e62f129dc055b6f6a22f299f6c8b5cdde /common/spl
parent746667f1e56bf08d03e66a178df3c4f4f6c806e1 (diff)
parent17b28edb37a33d0c89089faf36e4edd7084f65fa (diff)
downloadu-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.zip
u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.gz
u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.bz2
Merge git://git.denx.de/u-boot-dm
Conflicts: drivers/serial/serial-uclass.c Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 97eb8eb..1826c47 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -7,6 +7,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <dm.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <nand.h>
@@ -15,6 +16,7 @@
#include <i2c.h>
#include <image.h>
#include <malloc.h>
+#include <dm/root.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -139,9 +141,16 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
u32 boot_device;
debug(">>spl:board_init_r()\n");
-#ifdef CONFIG_SYS_SPL_MALLOC_START
+#if defined(CONFIG_SYS_SPL_MALLOC_START)
mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
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_ptr = 0;
+#endif
+#ifdef CONFIG_SPL_DM
+ dm_init_and_scan(true);
#endif
#ifndef CONFIG_PPC
@@ -240,6 +249,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
default:
debug("Unsupported OS image.. Jumping nevertheless..\n");
}
+#if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
+ debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
+ gd->malloc_ptr / 1024);
+#endif
+
jump_to_image_no_args(&spl_image);
}