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

Wills Wang wills.wang at live.com
Mon Jan 4 12:14:58 CET 2016


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 at 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



More information about the U-Boot mailing list