如何在 Linux 上使用双串口 PCI 卡在两个端口上进行通话?

如何在 Linux 上使用双串口 PCI 卡在两个端口上进行通话?

我正在使用 MosChip MCS9865。它有两个串行端口,我弄清楚了如何使用sudo setserial /dev/ttyS0 uart 16550A命令通过其中一个串行端口进行通信。这在一个串行端口上工作得很好,但现在我需要通过另一个串行端口进行通信。出于某种原因,我在互联网上找不到有关如何执行此操作的信息。有人可以指导我正确的方向吗?谢谢。

添加 1 也许我需要说得更清楚一些。我使用的是与下面显示的类似或完全相同的双串行 PC 卡。我能够在端口 A 上成功通信,现在我试图从端口 A 切换到端口 B 以测试端口 B 上的通信。我似乎做不到这一点。至于消息去吧,终端上列出的内容有 10 页那么长,所以我只打算发布有关 PCI 的部分。请看下方图片。谢谢。

在此处输入图片描述

dmesg 消息:

[    0.228251] PCI host bridge to bus 0000:00
[    0.228253] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.228254] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.228255] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.228256] pci_bus 0000:00: root bus resource [mem 0x000d0000-0x000d3fff window]
[    0.228256] pci_bus 0000:00: root bus resource [mem 0x000d4000-0x000d7fff window]
[    0.228257] pci_bus 0000:00: root bus resource [mem 0x000d8000-0x000dbfff window]
[    0.228258] pci_bus 0000:00: root bus resource [mem 0x000dc000-0x000dffff window]
[    0.228259] pci_bus 0000:00: root bus resource [mem 0x000e0000-0x000e3fff window]
[    0.228260] pci_bus 0000:00: root bus resource [mem 0x000e4000-0x000e7fff window]
[    0.228261] pci_bus 0000:00: root bus resource [mem 0xde200000-0xfeafffff window]
[    0.228262] pci_bus 0000:00: root bus resource [bus 00-3e]
[    0.228266] pci 0000:00:00.0: [8086:0c00] type 00 class 0x060000
[    0.228317] pci 0000:00:01.0: [8086:0c01] type 01 class 0x060400
[    0.228339] pci 0000:00:01.0: PME# supported from D0 D3hot D3cold
[    0.228386] pci 0000:00:01.0: System wakeup disabled by ACPI
[    0.228409] pci 0000:00:02.0: [8086:041e] type 00 class 0x030000
[    0.228418] pci 0000:00:02.0: reg 0x10: [mem 0xf7400000-0xf77fffff 64bit]
[    0.228422] pci 0000:00:02.0: reg 0x18: [mem 0xe0000000-0xefffffff 64bit pref]
[    0.228424] pci 0000:00:02.0: reg 0x20: [io  0xf000-0xf03f]
[    0.228467] pci 0000:00:03.0: [8086:0c0c] type 00 class 0x040300
[    0.228475] pci 0000:00:03.0: reg 0x10: [mem 0xf7d14000-0xf7d17fff 64bit]
[    0.228538] pci 0000:00:14.0: [8086:8c31] type 00 class 0x0c0330
[    0.228558] pci 0000:00:14.0: reg 0x10: [mem 0xf7d00000-0xf7d0ffff 64bit]
[    0.228599] pci 0000:00:14.0: PME# supported from D3hot D3cold
[    0.228620] pci 0000:00:14.0: System wakeup disabled by ACPI
[    0.228640] pci 0000:00:16.0: [8086:8c3a] type 00 class 0x078000
[    0.228661] pci 0000:00:16.0: reg 0x10: [mem 0xf7d1f000-0xf7d1f00f 64bit]
[    0.228705] pci 0000:00:16.0: PME# supported from D0 D3hot D3cold
[    0.228750] pci 0000:00:1a.0: [8086:8c2d] type 00 class 0x0c0320
[    0.228773] pci 0000:00:1a.0: reg 0x10: [mem 0xf7d1c000-0xf7d1c3ff]
[    0.228833] pci 0000:00:1a.0: PME# supported from D0 D3hot D3cold
[    0.228865] pci 0000:00:1a.0: System wakeup disabled by ACPI
[    0.228887] pci 0000:00:1b.0: [8086:8c20] type 00 class 0x040300
[    0.228907] pci 0000:00:1b.0: reg 0x10: [mem 0xf7d10000-0xf7d13fff 64bit]
[    0.228954] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
[    0.228979] pci 0000:00:1b.0: System wakeup disabled by ACPI
[    0.228998] pci 0000:00:1c.0: [8086:8c10] type 01 class 0x060400
[    0.229049] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[    0.229090] pci 0000:00:1c.0: System wakeup disabled by ACPI
[    0.229111] pci 0000:00:1c.2: [8086:8c14] type 01 class 0x060400
[    0.229162] pci 0000:00:1c.2: PME# supported from D0 D3hot D3cold
[    0.229201] pci 0000:00:1c.2: System wakeup disabled by ACPI
[    0.229227] pci 0000:00:1d.0: [8086:8c26] type 00 class 0x0c0320
[    0.229250] pci 0000:00:1d.0: reg 0x10: [mem 0xf7d1b000-0xf7d1b3ff]
[    0.229309] pci 0000:00:1d.0: PME# supported from D0 D3hot D3cold
[    0.229339] pci 0000:00:1d.0: System wakeup disabled by ACPI
[    0.229361] pci 0000:00:1f.0: [8086:8c50] type 00 class 0x060100
[    0.229481] pci 0000:00:1f.2: [8086:8c02] type 00 class 0x010601
[    0.229498] pci 0000:00:1f.2: reg 0x10: [io  0xf0b0-0xf0b7]
[    0.229503] pci 0000:00:1f.2: reg 0x14: [io  0xf0a0-0xf0a3]
[    0.229509] pci 0000:00:1f.2: reg 0x18: [io  0xf090-0xf097]
[    0.229514] pci 0000:00:1f.2: reg 0x1c: [io  0xf080-0xf083]
[    0.229520] pci 0000:00:1f.2: reg 0x20: [io  0xf060-0xf07f]
[    0.229525] pci 0000:00:1f.2: reg 0x24: [mem 0xf7d1a000-0xf7d1a7ff]
[    0.229545] pci 0000:00:1f.2: PME# supported from D3hot
[    0.229581] pci 0000:00:1f.3: [8086:8c22] type 00 class 0x0c0500
[    0.229594] pci 0000:00:1f.3: reg 0x10: [mem 0xf7d19000-0xf7d190ff 64bit]
[    0.229610] pci 0000:00:1f.3: reg 0x20: [io  0xf040-0xf05f]
[    0.229672] pci 0000:00:01.0: PCI bridge to [bus 01]
[    0.229719] pci 0000:02:00.0: [1415:c158] type 00 class 0x070002
[    0.229753] pci 0000:02:00.0: reg 0x10: [mem 0xf7c00000-0xf7c03fff]
[    0.229764] pci 0000:02:00.0: reg 0x14: [mem 0xf7a00000-0xf7bfffff]
[    0.229774] pci 0000:02:00.0: reg 0x18: [mem 0xf7800000-0xf79fffff]
[    0.229854] pci 0000:02:00.0: supports D1 D2
[    0.229855] pci 0000:02:00.0: PME# supported from D1 D2 D3hot D3cold
[    0.229878] pci 0000:02:00.0: System wakeup disabled by ACPI
[    0.231857] pci 0000:00:1c.0: PCI bridge to [bus 02]
[    0.231861] pci 0000:00:1c.0:   bridge window [mem 0xf7800000-0xf7cfffff]
[    0.231912] pci 0000:03:00.0: [10ec:8168] type 00 class 0x020000
[    0.231947] pci 0000:03:00.0: reg 0x10: [io  0xe000-0xe0ff]
[    0.231972] pci 0000:03:00.0: reg 0x18: [mem 0xf0004000-0xf0004fff 64bit pref]
[    0.231988] pci 0000:03:00.0: reg 0x20: [mem 0xf0000000-0xf0003fff 64bit pref]
[    0.232050] pci 0000:03:00.0: supports D1 D2
[    0.232051] pci 0000:03:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    0.232082] pci 0000:03:00.0: System wakeup disabled by ACPI
[    0.233857] pci 0000:00:1c.2: PCI bridge to [bus 03]
[    0.233860] pci 0000:00:1c.2:   bridge window [io  0xe000-0xefff]
[    0.233865] pci 0000:00:1c.2:   bridge window [mem 0xf0000000-0xf00fffff 64bit pref]
[    0.234319] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
[    0.234346] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
[    0.234372] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 10 11 12 *14 15)
[    0.234398] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 10 11 12 14 *15)
[    0.234424] ACPI: PCI Interrupt Link [LNKE] (IRQs *3 4 5 6 7 10 11 12 14 15)
[    0.234449] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 *10 11 12 14 15)
[    0.234475] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 *7 10 11 12 14 15)
[    0.234503] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 *6 7 10 11 12 14 15)
[    0.234681] ACPI: Enabled 5 GPEs in block 00 to 3F

答案1

增加设备号。对于 COM1,使用 ttyS1而不是 ttyS0:

setserial /dev/ttyS1 uart 16550A

相关内容