]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_bootm.c
include/image.h: sparse fixes
[u-boot] / common / cmd_bootm.c
index 5685232892a647aa221e5af381dfbb84ceb65632..83fa5d7bd8b8057661fa50a7ddff0144cba73b66 100644 (file)
@@ -564,6 +564,13 @@ int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
                        break;
                case BOOTM_STATE_OS_GO:
                        disable_interrupts();
+#ifdef CONFIG_NETCONSOLE
+                       /*
+                        * Stop the ethernet stack if NetConsole could have
+                        * left it up
+                        */
+                       eth_halt();
+#endif
                        arch_preboot_os();
                        boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
                        break;
@@ -622,6 +629,11 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         */
        iflag = disable_interrupts();
 
+#ifdef CONFIG_NETCONSOLE
+       /* Stop the ethernet stack if NetConsole could have left it up */
+       eth_halt();
+#endif
+
 #if defined(CONFIG_CMD_USB)
        /*
         * turn off USB to prevent the host controller from writing to the
@@ -1587,7 +1599,6 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
 
 static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       ulong           iflag;
        bootm_headers_t images;
 
        if (bootz_start(cmdtp, flag, argc, argv, &images))
@@ -1598,7 +1609,12 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
         * overwrite all exception vector code, so we cannot easily
         * recover from any failures any more...
         */
-       iflag = disable_interrupts();
+       disable_interrupts();
+
+#ifdef CONFIG_NETCONSOLE
+       /* Stop the ethernet stack if NetConsole could have left it up */
+       eth_halt();
+#endif
 
 #if defined(CONFIG_CMD_USB)
        /*