summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/serial.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-12-03 21:25:35 -0800
committerPatrick Georgi <patrick@georgi-clan.de>2014-08-10 08:26:48 +0200
commit9ed8a82d265fde1df1a01be7568d8f0979020108 (patch)
treed1db96227b85433e6f77994e3170bef057afd02b /payloads/libpayload/drivers/serial.c
parente211bd9b7878009e4736fd9d15d6b03164e02267 (diff)
serial: Separate the serial hardware init and the serial console init.
You might want to use the serial hardware for something other than a console, or you might want to intercede in the serial stream to wrap it in another protocol. This is what you'd do to send output to GDB while using it to debug the payload. Change-Id: I2218c0dbb988dacb64e5bdaf5d92138828eff8b6 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/179559 Reviewed-by: Ronald Minnich <rminnich@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit da9ab46d974745125fe7d8b29ce43336c3586cd5) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/6547 Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload/drivers/serial.c')
-rw-r--r--payloads/libpayload/drivers/serial.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/serial.c b/payloads/libpayload/drivers/serial.c
index 92782a0ee6..a4c1b1a2ab 100644
--- a/payloads/libpayload/drivers/serial.c
+++ b/payloads/libpayload/drivers/serial.c
@@ -117,6 +117,15 @@ void serial_init(void)
#ifdef CONFIG_LP_SERIAL_SET_SPEED
serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1);
#endif
+}
+
+void serial_console_init(void)
+{
+ if (!lib_sysinfo.serial)
+ return;
+
+ serial_init();
+
console_add_input_driver(&consin);
console_add_output_driver(&consout);
serial_hardware_is_present = 1;