From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 8 Dec 2007 18:03:31 +0100 Subject: [U-Boot-Users] [PATCH] IXP: Add full baud-rate support for ixp42x, ixp45x and ixp46x In-Reply-To: <20071208165809.86A72242FA@gemini.denx.de> References: <1197128128-13438-1-git-send-email-plagnioj@jcrosoft.com> <20071208165809.86A72242FA@gemini.denx.de> Message-ID: <20071208170331.GB5332@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 17:58 Sat 08 Dec , Wolfgang Denk wrote: > In message <1197128128-13438-1-git-send-email-plagnioj@jcrosoft.com> you wrote: > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > > > > diff --git a/cpu/ixp/serial.c b/cpu/ixp/serial.c > > index 2015958..1f13077 100644 > > --- a/cpu/ixp/serial.c > > +++ b/cpu/ixp/serial.c > > @@ -31,25 +31,22 @@ > > #include > > #include > > > > +/* > > + * 14.7456 MHz > > + * Baud Rate = -------------- > > + * 16 x Divisor > > + */ > > +#define SERIAL_CLOCK 921600 > > + > > DECLARE_GLOBAL_DATA_PTR; > > > > void serial_setbrg (void) > > { > > unsigned int quot = 0; > > int uart = CFG_IXP425_CONSOLE; > > - > > - if (gd->baudrate == 1200) > > - quot = 192; > > - else if (gd->baudrate == 9600) > > - quot = 96; > > - else if (gd->baudrate == 19200) > > - quot = 48; > > - else if (gd->baudrate == 38400) > > - quot = 24; > > - else if (gd->baudrate == 57600) > > - quot = 16; > > - else if (gd->baudrate == 115200) > > - quot = 8; > > + > > + if(gd->baudrate < SERIAL_CLOCK && SERIAL_CLOCK % gd->baudrate == 0) there is a missing '=' if(gd->baudrate <= SERIAL_CLOCK && SERIAL_CLOCK % gd->baudrate == 0) > > + quot = SERIAL_CLOCK / gd->baudrate; > > Is it correct to assume that the old "quot" for 1200 bps was actually > wrong, and you now fix this? Yes you're right, according to the cpu datasheet the quot for 1200 must be 768 and not 192 Best Regards, J.