Skip to content
Snippets Groups Projects
Commit 9b46213b authored by Shaohui Xie's avatar Shaohui Xie Committed by York Sun
Browse files

lpuart: add a get_lpuart_clk function


It's not always true that LPUART clock is CONFIG_SYS_CLK_FREQ. This
patch provides a weak function get_lpuart_clk(), so that the clock
can be ovreridden on a specific board which uses different clock
for LPUART.

Signed-off-by: default avatarShaohui Xie <Shaohui.Xie@nxp.com>
[YS: Reformat commit message]
Reviewed-by: default avatarYork Sun <york.sun@nxp.com>
parent 20c700f8
No related branches found
No related tags found
No related merge requests found
......@@ -170,9 +170,14 @@ static int lpuart_serial_probe(struct udevice *dev)
}
#else
u32 __weak get_lpuart_clk(void)
{
return CONFIG_SYS_CLK_FREQ;
}
static void _lpuart32_serial_setbrg(struct lpuart_fsl *base, int baudrate)
{
u32 clk = CONFIG_SYS_CLK_FREQ;
u32 clk = get_lpuart_clk();
u32 sbr;
sbr = (clk / (16 * baudrate));
......
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