summaryrefslogtreecommitdiff
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-08-03 10:59:08 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-09-24 13:55:43 -0500
commitf8be7d659c45720edb91503d2a480fc198e7ee9d (patch)
treec38ce492840a95d7ff7cd8242703096d3c4e488f /common/cmd_bootm.c
parent2c8fe5120f8da013cbd789be2f10cce880972836 (diff)
downloadu-boot-imx-f8be7d659c45720edb91503d2a480fc198e7ee9d.zip
u-boot-imx-f8be7d659c45720edb91503d2a480fc198e7ee9d.tar.gz
u-boot-imx-f8be7d659c45720edb91503d2a480fc198e7ee9d.tar.bz2
net: Improve the speed of netconsole
Previously u-boot would initialize the network interface for every network operation and then shut it down again. This makes sense for most operations where the network in not known to be needed soon after the operation is complete. In the case of netconsole, it will use the network for every interaction with the shell or every printf. This means that the network is being reinitialized very often. On many devices, this intialization is very slow. This patch checks for consecutive netconsole actions and leaves the ethernet hardware initialized between them. It will still behave the same old way for all other network operations and any time another network operation happens between netconsole operations. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 45e726a..83fa5d7 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -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
@@ -1599,6 +1611,11 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*/
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