[U-Boot-Users] at91rm9200 serial frequency fix 2

Håvard Skinnemoen hskinnemoen at gmail.com
Sun Aug 19 23:31:57 CEST 2007


On 8/19/07, michael trimarchi <trimarchi at gandalf.sssup.it> wrote:

> +#define BAUDRATE(mck, baud) \
> +       ((((mck) * 10) % ((baud) * 16)) >= 5) ? \
> +       (mck / (baud * 16) + 1) : ((mck) / (baud * 16))

That's an awfully complicated way of doing

(mck + baud * 8) / (baud * 16)

isn't it? Or are you trying to do something different than rounding
(mck / (16 *baud)) to the nearest integer?

Btw, we should really consider consolidating the at91 and avr32 serial
drivers -- the hardware is mostly the same. It probably needs a few
tweaks to the at91 headers and/or the driver itself though. Anyone
with at91 experience that can tell me if it might be possible to use
drivers/atmel_usart.c on AT91 and what changes are necessary to get it
to work?

Haavard




More information about the U-Boot mailing list