Re: serial:support: Using 8250 driver With MOXA CP-132EL Device

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

 



Dear all,

My previous email might got lost in some inbox. Allow me to retry to ping you to
get some help in configuring the MOXA CP-132EL using the 8250 driver.

On Mon, Jan 22, 2024 at 11:52:15AM +0100, Federico Vaga wrote:
Dear all,

I'm having problems in trying to use the MOXA CP-132EL card with the 8250 driver
on the stable kernel 5.10.192 (but I also tried the 6.1.70). It seems not to
work. As a note, to do my tests, I have a loop cable connecting the two on-board
serial ports.

I see this device should be supported by the 8250 code, in particular this
appears in 8250_pci.c

```
$ git grep 132EL drivers/tty/
drivers/tty/serial/8250/8250_pci.c:#define PCI_DEVICE_ID_MOXA_CP132EL   0x1322
drivers/tty/serial/8250/8250_pci.c:     { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132EL),    pbn_moxa_2 },
```

At boot time the device is correctly discovered, and it matches the driver.
Indeed two new tty interfaces appear under `/dev`

```
$ dmesg | grep 0d:00.0
[    0.196175] pci 0000:0d:00.0: [1393:1322] type 00 class 0x070002
[    0.196350] pci 0000:0d:00.0: reg 0x10: [io  0x4000-0x403f]
[    0.196448] pci 0000:0d:00.0: reg 0x14: [mem 0xb0100000-0xb0100fff]
[    0.196534] pci 0000:0d:00.0: reg 0x18: [io  0x4040-0x404f]
[    0.197474] pci 0000:0d:00.0: supports D1 D2
[    0.197475] pci 0000:0d:00.0: PME# supported from D3hot
[    0.371301] 0000:0d:00.0: ttyS2 at MMIO 0xb0100000 (irq = 16, base_baud = 921600) is a ST16650
[    0.371832] 0000:0d:00.0: ttyS3 at MMIO 0xb0100200 (irq = 16, base_baud = 921600) is a ST16650

```

The communication seems not to work. However, the communication works when using
the driver provided by MOXA (``mxupcie.ko``).

The interesting thing is the following. Binding back the device to the 8250
serial driver after having loaded first the mxupcie makes it work. Translated
into a procedure:

1. load 8250 serial driver
2. make a test (FAIL)
3. unbind device from 8250
4. load mxupcie driver
5. unbind device from mxupcie
6. bind device to 8250
7. make a test (SUCCESS)

This made me think of two possible cases:

1. mxupcie applies a default serial configuration that works out-of-the-box
2. mxupcie perform a hardware configuration that the 8250 is not doing


About option (1) I used ``stty -g`` to compare configurations right after
binding. But it seems exactly the same when using 8250 or mxupcie from MOXA.


``` Using 8250
# stty -F /dev/ttyS3 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
# stty -F /dev/ttyS2 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
```

``` Using mxupcie
# stty -F /dev/ttyMUE0 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
# stty -F /dev/ttyMUE1 -g
500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
```

This makes me think that probably option (2) represents the problem, but due to
my limited knowledge with these two drivers (8250, mxupcie) and the device
(CP-132EL) I can not spot the problem in the code.

Therefore, I'm asking you: are you aware of such a problem with this card or
others from MOXA? Is there someone in the community who is using the 8250 driver
with MOXA devices?

Thank you.

--
Federico Vaga - CERN

--
Federico Vaga - CERN BE-CEM-EDL




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux