From: Michael Trimarchi Date: Sun, 19 Aug 2007 19:42:02 +0200 Subject: [U-Boot-Users] at91rm9200 serial frequency fix In-Reply-To: <20070819163547.GA21765@gandalf.sssup.it> References: <20070819163547.GA21765@gandalf.sssup.it> Message-ID: <46C880EA.50303@gandalf.sssup.it> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > > +#define BAUDRATE(mck, baud) \ > + ((((mck) * 10) % ((baud) * 16)) >= 5) ? \ > + (mck / (baud * 16) + 1) : ((mck) / (baud * 16)) > + > void serial_setbrg (void) > { > int baudrate; > > if ((baudrate = gd->baudrate) <= 0) > baudrate = CONFIG_BAUDRATE; > - /* MASTER_CLOCK/(16 * baudrate) */ > - us->US_BRGR = (AT91C_MASTER_CLOCK >> 4) / (unsigned)baudrate; > + > + us->US_BRGR = BOUDRATE(AT91C_MASTER_CLOCK, (unsigned)baudrate); > } > > int serial_init (void) > > Excuse me I take the wrong diff file, containg and error on macro name. I will send the right one soon. Regards Michael