Skip to contentSkip to conversation

asm/debug_ll_ns16550.h: add parament divisor

PATCH Applied Du Huanpeng 2 participants 2 messages Sep 27, 2020 – Sep 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 asm/debug_ll_ns16550.h: add parament divisor

From: duhuanpeng <[email protected]>

add a parameters 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 possiable to recalculate divisor in runtime to keep the baudrate unchanged. when pll settings changed outside of barebox. e.g. jtag.

---
 arch/mips/include/asm/debug_ll_ns16550.h  | 4 ++--
 arch/riscv/include/asm/debug_ll_ns16550.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/include/asm/debug_ll_ns16550.h +2 -2
index df58c4c..703bfae 100644
@@ -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 */
arch/riscv/include/asm/debug_ll_ns16550.h +2 -2
index e891cbd..f1c2ccb 100644
@@ -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 */
Signature · 7 lines
2.7.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 9 lines · Du Huanpeng

From: duhuanpeng <[email protected]>

add a parameters 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 possiable to recalculate divisor in runtime to keep the baudrate unchanged. when pll settings changed outside of barebox. e.g. jtag.

Quoted 5 lines
---
 arch/mips/include/asm/debug_ll_ns16550.h  | 4 ++--
 arch/riscv/include/asm/debug_ll_ns16550.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox