diff mbox series

[U-Boot,11/15] serial: sandbox: Allow serial output without device tree

Message ID 20181001175520.239554-12-sjg@chromium.org
State Accepted
Commit 114b60a7e62db25bcf26d5dddcfabecbc0160086
Delegated to: Simon Glass
Headers show
Series sandbox: Add support for TPL and other improvements | expand

Commit Message

Simon Glass Oct. 1, 2018, 5:55 p.m. UTC
At present sandbox assumes that device-tree control is active, but this
may not be the case in SPL or TPL. Add some conditions to handle this.

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

 drivers/serial/sandbox.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Simon Glass Oct. 9, 2018, 11:51 p.m. UTC | #1
At present sandbox assumes that device-tree control is active, but this
may not be the case in SPL or TPL. Add some conditions to handle this.

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

 drivers/serial/sandbox.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied to u-boot-dm
diff mbox series

Patch

diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c
index 4fbc5956b76..9e9bf3e011f 100644
--- a/drivers/serial/sandbox.c
+++ b/drivers/serial/sandbox.c
@@ -22,6 +22,8 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+
 /*
  *
  *   serial_buf: A buffer that holds keyboard characters for the
@@ -142,6 +144,7 @@  static int sandbox_serial_getc(struct udevice *dev)
 	serial_buf_read = increment_buffer_index(serial_buf_read);
 	return result;
 }
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 #ifdef CONFIG_DEBUG_UART_SANDBOX
 
@@ -173,6 +176,7 @@  static int sandbox_serial_setconfig(struct udevice *dev, uint serial_config)
 	return 0;
 }
 
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const char * const ansi_colour[] = {
 	"black", "red", "green", "yellow", "blue", "megenta", "cyan",
 	"white",
@@ -232,3 +236,4 @@  U_BOOT_DEVICE(serial_sandbox_non_fdt) = {
 	.name = "serial_sandbox",
 	.platdata = &platdata_non_fdt,
 };
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */