[U-Boot] [PATCH v6 07/10] ns16550: map register base address for debug UART

Wills Wang
2016-01-04T11:14:58Z

MIPS need to use KSEG1 address for register operation, this patch
add map_physmem to convert CONFIG_DEBUG_UART_BASE for debug UART.

Signed-off-by: Wills Wang <wills.wang@live.com>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

drivers/serial/ns16550.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 3b24af0..1e2538e 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -270,7 +270,8 @@ int NS16550_tstc(NS16550_t com_port)

static inline void _debug_uart_init(void)
{
- struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
+ struct NS16550 *com_port = (struct NS16550 *)map_physmem(
+ CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);
int baud_divisor;

/*
@@ -293,7 +294,8 @@ static inline void _debug_uart_init(void)

static inline void _debug_uart_putc(int ch)
{
- struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
+ struct NS16550 *com_port = (struct NS16550 *)map_physmem(
+ CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);

while (!(serial_din(&com_port->lsr) & UART_LSR_THRE))
;
--
1.9.1