[U-Boot-Users] [PATCH 5/7 v6] serial: add S3C64XX serial driver

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sat Aug 9 11:13:23 CEST 2008


> +	u32 reg;
> +	u32 pclk_ratio = get_PCLK() / gd->baudrate;
> +	int i;
> +
IMHO it's still obscur
> +	/* PCLK / (16 * baudrate) - 1 */
> +	reg = pclk_ratio / 16 - 1;
> +	/* i = pclk_ratio % 16 */
> +	i = pclk_ratio - (reg + 1) * 16;
> +
> +	uart->UBRDIV = reg;
> +	uart->UDIVSLOT = udivslot[i];
> +
> +	for (i = 0; i < 100; i++)
> +		barrier();
> +}

Best Regards,
J.




More information about the U-Boot mailing list