/* Baudrate algorithm come from Linux/drivers/tty/serial/ar933x_uart.c baudrate = (clk / (scale + 1)) * (step * (1 / 2^17))  */
static u32 ar933x_serial_get_baud(u32 clk, u32 scale, u32 step)
/* Baudrate algorithm come from Linux/drivers/tty/serial/ar933x_uart.c baudrate = (clk / (scale + 1)) * (step * (1 / 2^17))  */
static u32 ar933x_serial_get_baud(u32 clk, u32 scale, u32 step)
{
	u64 t;
	u32 div;
	div = (2 << 16) * (scale + 1);
	t = clk;
	t *= step;
	t += (div / 2);
	do_div(t, div);
	return t;
}