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>
This commit is contained in:
Nico Huber
2015-09-09 13:27:09 +02:00
committed by Nico Huber
parent 602a82af7c
commit a7c609c262
2 changed files with 4 additions and 250 deletions

View File

@@ -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');