linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: "Albrecht Dreß" <albrecht.dress@arcor.de>
Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [Patch] mpc5200b: improve baud rate calculation (reach high baud rates, better accuracy)
Date: Tue, 2 Mar 2010 13:12:24 -0700	[thread overview]
Message-ID: <fa686aa41003021212y7ccc9fcalc1578811e8a7c8f8@mail.gmail.com> (raw)
In-Reply-To: <22132814.1267520208614.JavaMail.ngmail@webmail14.arcor-online.net>

On Tue, Mar 2, 2010 at 1:56 AM, Albrecht Dre=DF <albrecht.dress@arcor.de> w=
rote:
> Hi Wolfram:
>
> [snip]
>> > Yes, but I do all /calculations/ with the /4 prescaler for higher
>> accuracy.
>> > If the divisor exceeds the available 16 bits of the counter reg, I rou=
nd
>> > (divisor / 8) to use the /32 prescaler. =A0Think of a 19-bit counter v=
alue,
>> > where I can choose to use either the lower or the higher 16 bits for t=
he
>> > counter reg.
>>
>> Okay, now I got it. (Maybe this is an indication for another comment abo=
ve
>> the
>> set divisor function?)
>
> O.k., I will add that comment...
>

Yes, please document your calculation approach thoroughly.

>> > > This should be handled using a new compatible-entry
>> > > "fsl,mpc5200b-psc-uart".
>> >
>>
>> > I agree that this would be a lot cleaner, but it's also a lot more
>> intrusive.
>> > CC'ing the device tree discussion list here... comments, please!!
>>
>> Why intrusive? Maybe I miss something?
>
> Not for the source file, but for all the dts files, if they want to benef=
it from the detection of the '5200B. =A0Basically, *all* files have to be c=
hecked and touched if necessary. =A0Again, I agree that this would be the c=
lean approach, but I wanted to avoid that effort. =A0Grant???

Already there on mainlined .dts files, and it won't break boards that
don't have it.

> [snip]
>> Leave those two function pointers empty and fill them during probe (prob=
e
>> has
>> access to the compatible-property it was matched against, see its
>> arguments).
>> So it should be a matter of:
>>
>> if (matched_property =3D=3D 5200b)
>> =A0 =A0 =A0 ops->func =3D this_one;
>> else
>> =A0 =A0 =A0 ops->func =3D that_one;
>
> Umm, yes, that's true of course. =A0Will pick it up.

When it comes to code clarity, I'd prefer you had separate mpc5200 and
mpc5200b ops structures.  I'm not worried about an extra 64 bytes
added to the kernel size for this (minus the # of bytes needed to test
and set the new op).

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2010-03-02 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02  8:09 [Patch] mpc5200b: improve baud rate calculation (reach high baud rates, better accuracy) Albrecht Dreß
2010-03-02  8:28 ` Wolfram Sang
2010-03-02  8:56 ` Albrecht Dreß
2010-03-02 15:27   ` Wolfram Sang
2010-03-02 20:12   ` Grant Likely [this message]
2010-03-02 20:06 ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2010-03-01 18:11 Albrecht Dreß
2010-03-02  0:32 ` Wolfram Sang
2010-03-02 20:22 ` Grant Likely

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=fa686aa41003021212y7ccc9fcalc1578811e8a7c8f8@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=albrecht.dress@arcor.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).