diff options
author | duhuanpeng <u74147@gmail.com> | 2020-09-27 17:32:57 +0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-09-29 08:55:40 +0200 |
commit | a120be7d4c67b1ef2cf7bca581fa6603f231e5e4 (patch) | |
tree | c0a53772df95f38a20355386622564bd0468d149 /arch | |
parent | 9a0fa171d3582b75780bea703f4576a5d4d5a7a9 (diff) | |
download | barebox-a120be7d4c67b1ef2cf7bca581fa6603f231e5e4.tar.gz barebox-a120be7d4c67b1ef2cf7bca581fa6603f231e5e4.tar.xz |
asm/debug_ll_ns16550.h: add divisor parameter
add a parameter for the assembly version for passing divisor,
and set the default value to DEBUG_LL_UART_ADDR when no parameter
is given.
Now it is possible to recalculate divisor in runtime to keep
the baudrate unchanged. when pll settings changed outside of barebox.
e.g. jtag.
Signed-off-by: duhuanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/debug_ll_ns16550.h | 4 | ||||
-rw-r--r-- | arch/riscv/include/asm/debug_ll_ns16550.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/mips/include/asm/debug_ll_ns16550.h b/arch/mips/include/asm/debug_ll_ns16550.h index df58c4cf0d..703bfaee77 100644 --- a/arch/mips/include/asm/debug_ll_ns16550.h +++ b/arch/mips/include/asm/debug_ll_ns16550.h @@ -58,14 +58,14 @@ static inline void PUTC_LL(char ch) * Macros for use in assembly language code */ -.macro debug_ll_ns16550_init +.macro debug_ll_ns16550_init divisor=DEBUG_LL_UART_DIVISOR #ifdef CONFIG_DEBUG_LL la t0, DEBUG_LL_UART_ADDR li t1, UART_LCR_DLAB /* DLAB on */ sb t1, UART_LCR(t0) /* Write it out */ - li t1, DEBUG_LL_UART_DIVISOR + li t1, \divisor sb t1, UART_DLL(t0) /* write low order byte */ srl t1, t1, 8 sb t1, UART_DLM(t0) /* write high order byte */ diff --git a/arch/riscv/include/asm/debug_ll_ns16550.h b/arch/riscv/include/asm/debug_ll_ns16550.h index e891cbda25..f1c2ccbd0a 100644 --- a/arch/riscv/include/asm/debug_ll_ns16550.h +++ b/arch/riscv/include/asm/debug_ll_ns16550.h @@ -88,14 +88,14 @@ static inline void debug_ll_ns16550_init(void) * Macros for use in assembly language code */ -.macro debug_ll_ns16550_init +.macro debug_ll_ns16550_init divisor=DEBUG_LL_UART_DIVISOR #ifdef CONFIG_DEBUG_LL li t0, DEBUG_LL_UART_ADDR li t1, UART_LCR_DLAB /* DLAB on */ UART_REG_S t1, UART_LCR(t0) /* Write it out */ - li t1, DEBUG_LL_UART_DIVISOR + li t1, \divisor UART_REG_S t1, UART_DLL(t0) /* write low order byte */ srl t1, t1, 8 UART_REG_S t1, UART_DLM(t0) /* write high order byte */ |