From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KxQc7-0008Ek-Jm for mharc-grub-devel@gnu.org; Tue, 04 Nov 2008 13:26:51 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxQc6-0008E7-7P for grub-devel@gnu.org; Tue, 04 Nov 2008 13:26:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxQc4-0008DX-JA for grub-devel@gnu.org; Tue, 04 Nov 2008 13:26:49 -0500 Received: from [199.232.76.173] (port=39808 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxQc4-0008DS-Ff for grub-devel@gnu.org; Tue, 04 Nov 2008 13:26:48 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:40312 helo=jenni1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KxQc4-000466-4w for grub-devel@gnu.org; Tue, 04 Nov 2008 13:26:48 -0500 Received: from [127.0.0.1] (84.248.105.254) by jenni1.inet.fi (8.5.014) id 48FC59C700CCB617 for grub-devel@gnu.org; Tue, 4 Nov 2008 20:26:44 +0200 Message-ID: <491093E4.1000906@nic.fi> Date: Tue, 04 Nov 2008 20:26:44 +0200 From: =?ISO-8859-1?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: The development of GRUB 2 References: <200811040038.mA40c2ew022770@los-vmm.sc.intel.com> <20081104153950.GB8894@thorin> In-Reply-To: <20081104153950.GB8894@thorin> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] PCI serial card support X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 18:26:50 -0000 Robert Millan wrote: > On Mon, Nov 03, 2008 at 04:38:02PM -0800, donald.d.dugger@intel.com 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.