diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/include/ns16550.h b/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/include/ns16550.h index 39788ceb6..f5a1639fe 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/include/ns16550.h +++ b/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/include/ns16550.h @@ -214,6 +214,6 @@ void _debug_uart_init(void); void _debug_uart_putc(int ch); int _debug_uart_getc(void); void _debug_uart_printascii(const char *str); -void _debug_uart_phymem_init(void); +void _debug_uart_init_early(void); #endif /* __ns16550_h */ diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/ns16550.c b/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/ns16550.c index 9fa44ee17..27f6592d0 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/ns16550.c +++ b/Ubiquitous/XiZi_AIoT/hardkernel/uart/riscv/rv64gc/uart_io_for_jh7110/ns16550.c @@ -4,7 +4,7 @@ * modified to use CONFIG_SYS_ISA_MEM and new defines */ -#include +#include "ns16550.h" #include "mmio_access.h" struct ns16550 g_ns16550_com_port = {0}; @@ -14,7 +14,8 @@ unsigned long g_ns16550_uart_base = {0}; #define CONFIG_SYS_NS16550_UART_BASE 0x10000000 #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_NS16550_CLK 24000000 -#define CONFIG_SYS_NS16550_UART_BASE_MAP MMIO_P2V_WO(CONFIG_SYS_NS16550_UART_BASE) +#define CONFIG_SYS_NS16550_UART_BASE_VIRT MMIO_P2V_WO(CONFIG_SYS_NS16550_UART_BASE) + #define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */ #define UART_MCRVAL (UART_MCR_DTR | \ @@ -172,20 +173,20 @@ void _debug_uart_init(void) { int baudrate = CONFIG_BAUDRATE; - g_ns16550_uart_base = CONFIG_SYS_NS16550_UART_BASE_MAP; + g_ns16550_uart_base = CONFIG_SYS_NS16550_UART_BASE_VIRT; ns16550_serial_init(); ns16550_serial_setbrg(baudrate); _debug_uart_printascii("_debug_uart_init success.\n"); } -void _debug_uart_phymem_init(void) +void _debug_uart_init_early(void) { int baudrate = CONFIG_BAUDRATE; g_ns16550_uart_base = CONFIG_SYS_NS16550_UART_BASE; ns16550_serial_init(); ns16550_serial_setbrg(baudrate); - _debug_uart_printascii("_debug_uart_phymem_init success.\n"); + _debug_uart_printascii("_debug_uart_init_early success.\n"); } void _debug_uart_putc(int ch)