]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/image.c
spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS
[people/ms/u-boot.git] / common / image.c
index f4a1dc8e251a24251d5a09e0e900360d4fb846bb..1d7543dd185c331fc21c81add59b97a829d85c01 100644 (file)
@@ -458,24 +458,29 @@ ulong getenv_bootm_low(void)
 
 phys_size_t getenv_bootm_size(void)
 {
-       phys_size_t tmp;
+       phys_size_t tmp, size;
+       phys_addr_t start;
        char *s = getenv("bootm_size");
        if (s) {
                tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
                return tmp;
        }
+
+#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
+       start = gd->bd->bi_dram[0].start;
+       size = gd->bd->bi_dram[0].size;
+#else
+       start = gd->bd->bi_memstart;
+       size = gd->bd->bi_memsize;
+#endif
+
        s = getenv("bootm_low");
        if (s)
                tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
        else
-               tmp = 0;
-
+               tmp = start;
 
-#if defined(CONFIG_ARM) && defined(CONFIG_NR_DRAM_BANKS)
-       return gd->bd->bi_dram[0].size - (tmp - gd->bd->bi_dram[0].start);
-#else
-       return gd->bd->bi_memsize - (tmp - gd->bd->bi_memstart);
-#endif
+       return size - (tmp - start);
 }
 
 phys_size_t getenv_bootm_mapsize(void)
@@ -1265,7 +1270,7 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
  * @cmd_end: pointer to a ulong variable, will hold cmdline end
  *
  * boot_get_cmdline() allocates space for kernel command line below
- * BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-boot environemnt
+ * BOOTMAPSZ + getenv_bootm_low() address. If "bootargs" U-Boot environemnt
  * variable is present its contents is copied to allocated kernel
  * command line.
  *