Re: SIIG DP CyberSerial 4S PCIe Support

From: Andrey Panin
Date: Tue Mar 09 2010 - 09:29:20 EST


On 067, 03 08, 2010 at 09:15:26PM -0800, James Lamanna wrote:

> That's probably the case.
> It looks like 8250 doesn't know about this PCIe device at all.
> The Oxford PCI ID is not in pci_ids.h nor is the SIIG subsystem ID.
> I'll see if I can maybe work up a patch to support this device, since I've found
> the datasheet for the Oxford 4 port UART controller, but I may need some help.
> Or if anyone else (who has more experience with this) wants to formulate one,
> it would be greatly appreciated.

Looks like you card can use existing code for Oxford Semiconductor UARTs.
Can you test the attached patch for 2.6.33 ?
diff -urdpX dontdiff linux-2.6.33.vanilla/drivers/serial/8250_pci.c linux-2.6.33/drivers/serial/8250_pci.c
--- linux-2.6.33.vanilla/drivers/serial/8250_pci.c 2010-03-09 16:19:55.000000000 +0300
+++ linux-2.6.33/drivers/serial/8250_pci.c 2010-03-09 16:26:02.000000000 +0300
@@ -431,6 +431,38 @@ static void __devexit sbs_exit(struct pc
}

/*
+ * Oxford Semiconductor Inc.
+ * Check that device is part of the Tornado range of devices, then determine
+ * the number of ports available on the device.
+ */
+static int pci_oxsemi_tornado_init(struct pci_dev *dev)
+{
+ u8 __iomem *p;
+ unsigned long deviceID;
+ unsigned int number_uarts = 0;
+
+ /* OxSemi Tornado devices are all 0xCxxx */
+ if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
+ (dev->device & 0xF000) != 0xC000)
+ return 0;
+
+ p = pci_iomap(dev, 0, 5);
+ if (p == NULL)
+ return -ENOMEM;
+
+ deviceID = ioread32(p);
+ /* Tornado device */
+ if (deviceID == 0x07000200) {
+ number_uarts = ioread8(p + 4);
+ printk(KERN_DEBUG
+ "%d ports detected on Oxford PCI Express device\n",
+ number_uarts);
+ }
+ pci_iounmap(dev, p);
+ return number_uarts;
+}
+
+/*
* SIIG serial cards have an PCI interface chip which also controls
* the UART clocking frequency. Each UART can be clocked independently
* (except cards equiped with 4 UARTs) and initial clocking settings
@@ -515,6 +547,8 @@ static int pci_siig_init(struct pci_dev
return pci_siig10x_init(dev);
else if (type == 0x2000)
return pci_siig20x_init(dev);
+ else if ((type & 0xf000) == 0xc000)
+ return pci_oxsemi_tornado_init(dev);

moan_device("Unknown SIIG card", dev);
return -ENODEV;
@@ -902,38 +936,6 @@ static void __devexit pci_ite887x_exit(s
release_region(ioport, ITE_887x_IOSIZE);
}

-/*
- * Oxford Semiconductor Inc.
- * Check that device is part of the Tornado range of devices, then determine
- * the number of ports available on the device.
- */
-static int pci_oxsemi_tornado_init(struct pci_dev *dev)
-{
- u8 __iomem *p;
- unsigned long deviceID;
- unsigned int number_uarts = 0;
-
- /* OxSemi Tornado devices are all 0xCxxx */
- if (dev->vendor == PCI_VENDOR_ID_OXSEMI &&
- (dev->device & 0xF000) != 0xC000)
- return 0;
-
- p = pci_iomap(dev, 0, 5);
- if (p == NULL)
- return -ENOMEM;
-
- deviceID = ioread32(p);
- /* Tornado device */
- if (deviceID == 0x07000200) {
- number_uarts = ioread8(p + 4);
- printk(KERN_DEBUG
- "%d ports detected on Oxford PCI Express device\n",
- number_uarts);
- }
- pci_iounmap(dev, p);
- return number_uarts;
-}
-
static int
pci_default_setup(struct serial_private *priv,
const struct pciserial_board *board,
@@ -2984,6 +2986,13 @@ static struct pci_device_id serial_pci_t
PCI_VENDOR_ID_MAINPINE, 0x4008, 0, 0,
pbn_oxsemi_8_4000000 },
/*
+ * SIIG cards utilizing OxSemi Tornado
+ */
+ { PCI_VENDOR_ID_SIIG, 0xc208, /* SIIG DP CyberSerial 4S PCIe */
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ pbn_oxsemi_4_4000000 },
+
+ /*
* SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
* from skokodyn@xxxxxxxxx
*/