summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/uart/pl011.c18
-rw-r--r--src/drivers/uart/sifive.c3
-rw-r--r--src/drivers/uart/uart8250io.c18
-rw-r--r--src/drivers/uart/uart8250mem.c22
4 files changed, 28 insertions, 33 deletions
diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c
index 3653262700..0661de174f 100644
--- a/src/drivers/uart/pl011.c
+++ b/src/drivers/uart/pl011.c
@@ -35,15 +35,13 @@ unsigned char uart_rx_byte(unsigned int idx)
return read8(&regs->dr);
}
-void uart_fill_lb(void *data)
+enum cb_err fill_lb_serial(struct lb_serial *serial)
{
- struct lb_serial serial;
- serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
- serial.baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
- serial.baud = get_uart_baudrate();
- serial.regwidth = 1;
- serial.input_hertz = uart_platform_refclk();
- lb_add_serial(&serial, data);
-
- lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data);
+ serial->type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+ serial->baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+ serial->baud = get_uart_baudrate();
+ serial->regwidth = 1;
+ serial->input_hertz = uart_platform_refclk();
+
+ return CB_SUCCESS;
}
diff --git a/src/drivers/uart/sifive.c b/src/drivers/uart/sifive.c
index 31181aa51f..d1b89dc745 100644
--- a/src/drivers/uart/sifive.c
+++ b/src/drivers/uart/sifive.c
@@ -100,7 +100,8 @@ unsigned int uart_input_clock_divider(void)
return 1;
}
-void uart_fill_lb(void *data)
+enum cb_err fill_lb_serial(struct lb_serial *serial)
{
+ return CB_ERR;
/* TODO */
}
diff --git a/src/drivers/uart/uart8250io.c b/src/drivers/uart/uart8250io.c
index 7ca24529bc..a7fc3466f3 100644
--- a/src/drivers/uart/uart8250io.c
+++ b/src/drivers/uart/uart8250io.c
@@ -109,15 +109,13 @@ void uart_tx_flush(unsigned int idx)
uart8250_tx_flush(uart_platform_base(idx));
}
-void uart_fill_lb(void *data)
+enum cb_err fill_lb_serial(struct lb_serial *serial)
{
- struct lb_serial serial;
- serial.type = LB_SERIAL_TYPE_IO_MAPPED;
- serial.baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
- serial.baud = get_uart_baudrate();
- serial.regwidth = 1;
- serial.input_hertz = uart_platform_refclk();
- lb_add_serial(&serial, data);
-
- lb_add_console(LB_TAG_CONSOLE_SERIAL8250, data);
+ serial->type = LB_SERIAL_TYPE_IO_MAPPED;
+ serial->baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+ serial->baud = get_uart_baudrate();
+ serial->regwidth = 1;
+ serial->input_hertz = uart_platform_refclk();
+
+ return CB_SUCCESS;
}
diff --git a/src/drivers/uart/uart8250mem.c b/src/drivers/uart/uart8250mem.c
index 79e786bf12..19677a8a6a 100644
--- a/src/drivers/uart/uart8250mem.c
+++ b/src/drivers/uart/uart8250mem.c
@@ -133,20 +133,18 @@ void uart_tx_flush(unsigned int idx)
uart8250_mem_tx_flush(base);
}
-void uart_fill_lb(void *data)
+enum cb_err fill_lb_serial(struct lb_serial *serial)
{
- struct lb_serial serial;
- serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
- serial.baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
- if (!serial.baseaddr)
- return;
- serial.baud = get_uart_baudrate();
+ serial->type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+ serial->baseaddr = uart_platform_base(CONFIG_UART_FOR_CONSOLE);
+ if (!serial->baseaddr)
+ return CB_ERR;
+ serial->baud = get_uart_baudrate();
if (CONFIG(DRIVERS_UART_8250MEM_32))
- serial.regwidth = sizeof(uint32_t);
+ serial->regwidth = sizeof(uint32_t);
else
- serial.regwidth = sizeof(uint8_t);
- serial.input_hertz = uart_platform_refclk();
- lb_add_serial(&serial, data);
+ serial->regwidth = sizeof(uint8_t);
+ serial->input_hertz = uart_platform_refclk();
- lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data);
+ return CB_SUCCESS;
}