All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: CHABAL David <david.chabal@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] 16550A driver and Moxa card / solved
Date: Fri, 11 May 2007 12:36:53 +0200	[thread overview]
Message-ID: <46444745.3070902@domain.hid> (raw)
In-Reply-To: <0pu1igVN.1178881055.0249710.dchabal@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]

CHABAL David wrote:
> Le 11/5/2007, "Jan Kiszka" <jan.kiszka@domain.hid> a écrit:
> 
>> Maksym Veremeyenko wrote:
>>> CHABAL David пишет:
>>>
>>>> I met some trouble with the 16550A driver provided in Xenomai 2.3.1
>>>> and my Moxa cards (PCI / 8 * RS232 / 168U ).
>>>>
>>>> It was a problem of baudrate computation before setting the LCR_DLAB
>>>> register.
>>>>
>>>> The formula implemented by the Xenomai driver is different from the one
>>>> provided by Moxa. So I copy/paste the formula from the mxser.c file
>>>> (present in the
>>>> kernel distro), and it seems to work fine.
>>>>
>>>> I think it's Moxa card dependant, may be caused by the high default baud
>>>> rate of this card.
>>> I have two Moxa boards with no problem, possible you need to specify 
>>> 'baud_base' param.
>>>
>>> I my case :
>>>
>>> # 8 ports board:
>>> /sbin/modprobe xeno_16550A \
>>> ioaddr=0x1000,0x1008,0x1010,0x1018,0x1020,0x1028,0x1030,0x1038 \
>>> irq=9,9,9,9,9,9,9,9 \
>>> baud_base=921600,921600,921600,921600,921600,921600,921600,921600
>>>
>>> # 2 ports board + onboards:
>>> /sbin/modprobe xeno_16550A ioaddr=0x3f8,0x2f8,0xdf00,0xdf08 
>>> irq=4,3,11,11 baud_base=115200,115200,921600,921600
>>>
>> Interesting. That would leave us just with the generic fix to catch
>> baud_rate==0. Far more attractive. :)
>>
>> David, can you confirm this? Weren't you just aware of the baud_base
>> parameter?
> 
> I'm not totally convinced because if I compute by hand the DLAB register
> with the 19200 value (my config):
> 
> With the moxa driver:
>   baud_div = 912.600 / 19.200 = 47
> 
> With the Xeno driver:
>   baud_div = (912.600 - 9600) / 19.200 = 47
> 
> Grrr, it's ok here because the rounded values are the same because the
> baud base is biggest than the speed requested, but I think a problem can
> occur with 115200 or more, example:
> 
> moxa: 912.600/115.200 = 8
> xeno: = 7

Yeah, hard arguments. This really cries for a moxa tweak. (The
alternative would be to pass an artificially increased baud_base - but
that would be _really_ ugly and we could also ask the user for the
divider directly...)

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  parent reply	other threads:[~2007-05-11 10:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-11  9:31 [Xenomai-core] 16550A driver and Moxa card / solved CHABAL David
2007-05-11  9:08 ` Jan Kiszka
2007-05-11  9:12 ` Maksym Veremeyenko
2007-05-11  9:17   ` Jan Kiszka
2007-05-11 10:57     ` CHABAL David
2007-05-11 10:28       ` Maksym Veremeyenko
2007-05-11 10:36       ` Jan Kiszka [this message]
2007-05-11 11:25         ` Jan Kiszka
2007-05-11 12:33           ` CHABAL David
2007-05-11 11:46         ` Maksym Veremeyenko
2007-05-11 12:11           ` Jan Kiszka
2007-05-11 14:11             ` CHABAL David
2007-05-11 13:25               ` Jan Kiszka
2007-05-11 13:35                 ` Maksym Veremeyenko
2007-05-11 14:33                 ` CHABAL David
2007-05-11 13:54                   ` Jan Kiszka
2007-05-11 13:58                   ` Maksym Veremeyenko
2007-05-11 15:33                     ` CHABAL David
2007-05-11 15:45                       ` Jan Kiszka
2007-05-11 13:29               ` Maksym Veremeyenko

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=46444745.3070902@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=david.chabal@domain.hid \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.