Skip to content

Commit 072ce48

Browse files
mwallegregkh
authored andcommitted
tty: serial: 8250: Add SystemBase Multi I/O cards
Add support for the SystemBase Multi I/O serial cards, which are "compatible" with a standard 16550A controllers, except that they need to have their interrupts enabled in a proprietary way. Tested with a Delock "Serial PCI Express x1 Card 8x Serial RS-232". Signed-off-by: Michael Walle <mwalle@kernel.org> Link: https://patch.msgid.link/20260225081739.946723-1-mwalle@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 37b4cab commit 072ce48

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

drivers/tty/serial/8250/8250_pci.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
#define PCI_DEVICE_ID_ADDIDATA_CPCI7420_NG 0x7025
101101
#define PCI_DEVICE_ID_ADDIDATA_CPCI7300_NG 0x7026
102102

103+
#define PCI_VENDOR_ID_SYSTEMBASE 0x14a1
104+
103105
/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
104106
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
105107
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588
@@ -2128,6 +2130,35 @@ pci_moxa_setup(struct serial_private *priv,
21282130
return setup_port(priv, port, bar, offset, 0);
21292131
}
21302132

2133+
#define SB_OPTR_IMR0 0x0c /* Interrupt mask register, p0 to p7 */
2134+
static int pci_systembase_init(struct pci_dev *dev)
2135+
{
2136+
resource_size_t iobase;
2137+
2138+
if (!IS_ENABLED(CONFIG_HAS_IOPORT))
2139+
return serial_8250_warn_need_ioport(dev);
2140+
2141+
iobase = pci_resource_start(dev, 1);
2142+
2143+
/* This will support up to 8 ports */
2144+
outb(0xff, iobase + SB_OPTR_IMR0);
2145+
2146+
return 0;
2147+
}
2148+
2149+
static void pci_systembase_exit(struct pci_dev *dev)
2150+
{
2151+
resource_size_t iobase;
2152+
2153+
if (!IS_ENABLED(CONFIG_HAS_IOPORT)) {
2154+
serial_8250_warn_need_ioport(dev);
2155+
return;
2156+
}
2157+
2158+
iobase = pci_resource_start(dev, 0);
2159+
outb(0x00, iobase + SB_OPTR_IMR0);
2160+
}
2161+
21312162
/*
21322163
* Master list of serial port init/setup/exit quirks.
21332164
* This does not describe the general nature of the port.
@@ -2476,6 +2507,16 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
24762507
.init = pci_siig_init,
24772508
.setup = pci_siig_setup,
24782509
},
2510+
/* Systembase */
2511+
{
2512+
.vendor = PCI_VENDOR_ID_SYSTEMBASE,
2513+
.device = 0x0008,
2514+
.subvendor = PCI_ANY_ID,
2515+
.subdevice = PCI_ANY_ID,
2516+
.init = pci_systembase_init,
2517+
.setup = pci_default_setup,
2518+
.exit = pci_systembase_exit,
2519+
},
24792520
/*
24802521
* Titan cards
24812522
*/
@@ -3041,6 +3082,7 @@ enum pci_board_num_t {
30413082
pbn_b0_1_921600,
30423083
pbn_b0_2_921600,
30433084
pbn_b0_4_921600,
3085+
pbn_b0_8_921600,
30443086

30453087
pbn_b0_2_1130000,
30463088

@@ -3241,6 +3283,12 @@ static struct pciserial_board pci_boards[] = {
32413283
.base_baud = 921600,
32423284
.uart_offset = 8,
32433285
},
3286+
[pbn_b0_8_921600] = {
3287+
.flags = FL_BASE0,
3288+
.num_ports = 8,
3289+
.base_baud = 921600,
3290+
.uart_offset = 8,
3291+
},
32443292

32453293
[pbn_b0_2_1130000] = {
32463294
.flags = FL_BASE0,
@@ -6152,6 +6200,9 @@ static const struct pci_device_id serial_pci_tbl[] = {
61526200
PCI_ANY_ID, PCI_ANY_ID,
61536201
0, 0, pbn_b0_1_115200 },
61546202

6203+
/* Systembase Multi I/O cards */
6204+
{ PCI_VDEVICE(SYSTEMBASE, 0x0008), pbn_b0_8_921600 },
6205+
61556206
/* Fintek PCI serial cards */
61566207
{ PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 },
61576208
{ PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 },

0 commit comments

Comments
 (0)