1
0
Fork 0

tty: serial: imx: set uart module clock to 80MHz

The IP module clock maximum clock rate is 80MHz, Once the module
clock is great than 80MHz, there may have risk.

So set the maximum module clock to 80MHz.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Fugang Duan 2015-03-04 15:26:59 +08:00 committed by Dong Aisheng
parent 65e9e0baa9
commit 9fc55e60c4
1 changed files with 9 additions and 0 deletions

View File

@ -177,6 +177,7 @@
#define DRIVER_NAME "IMX-uart"
#define UART_NR 8
#define IMX_MODULE_MAX_CLK_RATE 80000000
/* i.MX21 type uart runs on all i.mx except i.MX1 and i.MX6q */
enum imx_uart_type {
@ -2255,6 +2256,14 @@ static int imx_uart_probe(struct platform_device *pdev)
return ret;
}
sport->port.uartclk = clk_get_rate(sport->clk_per);
if (sport->port.uartclk > IMX_MODULE_MAX_CLK_RATE) {
ret = clk_set_rate(sport->clk_per, IMX_MODULE_MAX_CLK_RATE);
if (ret < 0) {
dev_err(&pdev->dev, "clk_set_rate() failed\n");
return ret;
}
}
sport->port.uartclk = clk_get_rate(sport->clk_per);
/* For register access, we only need to enable the ipg clock. */