]> git.sur5r.net Git - u-boot/blobdiff - lib_ppc/bootm.c
MPC8610HPCD: Report board id, board version and fpga version.
[u-boot] / lib_ppc / bootm.c
index b893146fcb5be2cdb17ddb4941a9f64393d7b046..10a0b12141e24fea1ddb9162a0872c558107d115 100644 (file)
@@ -71,6 +71,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        ulong   initrd_start, initrd_end;
        ulong   rd_data_start, rd_data_end, rd_len;
        ulong   size;
+       phys_size_t bootm_size;
 
        ulong   cmd_start, cmd_end, bootmap_base;
        bd_t    *kbd;
@@ -85,22 +86,23 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 #endif
 
        bootmap_base = getenv_bootm_low();
-       size = getenv_bootm_size();
+       bootm_size = getenv_bootm_size();
 
 #ifdef DEBUG
-       if (((u64)bootmap_base + size) > (CFG_SDRAM_BASE + (u64)gd->ram_size))
+       if (((u64)bootmap_base + bootm_size) >
+           (CFG_SDRAM_BASE + (u64)gd->ram_size))
                puts("WARNING: bootm_low + bootm_size exceed total memory\n");
-       if ((bootmap_base + size) > get_effective_memsize())
+       if ((bootmap_base + bootm_size) > get_effective_memsize())
                puts("WARNING: bootm_low + bootm_size exceed eff. memory\n");
 #endif
 
-       size = min(size, get_effective_memsize());
+       size = min(bootm_size, get_effective_memsize());
        size = min(size, CFG_LINUX_LOWMEM_MAX_SIZE);
 
-       if (size < getenv_bootm_size()) {
+       if (size < bootm_size) {
                ulong base = bootmap_base + size;
                printf("WARNING: adjusting available memory to %x\n", size);
-               lmb_reserve(lmb, base, getenv_bootm_size() - size);
+               lmb_reserve(lmb, base, bootm_size - size);
        }
 
        /*
@@ -146,7 +148,7 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        /* find kernel entry point */
        if (images->legacy_hdr_valid) {
-               ep = image_get_ep (images->legacy_hdr_os);
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
 #if defined(CONFIG_FIT)
        } else if (images->fit_uname_os) {
                ret = fit_image_get_entry (images->fit_hdr_os,
@@ -184,18 +186,6 @@ do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                        fdt_error ("/chosen node create failed");
                        goto error;
                }
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-               if (fdt_env(of_flat_tree) < 0) {
-                       fdt_error ("/u-boot-env node create failed");
-                       goto error;
-               }
-#endif
-#ifdef CONFIG_OF_HAS_BD_T
-               if (fdt_bd_t(of_flat_tree) < 0) {
-                       fdt_error ("/bd_t node create failed");
-                       goto error;
-               }
-#endif
 #ifdef CONFIG_OF_BOARD_SETUP
                /* Call the board-specific fixup routine */
                ft_board_setup(of_flat_tree, gd->bd);
@@ -638,9 +628,9 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                                /*
                                 * FDT blob
                                 */
+                               fdt_blob = (char *)fdt_addr;
                                debug ("*  fdt: raw FDT blob\n");
                                printf ("## Flattened Device Tree blob at %08lx\n", fdt_blob);
-                               fdt_blob = (char *)fdt_addr;
                        }
                        break;
                default:
@@ -651,7 +641,7 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                printf ("   Booting using the fdt blob at 0x%x\n", fdt_blob);
 
        } else if (images->legacy_hdr_valid &&
-                       image_check_type (images->legacy_hdr_os, IH_TYPE_MULTI)) {
+                       image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
 
                ulong fdt_data, fdt_len;
 
@@ -679,9 +669,8 @@ static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                                goto error;
                        }
                } else {
-                       fdt_error ("Did not find a Flattened Device Tree "
-                               "in a legacy multi-component image");
-                       goto error;
+                       debug ("## No Flattened Device Tree\n");
+                       return 0;
                }
        } else {
                debug ("## No Flattened Device Tree\n");
@@ -738,7 +727,7 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
                ulong of_start;
 
                /* position on a 4K boundary before the alloc_current */
-               of_start = lmb_alloc_base(lmb, of_len, 0x1000,
+               of_start = (unsigned long)lmb_alloc_base(lmb, of_len, 0x1000,
                                         (CFG_BOOTMAPSZ + bootmap_base));
 
                if (of_start == 0) {
@@ -763,7 +752,7 @@ static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
                *of_flat_tree = (char *)of_start;
        } else {
                *of_flat_tree = fdt_blob;
-               lmb_reserve(lmb, (ulong)fdt, of_len);
+               lmb_reserve(lmb, (ulong)working_fdt, of_len);
        }
 
        return 0;