command: Remove the cmd_tbl_t typedef
[platform/kernel/u-boot.git] / arch / arm / lib / bootm.c
index bf68a5b..0facd0c 100644 (file)
  */
 
 #include <common.h>
+#include <bootstage.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <dm.h>
+#include <hang.h>
+#include <lmb.h>
 #include <dm/root.h>
+#include <env.h>
 #include <image.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
@@ -26,6 +31,7 @@
 #include <linux/compiler.h>
 #include <bootm.h>
 #include <vxworks.h>
+#include <asm/cache.h>
 
 #ifdef CONFIG_ARMV7_NONSEC
 #include <asm/armv7.h>
@@ -72,6 +78,9 @@ void arch_lmb_reserve(struct lmb *lmb)
                        gd->bd->bi_dram[bank].size - 1;
                if (sp > bank_end)
                        continue;
+               if (bank_end > gd->ram_top)
+                       bank_end = gd->ram_top - 1;
+
                lmb_reserve(lmb, sp, bank_end - sp + 1);
                break;
        }
@@ -223,6 +232,8 @@ static void do_nonsec_virt_switch(void)
 }
 #endif
 
+__weak void board_prep_linux(bootm_headers_t *images) { }
+
 /* Subcommand: PREP */
 static void boot_prep_linux(bootm_headers_t *images)
 {
@@ -269,6 +280,8 @@ static void boot_prep_linux(bootm_headers_t *images)
                printf("FDT and ATAGS support not compiled in - hanging\n");
                hang();
        }
+
+       board_prep_linux(images);
 }
 
 __weak bool armv7_boot_nonsec_default(void)
@@ -409,7 +422,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
  * DIFFERENCE: Instead of calling prep and go at the end
  * they are called if subcommand is equal 0.
  */
-int do_bootm_linux(int flag, int argc, char * const argv[],
+int do_bootm_linux(int flag, int argc, char *const argv[],
                   bootm_headers_t *images)
 {
        /* No need for those on ARM */