Skip to content

Commit

Permalink
Fixed UART Clock. NuttX Shell OK yay!
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Aug 2, 2023
1 parent 9e40490 commit 52bf1bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion boards/risc-v/qemu-rv/rv-virt/configs/knsh64/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIG_16550_ADDRWIDTH=0
CONFIG_16550_REGINCR=4
CONFIG_16550_UART0=y
CONFIG_16550_UART0_BASE=0x10000000
CONFIG_16550_UART0_CLOCK=3686400
CONFIG_16550_UART0_CLOCK=23040000
CONFIG_16550_UART0_IRQ=57
CONFIG_16550_UART0_SERIAL_CONSOLE=y
CONFIG_16550_UART=y
Expand Down
7 changes: 0 additions & 7 deletions drivers/serial/uart_16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,17 +830,11 @@ static int u16550_setup(FAR struct uart_dev_s *dev)

u16550_serialout(priv, UART_LCR_OFFSET, (lcr | UART_LCR_DLAB));

#ifdef TODO //// What is the UART Clock for JH7110?
/* Set the BAUD divisor */

div = u16550_divisor(priv);
u16550_serialout(priv, UART_DLM_OFFSET, div >> 8);
u16550_serialout(priv, UART_DLL_OFFSET, div & 0xff);
#else
uint32_t dlm = u16550_serialin(priv, UART_DLM_OFFSET);
uint32_t dll = u16550_serialin(priv, UART_DLL_OFFSET);
uint32_t baud = priv->baud;
#endif //// TODO

/* Wait till UART is not busy before setting LCR */

Expand Down Expand Up @@ -887,7 +881,6 @@ static int u16550_setup(FAR struct uart_dev_s *dev)
#endif

#endif
_info("dlm=%d, dll=%d, baud=%d\n", dlm, dll, baud);////
return OK;
}

Expand Down

0 comments on commit 52bf1bb

Please sign in to comment.