grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] PCI serial card support


From: Vesa Jääskeläinen
Subject: Re: [PATCH] PCI serial card support
Date: Tue, 04 Nov 2008 20:26:44 +0200
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Robert Millan wrote:
> On Mon, Nov 03, 2008 at 04:38:02PM -0800, address@hidden wrote:
>> The problem with using a PCI serial card for the console is that many
>> PCI cards use a different crystal than the IBM PC standard.  This means
>> that serial drivers wind up computing the wrong divisor when trying to
>> set the baud rate.  This patch solves this problem by adding the `--base'
>> parameter to the `serial' command.  The allows you to set the base baud
>> (typically the highest baud rate supported by the device) so that PCI
>> cards with non-standard crystal frequencies can be supported.  For example,
>> the option I use with my PCI serial card is:
>>
>>      serial --port=0xe880 --speed=115200 --base=921600
> 
> Is there no better way to do this than queriing the user?  Can you read this
> info from the device itself, or from its PCI id?

There are some serial boards where you have to give N * IO base
addresses in order to support all N COMs. Actually there are even more
complex cards than this one. Some supporting much higher than 921600 as
maximum speed. Some needing even different kinds of formulas in order to
get proper baud rates... But I think this should be good short term
solution. More complex cards can have their own driver then.

Thou "base" could be something different. As this is advanced feature it
could be something more descriptive and harder to type... in example
divbase, or maxbaud... Of course if we can detect some cards
automatically we can store some table for those. For detection of PCI
cases we could use PCI ID's.

> +  return ((base << 4) + (speed << 3)) / (speed << 4);

Interesting formula. However. Whats the big gain against base/speed ?
Perhaps I am missing something? This formula just gives +0.5 (rounding?)
for resulting value which is then rounded down with integer maths.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]