ARM: dts: stm32mp1: add dsi host for stm32mp157c-ev1 board
[oweals/u-boot.git] / common / command.c
index e14d1fa1d6b4c4425f9c5b74e65ada06a67524b5..4b887a267fb6d82d3cd827fe1558cf0b087a5c54 100644 (file)
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <command.h>
 #include <console.h>
+#include <env.h>
 #include <linux/ctype.h>
 
 /*
@@ -356,8 +357,13 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)
        int i, j, k, len, seplen, argc;
        int cnt;
        char last_char;
+#ifdef CONFIG_CMDLINE_PS_SUPPORT
+       const char *ps_prompt = env_get("PS1");
+#else
+       const char *ps_prompt = CONFIG_SYS_PROMPT;
+#endif
 
-       if (strcmp(prompt, CONFIG_SYS_PROMPT) != 0)
+       if (strcmp(prompt, ps_prompt) != 0)
                return 0;       /* not in normal console */
 
        cnt = strlen(buf);
@@ -574,6 +580,20 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
        enum command_ret_t rc = CMD_RET_SUCCESS;
        cmd_tbl_t *cmdtp;
 
+#if defined(CONFIG_SYS_XTRACE)
+       char *xtrace;
+
+       xtrace = env_get("xtrace");
+       if (xtrace) {
+               puts("+");
+               for (int i = 0; i < argc; i++) {
+                       puts(" ");
+                       puts(argv[i]);
+               }
+               puts("\n");
+       }
+#endif
+
        /* Look up command in command table */
        cmdtp = find_cmd(argv[0]);
        if (cmdtp == NULL) {