From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH/review] Blackfin: make baud calculation more accurate
Date: Sun, 20 Apr 2008 08:36:46 +0200 [thread overview]
Message-ID: <20080420063646.C4BD7248C6@gemini.denx.de> (raw)
In-Reply-To: Your message of "Wed, 09 Apr 2008 02:06:21 EDT." <1207721182-29697-1-git-send-email-vapier@gentoo.org>
In message <1207721182-29697-1-git-send-email-vapier@gentoo.org> you wrote:
> We should use the algorithm in the Linux kernel so that the UART divisor
> calculation is more accurate. It also fixes problems on some picky UARTs
> that have sampling anomalies.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> cpu/blackfin/serial.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/cpu/blackfin/serial.h b/cpu/blackfin/serial.h
> index 1f0f4b4..d268da5 100644
> --- a/cpu/blackfin/serial.h
> +++ b/cpu/blackfin/serial.h
> @@ -179,7 +179,7 @@ static inline void serial_early_set_baud(uint32_t baud)
> * The +1 is to make sure we over sample just a little
^^^^^^^^^^^^^^^^^^^
Fix!
> * rather than under sample the incoming signals.
> */
> - uint16_t divisor = (get_sclk() / (baud * 16)) + 1;
> + uint16_t divisor = (get_sclk() + (baud * 8)) / (baud * 16);
Please make sure to adjust the comment, as there is no "+1" any more
in the new code.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I am pleased to see that we have differences. May we together become
greater than the sum of both of us.
-- Surak of Vulcan, "The Savage Curtain", stardate 5906.4
prev parent reply other threads:[~2008-04-20 6:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 6:06 [U-Boot-Users] [PATCH/review] Blackfin: make baud calculation more accurate Mike Frysinger
2008-04-09 6:06 ` [U-Boot-Users] [PATCH/review] Blackfin: fix up UART status bit handling Mike Frysinger
2008-04-20 6:36 ` Wolfgang Denk
2008-04-20 7:08 ` Mike Frysinger
2008-04-20 6:36 ` Wolfgang Denk [this message]
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=20080420063646.C4BD7248C6@gemini.denx.de \
--to=wd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.