Skip to content
Snippets Groups Projects
Commit 92d3e6e0 authored by Richard Retanubun's avatar Richard Retanubun Committed by John Rigby
Browse files

Coldfire: Applied baudrate formula of serial_init to serial_setbrg


Applied the patch for baudrate divider value truncation for
serial_init to serial_setbrg as well.

Signed-off-by: default avatarRichard Retanubun <RichardRetanubun@RuggedCom.com>
parent 8706ef37
No related branches found
No related tags found
No related merge requests found
......@@ -115,8 +115,9 @@ void serial_setbrg(void)
volatile uart_t *uart = (volatile uart_t *)(CONFIG_SYS_UART_BASE);
u32 counter;
counter = ((gd->bus_clk / gd->baudrate)) >> 5;
counter++;
/* Setting up BaudRate */
counter = (u32) ((gd->bus_clk / 32) + (gd->baudrate / 2));
counter = counter / gd->baudrate;
/* write to CTUR: divide counter upper byte */
uart->ubg1 = ((counter & 0xff00) >> 8);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment