summaryrefslogtreecommitdiffstats
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-27 21:51:47 -0600
committerMarian Balakowicz <m8@semihalf.com>2008-02-29 13:15:55 +0100
commit4ed6552f715983bfc7d212c1199a1f796f1144ad (patch)
tree9588ceff4adbabc534b5621ff3c6e2f8a3c7aa6e /common/cmd_bootm.c
parent4648c2e7a173b0d7f17bef4adaa0623090c9e904 (diff)
downloadtalos-obmc-uboot-4ed6552f715983bfc7d212c1199a1f796f1144ad.tar.gz
talos-obmc-uboot-4ed6552f715983bfc7d212c1199a1f796f1144ad.zip
[new uImage] Introduce lmb from linux kernel for memory mgmt of boot images
Introduce the LMB lib used on PPC in the kernel as a clean way to manage the memory spaces used by various boot images and structures. This code will allow us to simplify the code in bootm and its support functions. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index e5ed167749..92c18d059d 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -34,6 +34,7 @@
#include <zlib.h>
#include <bzlib.h>
#include <environment.h>
+#include <lmb.h>
#include <asm/byteorder.h>
#ifdef CFG_HUSH_PARSER
@@ -118,8 +119,19 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong image_start, image_end;
ulong load_start, load_end;
+ struct lmb lmb;
+
memset ((void *)&images, 0, sizeof (images));
images.verify = getenv_verify();
+ images.lmb = &lmb;
+
+ lmb_init(&lmb);
+
+#ifdef CFG_SDRAM_BASE
+ lmb_add(&lmb, CFG_SDRAM_BASE, gd->bd->bi_memsize);
+#else
+ lmb_add(&lmb, 0, gd->bd->bi_memsize);
+#endif
/* get kernel image header, start address and length */
os_hdr = get_kernel (cmdtp, flag, argc, argv,
@@ -237,6 +249,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
show_boot_progress (8);
+ lmb_reserve(&lmb, load_start, (load_end - load_start));
+
switch (os) {
default: /* handled by (original) Linux case */
case IH_OS_LINUX:
OpenPOWER on IntegriCloud