return 0;
 }
 #endif
+
+void cli_loop(void)
+{
+#ifdef CONFIG_SYS_HUSH_PARSER
+       parse_file_outer();
+       /* This point is never reached */
+       for (;;);
+#else
+       cli_simple_loop();
+#endif /*CONFIG_SYS_HUSH_PARSER*/
+}
+
+void cli_init(void)
+{
+#ifdef CONFIG_SYS_HUSH_PARSER
+       u_boot_hush_start();
+#endif
+
+#if defined(CONFIG_HUSH_INIT_VAR)
+       hush_init_var();
+#endif
+}
 
        return rc ? rc : repeatable;
 }
 
-void cli_loop(void)
+void cli_simple_loop(void)
 {
        static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, };
 
 
 #include <common.h>
 #include <autoboot.h>
 #include <cli.h>
-#include <cli_hush.h>
 #include <malloc.h>
 #include <version.h>
 
        setenv("ver", version_string);  /* set version variable */
 #endif /* CONFIG_VERSION_VARIABLE */
 
-#ifdef CONFIG_SYS_HUSH_PARSER
-       u_boot_hush_start();
-#endif
-
-#if defined(CONFIG_HUSH_INIT_VAR)
-       hush_init_var();
-#endif
+       cli_init();
 
        run_preboot_environment_command();
 
        /*
         * Main Loop for Monitor Command Processing
         */
-#ifdef CONFIG_SYS_HUSH_PARSER
-       parse_file_outer();
-       /* This point is never reached */
-       for (;;);
-#else
+
        cli_loop();
-#endif /*CONFIG_SYS_HUSH_PARSER*/
 }
 
  * This will return if we get a timeout waiting for a command. See
  * CONFIG_BOOT_RETRY_TIME.
  */
-void cli_loop(void);
+void cli_simple_loop(void);
 
 /**
  * cli_simple_run_command() - Execute a command with the simple CLI
  */
 int cli_simple_parse_line(char *line, char *argv[]);
 
+/**
+ * Go into the command loop
+ *
+ * This will return if we get a timeout waiting for a command, but only for
+ * the simple parser (not hush). See CONFIG_BOOT_RETRY_TIME.
+ */
+void cli_loop(void);
+
+/** Set up the command line interpreter ready for action */
+void cli_init(void);
+
 #define endtick(seconds) (get_ticks() + (uint64_t)(seconds) * get_tbclk())
 
 #endif