Problems with serial_cs and kernel 2.6 - works now

Mathias Adam a2 at adamis.de
Sat Mar 5 01:30:25 EST 2005


Hi Russell,

sorry to bother you again, but as you wrote you were also working on 
this problem before I suppose you might be interested...

Russell King wrote:
> On Tue, Mar 01, 2005 at 09:15:37PM +0100, Mathias Adam wrote:
>>I'm trying to install a Socket Bluetooth Compactflash Card (Revision H)
>>in my Thinkpad X21. This card has a UART-like interface (should be a 
>>16C950) and so I need to use the serial_cs module before BlueZ can 
>>access it (over the serial module).
> 
> 
> It's probably something to do with the upper levels of the serial code.

I just got it working by doing a little change in 8250.c so you're right :-)

>>From what I remember, the 950 devices have a non-standard crystal
> connected to them, but they compensate for that by adjusting some of
> the internal divisors.
> 
> Unfortunately, when 8250 opens the port, it resets the 950 device,
> which undoes this compensation.

Hmmm, I'm not sure about that... the BlueZ driver requests a baud rate 
of 230400 which is uartclk/8 (serial_cs sets uartclk=1843200). However 
serial8250_set_termios() refuses to program a baud rate larger than 
uartclk/16 which should be ok for most UARTs. I looked into the 2.4 
driver and found some code that changes the internal prescaler to values 
between 1:16 and 1:4 to support baud rates up to uartclk/4 respectively 
(this is done for 16C950 UARTs only). The datasheet of oxford's oxcf950 
chip confirms this feature.

For a quick test I removed the maximum check in serial8250_set_termios() 
and put in the code from 2.4 which programs the C950 prescaler and it 
works now.

What do you think?

If you're interested I'll clean up the patch and make it available to 
you; for now I think it doesn't have any negative side effects...

> Now, I did have such a card on loan from someone, but the fixes never
> got merged before the card was returned.  Since then, the bluetooth
> seconds of this card have failed.  However, it may still be useful for
> checking out this problem, and despite promises to send it to me, it
> hasn't arrived to date.

I'm not sure whether I understand that right: did you already have a 
working fix? Or was that for the 2.4 kernels?


Regards

Mathias



More information about the linux-pcmcia mailing list