Commit af282245462186b8b06047c379ee85f4d0ec7a9c

Authored by Simon Glass
1 parent a59abd1049

sandbox: Move CONFIG_SANDBOX_SERIAL to Kconfig

Move this over to Kconfig and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 5 changed files with 30 additions and 3 deletions Side-by-side Diff

configs/sandbox_defconfig
... ... @@ -41,4 +41,5 @@
41 41 CONFIG_UT_TIME=y
42 42 CONFIG_UT_DM=y
43 43 CONFIG_UT_ENV=y
  44 +CONFIG_SANDBOX_SERIAL=y
drivers/serial/Kconfig
... ... @@ -76,6 +76,26 @@
76 76 value. Use this value to specify the shift to use, where 0=byte
77 77 registers, 2=32-bit word registers, etc.
78 78  
  79 +config SANDBOX_SERIAL
  80 + bool "Sandbox UART support"
  81 + depends on SANDBOX && DM
  82 + help
  83 + Select this to enable a seral UART for sandbox. This is required to
  84 + operate correctly, otherwise you will see no serial output from
  85 + sandbox. The emulated UART will display to the console and console
  86 + input will be fed into the UART. This allows you to interact with
  87 + U-Boot.
  88 +
  89 + The operation of the console is controlled by the -t command-line
  90 + flag. In raw mode, U-Boot sees all characters from the terminal
  91 + before they are processed, including Ctrl-C. In cooked mode, Ctrl-C
  92 + is processed by the terminal, and terminates U-Boot. Valid options
  93 + are:
  94 +
  95 + -t raw-with-sigs Raw mode, Ctrl-C will terminate U-Boot
  96 + -t raw Raw mode, Ctrl-C is processed by U-Boot
  97 + -t cooked Cooked mode, Ctrl-C terminates
  98 +
79 99 config UNIPHIER_SERIAL
80 100 bool "Support for UniPhier on-chip UART"
81 101 depends on ARCH_UNIPHIER && DM_SERIAL
drivers/serial/serial-uclass.c
... ... @@ -32,7 +32,7 @@
32 32 struct udevice *dev;
33 33 int node;
34 34  
35   - if (OF_CONTROL) {
  35 + if (OF_CONTROL && gd->fdt_blob) {
36 36 /* Check for a chosen console */
37 37 node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
38 38 if (node < 0)
... ... @@ -54,7 +54,8 @@
54 54 return;
55 55 }
56 56 }
57   - } else {
  57 + }
  58 + if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) {
58 59 /*
59 60 * Try to use CONFIG_CONS_INDEX if available (it is numbered
60 61 * from 1!).
include/configs/sandbox.h
... ... @@ -113,7 +113,6 @@
113 113 #define CONFIG_BAUDRATE 115200
114 114 #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
115 115 115200}
116   -#define CONFIG_SANDBOX_SERIAL
117 116  
118 117 #define CONFIG_SYS_NO_FLASH
119 118  
... ... @@ -41,6 +41,12 @@
41 41 fdt_addr_t end;
42 42 };
43 43  
  44 +#ifdef CONFIG_SPL_BUILD
  45 +#define SPL_BUILD 1
  46 +#else
  47 +#define SPL_BUILD 0
  48 +#endif
  49 +
44 50 #ifdef CONFIG_OF_CONTROL
45 51 # if defined(CONFIG_SPL_BUILD) && defined(SPL_DISABLE_OF_CONTROL)
46 52 # define OF_CONTROL 0