diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-03-22 14:39:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-03-23 12:16:25 +0100 |
commit | d2409e089c9675d37ade7a35a433b8e7f93effb6 (patch) | |
tree | 55c41928fa28bbe68d30f237788c27d0e2ed4712 /arch | |
parent | 4f89322431492ee9f50f35cf2a5b9c9fb64a186e (diff) | |
download | barebox-d2409e089c9675d37ade7a35a433b8e7f93effb6.tar.gz barebox-d2409e089c9675d37ade7a35a433b8e7f93effb6.tar.xz |
RISC-V: debug_ll: ns16550: align C access size with assembly's
The assembly putc routines do accesses the same size of the register
stride. Do likewise for the C implementation.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/include/asm/debug_ll_ns16550.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/riscv/include/asm/debug_ll_ns16550.h b/arch/riscv/include/asm/debug_ll_ns16550.h index f1c2ccbd0a..7d6d12df74 100644 --- a/arch/riscv/include/asm/debug_ll_ns16550.h +++ b/arch/riscv/include/asm/debug_ll_ns16550.h @@ -51,9 +51,13 @@ #if defined(DEBUG_LL_UART_IOSIZE32) #define UART_REG_L lw #define UART_REG_S sw +#define __uart_read readl +#define __uart_write writel #elif defined(DEBUG_LL_UART_IOSIZE8) #define UART_REG_L lbu #define UART_REG_S sb +#define __uart_read readb +#define __uart_write writeb #else #error "Please define DEBUG_LL_UART_IOSIZE{8,32}" #endif @@ -68,19 +72,19 @@ static inline void PUTC_LL(char ch) { #ifdef CONFIG_DEBUG_LL - while (!(__raw_readl((u8 *)DEBUG_LL_UART_ADDR + UART_LSR) & UART_LSR_THRE)) + while (!(__uart_read((u8 *)DEBUG_LL_UART_ADDR + UART_LSR) & UART_LSR_THRE)) ; - __raw_writel(ch, (u8 *)DEBUG_LL_UART_ADDR + UART_THR); + __uart_write(ch, (u8 *)DEBUG_LL_UART_ADDR + UART_THR); #endif /* CONFIG_DEBUG_LL */ } static inline void debug_ll_ns16550_init(void) { #ifdef CONFIG_DEBUG_LL - __raw_writel(UART_LCR_DLAB, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR); - __raw_writel(DEBUG_LL_UART_DIVISOR & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLL); - __raw_writel((DEBUG_LL_UART_DIVISOR >> 8) & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLM); - __raw_writel(UART_LCR_W, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR); + __uart_write(UART_LCR_DLAB, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR); + __uart_write(DEBUG_LL_UART_DIVISOR & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLL); + __uart_write((DEBUG_LL_UART_DIVISOR >> 8) & 0xff, (u8 *)DEBUG_LL_UART_ADDR + UART_DLM); + __uart_write(UART_LCR_W, (u8 *)DEBUG_LL_UART_ADDR + UART_LCR); #endif /* CONFIG_DEBUG_LL */ } #else /* __ASSEMBLY__ */ |