]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/cmd_bootm.c
nand/fsl: add NAND_NO_SUBPAGE_WRITE to eLBC and IFC drivers
[karo-tx-uboot.git] / common / cmd_bootm.c
index 5685232892a647aa221e5af381dfbb84ceb65632..d256ddfaa6f017a944aef86ff42c5cc86de915aa 100644 (file)
@@ -161,7 +161,7 @@ static boot_os_fn *boot_os[] = {
 bootm_headers_t images;                /* pointers to os/initrd/fdt images */
 
 /* Allow for arch specific config before we boot */
-void __arch_preboot_os(void)
+static void __arch_preboot_os(void)
 {
        /* please define platform specific arch_preboot_os() */
 }
@@ -474,7 +474,7 @@ static cmd_tbl_t cmd_bootm_sub[] = {
        U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
 };
 
-int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
                        char * const argv[])
 {
        int ret = 0;
@@ -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
@@ -1001,9 +1013,8 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
        return (void *)img_addr;
 }
 
-U_BOOT_CMD(
-       bootm,  CONFIG_SYS_MAXARGS,     1,      do_bootm,
-       "boot application image from memory",
+#ifdef CONFIG_SYS_LONGHELP
+static char bootm_help_text[] =
        "[addr [arg ...]]\n    - boot application image stored in memory\n"
        "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
        "\t'arg' can be the address of an initrd image\n"
@@ -1036,7 +1047,12 @@ U_BOOT_CMD(
        "\tcmdline - OS specific command line processing/setup\n"
        "\tbdt     - OS specific bd_t processing\n"
        "\tprep    - OS specific prep before relocation or go\n"
-       "\tgo      - start OS"
+       "\tgo      - start OS";
+#endif
+
+U_BOOT_CMD(
+       bootm,  CONFIG_SYS_MAXARGS,     1,      do_bootm,
+       "boot application image from memory", bootm_help_text
 );
 
 /*******************************************************************/
@@ -1072,7 +1088,7 @@ U_BOOT_CMD(
 /* iminfo - print header info for a requested image */
 /*******************************************************************/
 #if defined(CONFIG_CMD_IMI)
-int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        int     arg;
        ulong   addr;
@@ -1159,7 +1175,7 @@ U_BOOT_CMD(
 /* imls - list all images found in flash */
 /*******************************************************************/
 #if defined(CONFIG_CMD_IMLS)
-int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        flash_info_t *info;
        int i, j;
@@ -1587,7 +1603,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 +1613,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)
        /*
@@ -1627,9 +1647,8 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return 1;
 }
 
-U_BOOT_CMD(
-       bootz,  CONFIG_SYS_MAXARGS,     1,      do_bootz,
-       "boot Linux zImage image from memory",
+#ifdef CONFIG_SYS_LONGHELP
+static char bootz_help_text[] =
        "[addr [initrd[:size]] [fdt]]\n"
        "    - boot Linux zImage stored in memory\n"
        "\tThe argument 'initrd' is optional and specifies the address\n"
@@ -1642,5 +1661,11 @@ U_BOOT_CMD(
        "\tuse a '-' for the second argument. If you do not pass a third\n"
        "\ta bd_info struct will be passed instead\n"
 #endif
+       "";
+#endif
+
+U_BOOT_CMD(
+       bootz,  CONFIG_SYS_MAXARGS,     1,      do_bootz,
+       "boot Linux zImage image from memory", bootz_help_text
 );
 #endif /* CONFIG_CMD_BOOTZ */