aboutsummaryrefslogtreecommitdiff
path: root/common/image.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-02-27 21:51:50 -0600
committerMarian Balakowicz <m8@semihalf.com>2008-02-29 13:15:56 +0100
commitd3f2fa0d278467b2232e4eb2372f905c3febfbeb (patch)
tree354a389881ddaacfc29a0b02c6fb12b9cb7c1f81 /common/image.c
parente822d7fc4dd4755d4d0a22f05e33f33d1a0481da (diff)
[new uImage] Provide ability to restrict region used for boot images
Allow the user to set 'bootm_low' and 'bootm_size' env vars as a way to restrict what memory range is used for bootm. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Marian Balakowicz <m8@semihalf.com>
Diffstat (limited to 'common/image.c')
-rw-r--r--common/image.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/image.c b/common/image.c
index 0b718119f..9e446faa7 100644
--- a/common/image.c
+++ b/common/image.c
@@ -132,6 +132,32 @@ int getenv_autostart (void)
return (s && (*s == 'n')) ? 0 : 1;
}
+ulong getenv_bootm_low(void)
+{
+ char *s = getenv ("bootm_low");
+ if (s) {
+ ulong tmp = simple_strtoul (s, NULL, 16);
+ return tmp;
+ }
+
+#ifdef CFG_SDRAM_BASE
+ return CFG_SDRAM_BASE;
+#else
+ return 0;
+#endif
+}
+
+ulong getenv_bootm_size(void)
+{
+ char *s = getenv ("bootm_size");
+ if (s) {
+ ulong tmp = simple_strtoul (s, NULL, 16);
+ return tmp;
+ }
+
+ return gd->bd->bi_memsize;
+}
+
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
{
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)