summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/oxford/oxpcie/oxpcie_early.c12
-rw-r--r--src/drivers/uart/pl011.c21
-rw-r--r--src/drivers/uart/uart8250io.c22
3 files changed, 46 insertions, 9 deletions
diff --git a/src/drivers/oxford/oxpcie/oxpcie_early.c b/src/drivers/oxford/oxpcie/oxpcie_early.c
index d7f473ed78..7de9da6b46 100644
--- a/src/drivers/oxford/oxpcie/oxpcie_early.c
+++ b/src/drivers/oxford/oxpcie/oxpcie_early.c
@@ -24,7 +24,9 @@
#include <arch/io.h>
#include <arch/early_variables.h>
#include <delay.h>
+#include <boot/coreboot_tables.h>
#include <console/uart.h>
+#include <device/pci.h>
#include <device/pci_def.h>
static unsigned int oxpcie_present CAR_GLOBAL;
@@ -139,9 +141,15 @@ void oxford_remap(u32 new_base)
uart1_base = new_base + 0x2000;
}
-uint32_t uartmem_getbaseaddr(void)
+void uart_fill_lb(void *data)
{
- return uart_platform_base(0);
+ struct lb_serial serial;
+ serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+ serial.baseaddr = uart_platform_base(0);
+ serial.baud = default_baudrate();
+ lb_add_serial(&serial, data);
+
+ lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data);
}
#endif
diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c
index e4bfdc6136..41e66face8 100644
--- a/src/drivers/uart/pl011.c
+++ b/src/drivers/uart/pl011.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <boot/coreboot_tables.h>
#include <console/uart.h>
static void pl011_uart_tx_byte(unsigned int *uart_base, unsigned char data)
@@ -25,13 +26,6 @@ unsigned int uart_platform_base(int idx)
return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
}
-#if !defined(__PRE_RAM__)
-uint32_t uartmem_getbaseaddr(void)
-{
- return CONFIG_CONSOLE_SERIAL_UART_ADDRESS;
-}
-#endif
-
void uart_init(void)
{
}
@@ -50,3 +44,16 @@ unsigned char uart_rx_byte(void)
{
return 0;
}
+
+#ifndef __PRE_RAM__
+void uart_fill_lb(void *data)
+{
+ struct lb_serial serial;
+ serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+ serial.baseaddr = uart_platform_base(0);
+ serial.baud = default_baudrate();
+ lb_add_serial(&serial, data);
+
+ lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data);
+}
+#endif
diff --git a/src/drivers/uart/uart8250io.c b/src/drivers/uart/uart8250io.c
index e4e8b6cfd7..1eebb18234 100644
--- a/src/drivers/uart/uart8250io.c
+++ b/src/drivers/uart/uart8250io.c
@@ -23,6 +23,10 @@
#include <trace.h>
#include "uart8250reg.h"
+#ifndef __ROMCC__
+#include <boot/coreboot_tables.h>
+#endif
+
/* Should support 8250, 16450, 16550, 16550A type UARTs */
/* Nominal values only, good for the range of choices Kconfig offers for
@@ -102,6 +106,11 @@ static void uart8250_init(unsigned base_port, unsigned divisor)
*/
static const unsigned bases[1] = { CONFIG_TTYS0_BASE };
+unsigned int uart_platform_base(int idx)
+{
+ return bases[idx];
+}
+
void uart_init(void)
{
unsigned int div;
@@ -129,3 +138,16 @@ void uart_tx_flush(void)
{
uart8250_tx_flush(bases[0]);
}
+
+#ifndef __PRE_RAM__
+void uart_fill_lb(void *data)
+{
+ struct lb_serial serial;
+ serial.type = LB_SERIAL_TYPE_IO_MAPPED;
+ serial.baseaddr = uart_platform_base(0);
+ serial.baud = default_baudrate();
+ lb_add_serial(&serial, data);
+
+ lb_add_console(LB_TAG_CONSOLE_SERIAL8250, data);
+}
+#endif