]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig
authorSimon Glass <sjg@chromium.org>
Fri, 6 Mar 2015 20:19:03 +0000 (13:19 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 22:42:46 +0000 (00:42 +0200)
Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
configs/sandbox_defconfig
drivers/serial/Kconfig
drivers/serial/serial-uclass.c
include/configs/sandbox.h
include/fdtdec.h

index 345b701f146e01b476dbaa370d8ea3bbe03b0ab3..31fe2f9f451fdf1a7bb929e222b66bd4d040c72a 100644 (file)
@@ -41,3 +41,4 @@ CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
 CONFIG_UT_ENV=y
+CONFIG_SANDBOX_SERIAL=y
index 5611fac0dc46793bfc23f08573eddb89a7ce2a91..4829284216c2fcb6eb5b280ce62163b496008da4 100644 (file)
@@ -76,6 +76,26 @@ config DEBUG_UART_SHIFT
          value. Use this value to specify the shift to use, where 0=byte
          registers, 2=32-bit word registers, etc.
 
+config SANDBOX_SERIAL
+       bool "Sandbox UART support"
+       depends on SANDBOX && DM
+       help
+         Select this to enable a seral UART for sandbox. This is required to
+         operate correctly, otherwise you will see no serial output from
+         sandbox. The emulated UART will display to the console and console
+         input will be fed into the UART. This allows you to interact with
+         U-Boot.
+
+         The operation of the console is controlled by the -t command-line
+         flag. In raw mode, U-Boot sees all characters from the terminal
+         before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
+         is processed by the terminal, and terminates U-Boot. Valid options
+         are:
+
+            -t raw-with-sigs   Raw mode, Ctrl-C will terminate U-Boot
+            -t raw             Raw mode, Ctrl-C is processed by U-Boot
+            -t cooked          Cooked mode, Ctrl-C terminates
+
 config UNIPHIER_SERIAL
        bool "Support for UniPhier on-chip UART"
        depends on ARCH_UNIPHIER && DM_SERIAL
index 5674d5e538aec370b9e9c33997dd2bfd31b5ae63..815fec32646924c2c8000cbb25798cd6b227460a 100644 (file)
@@ -32,7 +32,7 @@ static void serial_find_console_or_panic(void)
        struct udevice *dev;
        int node;
 
-       if (OF_CONTROL) {
+       if (OF_CONTROL && gd->fdt_blob) {
                /* Check for a chosen console */
                node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
                if (node < 0)
@@ -54,7 +54,8 @@ static void serial_find_console_or_panic(void)
                                return;
                        }
                }
-       } else {
+       }
+       if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) {
                /*
                * Try to use CONFIG_CONS_INDEX if available (it is numbered
                * from 1!).
index 3a857e2a3dd6c12c4c2ecdedfed961717fb449a9..3caa83ce098733cde2bc24a94c63e0d6a1b585a3 100644 (file)
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE      {4800, 9600, 19200, 38400, 57600,\
                                        115200}
-#define CONFIG_SANDBOX_SERIAL
 
 #define CONFIG_SYS_NO_FLASH
 
index 4fb8a2a1ba52faf11913812955d69966ee1aecdc..e255998161c43859920de45daf3a17d8e8b29776 100644 (file)
@@ -41,6 +41,12 @@ struct fdt_memory {
        fdt_addr_t end;
 };
 
+#ifdef CONFIG_SPL_BUILD
+#define SPL_BUILD      1
+#else
+#define SPL_BUILD      0
+#endif
+
 #ifdef CONFIG_OF_CONTROL
 # if defined(CONFIG_SPL_BUILD) && defined(SPL_DISABLE_OF_CONTROL)
 #  define OF_CONTROL 0