summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2015-12-18 14:17:10 +0900
committerTom Rini <trini@konsulko.com>2016-01-19 08:31:11 -0500
commit9c11135ce053904f4caadc27760f214425d9881a (patch)
tree4b7438849a5c2d3080286bcae84d84d5f00042b0
parentb57843e68804c2d53d2cff2b8b2238e37b388faa (diff)
image: fix getenv_bootm_size() function
Currently, this function returns wrong size if "bootm_low" is defined, but "bootm_size" is not. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/image.c b/common/image.c
index d63d9e01698..f4a1dc8e251 100644
--- a/common/image.c
+++ b/common/image.c
@@ -472,9 +472,9 @@ phys_size_t getenv_bootm_size(void)
#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
- return gd->bd->bi_dram[0].size - tmp;
+ return gd->bd->bi_dram[0].size - (tmp - gd->bd->bi_dram[0].start);
#else
- return gd->bd->bi_memsize - tmp;
+ return gd->bd->bi_memsize - (tmp - gd->bd->bi_memstart);
#endif
}