public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] IXP: Add full baud-rate support for ixp42x, ixp45x and ixp46x
Date: Sat, 8 Dec 2007 17:13:23 +0100	[thread overview]
Message-ID: <200712081713.23822.sr@denx.de> (raw)
In-Reply-To: <1197128128-13438-1-git-send-email-plagnioj@jcrosoft.com>

On Saturday 08 December 2007, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>
> 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 <common.h>
>  #include <asm/arch/ixp425.h>
>
> +/*
> + *               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)

Space after "if" please. And some braces would make this line more readable.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2007-12-08 16:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-10 15:47 [U-Boot-Users] PATCH: ixp42x UART: support 230400bps, enable RTS Michael Schwingen
2007-12-08 15:32 ` Jean-Christophe PLAGNIOL-VILLARD
2007-12-08 15:35   ` [U-Boot-Users] [PATCH] IXP: Add full baud-rate support for ixp42x, ixp45x and ixp46x Jean-Christophe PLAGNIOL-VILLARD
2007-12-08 16:13     ` Stefan Roese [this message]
2007-12-08 16:58     ` Wolfgang Denk
2007-12-08 17:03       ` Jean-Christophe PLAGNIOL-VILLARD
2007-12-08 22:37   ` [U-Boot-Users] PATCH: ixp42x UART: support 230400bps, enable RTS Michael Schwingen
2007-12-09  8:40     ` Jean-Christophe PLAGNIOL-VILLARD
2007-12-09 15:58       ` Michael Schwingen
2007-12-09 17:00   ` Michael Schwingen
2008-01-10 10:56     ` Jean-Christophe PLAGNIOL-VILLARD
2008-01-10 21:59       ` Michael Schwingen
2008-01-11  0:25         ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200712081713.23822.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox