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

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

 



Ccing Crescent.

On 22. 02. 24, 23:34, andy.shevchenko@xxxxxxxxx wrote:
Fri, Feb 23, 2024 at 12:29:26AM +0200, andy.shevchenko@xxxxxxxxx kirjoitti:
Thu, Feb 22, 2024 at 10:21:38AM +0100, Federico Vaga kirjoitti:
On Mon, Jan 22, 2024 at 11:52:15AM +0100, Federico Vaga wrote:

...

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``).

Shouldn't we use mxser in the kernel for MOXA?

         { PCI_DEVICE_DATA(MOXA, CP132,          2) },

Ah, letters matter, we have only these there

#define PCI_DEVICE_ID_MOXA_CP132        0x1320
#define PCI_DEVICE_ID_MOXA_CP132U       0x1321

But maybe it should also support 0x1322? Dunno, I believe Jiri knows better.

No, it's a different kind of devices. There are moxa and mxser drivers for specific devices and then 8250-akin moxa devices handled by 8250 (like this one).

The support seems to be incomplete though. 132EL seems to be a 422/485-only device, but 8250 doesn't care.

Does it magically start working if you set 422/485 manually via TIOCSRS485? But I doubt SER_RS485_ENABLED is set anywhere...

Crescent how are these 422/485 devices supposed to work?

Oh wait, you may need:
commit 43f012df3c1e979966524f79b5371fde6545488a
Author: Crescent CY Hsieh <crescentcy.hsieh@xxxxxxxx>
Date:   Thu Dec 14 14:02:34 2023 +0800

tty: serial: 8250: Set RS422 interface by default to fix Moxa RS422/RS485 PCIe boards



which landed only to 6.7.4. Care to try that out?

thanks,
--
js
suse labs





[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