From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 5/7 v3] serial: add s3c64xx serial driver
Date: Tue, 05 Aug 2008 00:52:17 +0200 [thread overview]
Message-ID: <20080804225217.49F6524848@gemini.denx.de> (raw)
In-Reply-To: Your message of "Tue, 05 Aug 2008 00:08:47 +0200." <Pine.LNX.4.64.0808050004180.10557@axis700.grange>
In message <Pine.LNX.4.64.0808050004180.10557@axis700.grange> you wrote:
>
> > > +/* See table in 31.6.11 */
> > > +static const int udivslot[] = {
> > > + 0,
> > > + 0x0080,
> > > + 0x0808,
> > > + 0x0888,
> > > + 0x2222,
> > > + 0x4924,
> > > + 0x4a52,
> > > + 0x54aa,
> > > + 0x5555,
> > > + 0xd555,
> > > + 0xd5d5,
> > > + 0xddd5,
> > > + 0xdddd,
> > > + 0xdfdd,
> > > + 0xdfdf,
> > > + 0xffdf,
> > > +};
> > Can we have something more readable?
>
> No. This are "recommended values" as mentioned in the comment to the table
> referenced above.
Bout perhaps you could add some documentation what all these magic
numbers mean? Of course we can all download the documetnation, study
it for hours and finally uinderstand this, too - but it would be
nicer if you could save us this effort.
> > > + u32 reg, pclk_ratio = get_PCLK() / gd->baudrate;
> > why not
> > u32 reg;
> > u32 pclk_ratio = get_PCLK() / gd->baudrate;
>
> There is more than one way to do it.
Indeed. But the one that is better readable is preferred.
> > > + /* PCLK / (16 * baudrate) - 1 */
> > > + reg = pclk_ratio / 16 - 1;
> > > + i = pclk_ratio - (reg + 1) * 16;
> > =>
> > i = pclk_ratio - (pclk_ratio / 16 - 1 + 1) * 16;
> > =>
> > i = pclk_ratio - (pclk_ratio / 16 ) * 16;
> > =>
> > i = pclk_ratio - pclk_ratio;
> > =>
> > i = 0;
>
> Please, think again. This is integer arithmetics, not analysis.
So perhaps you want to elucidate your code in a comment?
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
grep me no patterns and I'll tell you no lines.
next prev parent reply other threads:[~2008-08-04 22:52 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-31 10:54 [U-Boot-Users] [PATCH 6/7] NAND: add NAND driver for s3c64xx Guennadi Liakhovetski
2008-07-31 14:24 ` Wolfgang Denk
2008-08-01 11:02 ` Guennadi Liakhovetski
2008-08-01 12:28 ` Wolfgang Denk
2008-08-01 13:30 ` [U-Boot-Users] several messages Guennadi Liakhovetski
2008-08-04 10:42 ` [U-Boot-Users] [PATCH 0/7 v2] SMDK6400 support Guennadi Liakhovetski
2008-08-04 10:42 ` [U-Boot-Users] [PATCH 1/7 v2] Add definition for the AM29LV800BB AMD NOR-flash Guennadi Liakhovetski
2008-08-04 10:42 ` [U-Boot-Users] [PATCH 2/7 v2] NAND_CMD_READOOB is not supported by all chips, read OOB with the page instead Guennadi Liakhovetski
2008-08-04 10:43 ` [U-Boot-Users] [PATCH 3/7 v2] ARM: Add arm1176 core with s3c6400 SoC Guennadi Liakhovetski
2008-08-04 10:43 ` [U-Boot-Users] [PATCH 4/7 v2] USB: Add support for OHCI controller on s3c6400 Guennadi Liakhovetski
2008-08-04 10:43 ` [U-Boot-Users] [PATCH 5/7 v2] serial: add s3c64xx serial driver Guennadi Liakhovetski
2008-08-04 10:43 ` [U-Boot-Users] [PATCH 6/7 v2] NAND: add NAND driver for s3c64xx Guennadi Liakhovetski
2008-08-04 10:43 ` [U-Boot-Users] [PATCH 7/7 v2] ARM: Add support for S3C6400 based SMDK6400 board Guennadi Liakhovetski
2008-08-04 11:00 ` [U-Boot-Users] [PATCH 0/7 v2] SMDK6400 support Wolfgang Denk
2008-08-04 12:44 ` [U-Boot-Users] [PATCH 0/7 v3] " Guennadi Liakhovetski
2008-08-04 12:44 ` [U-Boot-Users] [PATCH 1/7 v3] Add definition for the AM29LV800BB AMD NOR-flash Guennadi Liakhovetski
2008-08-04 12:45 ` [U-Boot-Users] [PATCH 2/7 v3] NAND_CMD_READOOB is not supported by all chips, read OOB with the page instead Guennadi Liakhovetski
2008-08-04 22:28 ` Scott Wood
2008-08-05 13:08 ` Guennadi Liakhovetski
2008-08-05 15:01 ` Scott Wood
2008-08-05 15:25 ` Guennadi Liakhovetski
2008-08-05 15:37 ` Scott Wood
2008-08-04 12:45 ` [U-Boot-Users] [PATCH 3/7 v3] ARM: Add arm1176 core with s3c6400 SoC Guennadi Liakhovetski
2008-08-04 20:06 ` [U-Boot-Users] [PATCH 3/7 v4] " Guennadi Liakhovetski
2008-08-04 12:45 ` [U-Boot-Users] [PATCH 4/7 v3] USB: Add support for OHCI controller on s3c6400 Guennadi Liakhovetski
2008-08-04 21:08 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-04 22:04 ` Guennadi Liakhovetski
2008-08-04 12:45 ` [U-Boot-Users] [PATCH 5/7 v3] serial: add s3c64xx serial driver Guennadi Liakhovetski
2008-08-04 21:19 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-04 22:08 ` Guennadi Liakhovetski
2008-08-04 22:52 ` Wolfgang Denk [this message]
2008-08-04 12:46 ` [U-Boot-Users] [PATCH 6/7 v3] NAND: add NAND driver for s3c64xx Guennadi Liakhovetski
2008-08-04 22:38 ` Scott Wood
2008-08-04 12:46 ` [U-Boot-Users] [PATCH 7/7 v3] ARM: Add support for S3C6400 based SMDK6400 board Guennadi Liakhovetski
2008-08-04 20:10 ` Guennadi Liakhovetski
2008-07-31 19:55 ` [U-Boot-Users] [PATCH 6/7] NAND: add NAND driver for s3c64xx 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=20080804225217.49F6524848@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox