Skip to content

Commit 96a953e

Browse files
committed
serial/uart_ns16550: support cec1702 alternate clock
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]>
1 parent d03c47d commit 96a953e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/serial/uart_ns16550.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ static void set_baud_rate(struct device *dev, u32_t baud_rate)
293293
*/
294294
divisor = ((dev_cfg->sys_clk_freq + (baud_rate << 3))
295295
/ baud_rate) >> 4;
296+
#if defined(CONFIG_SOC_SERIES_CEC)
297+
if (dev_cfg->sys_clk_freq == 48000000) {
298+
divisor |= 0x8000;
299+
}
300+
#endif
296301

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

0 commit comments

Comments
 (0)