]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib_m68k/bootm.c
rename CFG_ macros to CONFIG_SYS
[people/ms/u-boot.git] / lib_m68k / bootm.c
index eca044ecead67be3db6951a6677610b8c6cc24f5..a73f6ebb99d4d0f3bb0f297fe4a1ae3002ef6c39 100644 (file)
@@ -35,8 +35,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
 #define PHYSADDR(x) x
 
 #define LINUX_MAX_ENVS         256
@@ -44,24 +42,20 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 static ulong get_sp (void);
 static void set_clocks_in_mhz (bd_t *kbd);
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
-void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
-                   int argc, char *argv[],
-                   bootm_headers_t *images)
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
        ulong sp;
 
-       ulong rd_data_start, rd_data_end, rd_len;
+       ulong rd_len;
        ulong initrd_start, initrd_end;
        int ret;
 
        ulong cmd_start, cmd_end;
        ulong bootmap_base;
        bd_t  *kbd;
-       ulong ep = 0;
        void  (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
-       struct lmb *lmb = images->lmb;
+       struct lmb *lmb = &images->lmb;
 
        bootmap_base = getenv_bootm_low();
 
@@ -70,7 +64,7 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
         *
         * Allocate space for command line and board info - the
         * address should be as high as possible within the reach of
-        * the kernel (see CFG_BOOTMAPSZ settings), but in unused
+        * the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused
         * memory, which means far enough below the current stack
         * pointer.
         */
@@ -79,46 +73,28 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
 
        /* adjust sp by 1K to be safe */
        sp -= 1024;
-       lmb_reserve(lmb, sp, (CFG_SDRAM_BASE + gd->ram_size - sp));
+       lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp));
 
        /* allocate space and init command line */
-       ret = get_boot_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base);
+       ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base);
        if (ret) {
                puts("ERROR with allocation of cmdline\n");
                goto error;
        }
 
        /* allocate space for kernel copy of board info */
-       ret = get_boot_kbd (lmb, &kbd, bootmap_base);
+       ret = boot_get_kbd (lmb, &kbd, bootmap_base);
        if (ret) {
                puts("ERROR with allocation of kernel bd\n");
                goto error;
        }
        set_clocks_in_mhz(kbd);
 
-       /* find kernel entry point */
-       if (images->legacy_hdr_valid) {
-               ep = image_get_ep (images->legacy_hdr_os);
-#if defined(CONFIG_FIT)
-       } else if (images->fit_uname_os) {
-               fit_unsupported_reset ("M68K linux bootm");
-               do_reset (cmdtp, flag, argc, argv);
-#endif
-       } else {
-               puts ("Could not find kernel entry point!\n");
-               do_reset (cmdtp, flag, argc, argv);
-       }
-       kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
-
-       /* find ramdisk */
-       ret = get_ramdisk (cmdtp, flag, argc, argv, images,
-                       IH_ARCH_M68K, &rd_data_start, &rd_data_end);
+       kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))images->ep;
 
-       if (ret)
-               goto error;
-
-       rd_len = rd_data_end - rd_data_start;
-       ret = ramdisk_high (lmb, rd_data_start, rd_len, &initrd_start, &initrd_end);
+       rd_len = images->rd_end - images->rd_start;
+       ret = boot_ramdisk_high (lmb, images->rd_start, rd_len,
+                       &initrd_start, &initrd_end);
        if (ret)
                goto error;
 
@@ -137,11 +113,8 @@ void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
         */
        (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
        /* does not return */
-       return ;
-
 error:
-       do_reset (cmdtp, flag, argc, argv);
-       return ;
+       return 1;
 }
 
 static ulong get_sp (void)