]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_bootm.c
Fix loading freeze when netconsole is active
[karo-tx-uboot.git] / common / cmd_bootm.c
index 1685c14a5261eba30d21ea29c9eb87a65fbe50e5..349f1658bd6c4d7d856599ed36809a59c2b336a6 100644 (file)
@@ -368,7 +368,7 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
 
        const char *type_name = genimg_get_type_name(os.type);
 
-       load_buf = map_sysmem(load, image_len);
+       load_buf = map_sysmem(load, unc_len);
        image_buf = map_sysmem(image_start, image_len);
        switch (comp) {
        case IH_COMP_NONE:
@@ -436,11 +436,12 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
        }
 #endif /* CONFIG_LZMA */
 #ifdef CONFIG_LZO
-       case IH_COMP_LZO:
+       case IH_COMP_LZO: {
+               size_t size;
+
                printf("   Uncompressing %s ... ", type_name);
 
-               ret = lzop_decompress(image_buf, image_len, load_buf,
-                                     &unc_len);
+               ret = lzop_decompress(image_buf, image_len, load_buf, &size);
                if (ret != LZO_E_OK) {
                        printf("LZO: uncompress or overwrite error %d "
                              "- must RESET board to recover\n", ret);
@@ -449,8 +450,9 @@ static int bootm_load_os(bootm_headers_t *images, unsigned long *load_end,
                        return BOOTM_ERR_RESET;
                }
 
-               *load_end = load + unc_len;
+               *load_end = load + size;
                break;
+       }
 #endif /* CONFIG_LZO */
        default:
                printf("Unimplemented compression type %d\n", comp);
@@ -556,6 +558,7 @@ static ulong bootm_disable_interrupts(void)
 #ifdef CONFIG_NETCONSOLE
        /* Stop the ethernet stack if NetConsole could have left it up */
        eth_halt();
+       eth_unregister(eth_get_dev());
 #endif
 
 #if defined(CONFIG_CMD_USB)
@@ -797,8 +800,9 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
                BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
-               BOOTM_STATE_LOADOS | BOOTM_STATE_OS_PREP |
-               BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO, &images, 1);
+               BOOTM_STATE_LOADOS | BOOTM_STATE_OS_CMDLINE |
+               BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
+               BOOTM_STATE_OS_GO, &images, 1);
 }
 
 int bootm_maybe_autostart(cmd_tbl_t *cmdtp, const char *cmd)