[Patch] mpc5200b: improve baud rate calculation (reach high baud rates, better accuracy)
Grant Likely
grant.likely at secretlab.ca
Wed Mar 3 07:12:24 EST 2010
On Tue, Mar 2, 2010 at 1:56 AM, Albrecht Dreß <albrecht.dress at arcor.de> wrote:
> 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 round
>> > (divisor / 8) to use the /32 prescaler. Think of a 19-bit counter value,
>> > where I can choose to use either the lower or the higher 16 bits for the
>> > counter reg.
>>
>> Okay, now I got it. (Maybe this is an indication for another comment above
>> 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 benefit from the detection of the '5200B. Basically, *all* files have to be checked and touched if necessary. Again, I agree that this would be the clean approach, but I wanted to avoid that effort. Grant???
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 (probe
>> has
>> access to the compatible-property it was matched against, see its
>> arguments).
>> So it should be a matter of:
>>
>> if (matched_property == 5200b)
>> ops->func = this_one;
>> else
>> ops->func = that_one;
>
> Umm, yes, that's true of course. Will 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.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the Linuxppc-dev
mailing list