summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/serial
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2015-09-09 13:27:09 +0200
committerNico Huber <nico.h@gmx.de>2015-09-10 09:19:11 +0000
commita7c609c262d5beba968519903fed297dc4b601c1 (patch)
tree110a3d4d2b0a6b3c6ca302700ed5cc2daf5bcfae /payloads/libpayload/drivers/serial
parent602a82af7cb9ad0c41d4470f82a725a9caec46d4 (diff)
downloadcoreboot-a7c609c262d5beba968519903fed297dc4b601c1.tar.xz
libpayload: Fix merge of PL011 UART support
Wished I hadn't seen that. Git saw the conflict (file was gone), both committer and reviewer thought it would be a good idea to re-add it as dead code (see 558e9b5: libpayload: Add minimal support for PL011 UART). Change-Id: Ifea8113fbc59e0463eaedb86b976f54ec11113a9 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11604 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/drivers/serial')
-rw-r--r--payloads/libpayload/drivers/serial/8250.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/serial/8250.c b/payloads/libpayload/drivers/serial/8250.c
index e9550f3e33..7fe9920a6c 100644
--- a/payloads/libpayload/drivers/serial/8250.c
+++ b/payloads/libpayload/drivers/serial/8250.c
@@ -67,6 +67,7 @@ static void serial_hardware_init(int speed, int word_bits,
{
unsigned char reg;
+#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
/* Disable interrupts. */
serial_write_reg(0, 0x01);
@@ -85,6 +86,7 @@ static void serial_hardware_init(int speed, int word_bits,
/* Restore the previous value of the divisor.
* And set 8 bits per character */
serial_write_reg((reg & ~0x80) | 3, 0x03);
+#endif
}
#endif
@@ -139,7 +141,9 @@ void serial_putchar(unsigned int c)
{
if (!serial_hardware_is_present)
return;
+#if !IS_ENABLED(CONFIG_LP_PL011_SERIAL_CONSOLE)
while ((serial_read_reg(0x05) & 0x20) == 0) ;
+#endif
serial_write_reg(c, 0x00);
if (c == '\n')
serial_putchar('\r');