summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/serial.c9
-rw-r--r--payloads/libpayload/include/libpayload.h1
-rw-r--r--payloads/libpayload/libc/console.c2
3 files changed, 11 insertions, 1 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;
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 29b5629348..753449d37d 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -163,6 +163,7 @@ int keyboard_set_layout(char *country);
* @{
*/
void serial_init(void);
+void serial_console_init(void);
void serial_putchar(unsigned int c);
int serial_havechar(void);
int serial_getchar(void);
diff --git a/payloads/libpayload/libc/console.c b/payloads/libpayload/libc/console.c
index a362481b15..59d5bccb48 100644
--- a/payloads/libpayload/libc/console.c
+++ b/payloads/libpayload/libc/console.c
@@ -53,7 +53,7 @@ void console_init(void)
video_console_init();
#endif
#ifdef CONFIG_LP_SERIAL_CONSOLE
- serial_init();
+ serial_console_init();
#endif
#ifdef CONFIG_LP_PC_KEYBOARD
keyboard_init();