Skip to content

Commit

Permalink
serial/uart_ns16550: support cec1702 alternate clock
Browse files Browse the repository at this point in the history
CEC1702 ns16550 compatible UART has alternate high-speed
clock selectable with the high bit of the baud rate divisor
register.

Signed-off-by: Timo Teräs <[email protected]>
  • Loading branch information
fabled committed Jul 6, 2019
1 parent d03c47d commit 96a953e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/serial/uart_ns16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ static void set_baud_rate(struct device *dev, u32_t baud_rate)
*/
divisor = ((dev_cfg->sys_clk_freq + (baud_rate << 3))
/ baud_rate) >> 4;
#if defined(CONFIG_SOC_SERIES_CEC)
if (dev_cfg->sys_clk_freq == 48000000) {
divisor |= 0x8000;
}
#endif

/* set the DLAB to access the baud rate divisor registers */
lcr_cache = INBYTE(LCR(dev));
Expand Down

0 comments on commit 96a953e

Please sign in to comment.