linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ed Vance <EdV@macrolink.com>
To: "'Marcelo Tosatti'" <marcelo.tosatti@cyclades.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.4.23 add serial driver support for Macrolink MCCS-H car ds
Date: Thu, 4 Dec 2003 15:32:23 -0800	[thread overview]
Message-ID: <11E89240C407D311958800A0C9ACF7D1A34060@EXCHANGE> (raw)

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Hi again Marcelo,

(Looks like the mailer smashed the longer lines in the patch text.
Here it is again as an attached file.)

This patch adds support to the generic serial driver for the Macrolink
MCCS-H 8/16-port CompactPCI serial cards, which use XR16C864 UARTs and the
PLX 9030 PCI 2.2 interface chip.  No changes are made to existing serial
driver logic.  No new logic is added beyond the card's own initialization
function.  UARTs are detected as XR16850, which is close enough. 

For kernel version 2.4.23. Please apply.

Thanks,
Ed

---------------------------------------------------------------- 
Ed Vance              edv (at) macrolink (dot) com
Macrolink, Inc.       1500 N. Kellogg Dr  Anaheim, CA  92807
----------------------------------------------------------------


[-- Attachment #2: patch-mccsh-2.4.23 --]
[-- Type: application/octet-stream, Size: 4082 bytes --]

diff -urN -X dontdiff.txt linux-2.4.23/drivers/char/serial.c linux-2.4.23-ml/drivers/char/serial.c
--- linux-2.4.23/drivers/char/serial.c	Thu Dec  4 10:58:33 2003
+++ linux-2.4.23-ml/drivers/char/serial.c	Thu Dec  4 11:36:41 2003
@@ -4297,6 +4297,31 @@
 	return 0;
 }
 
+static int __devinit
+pci_mccsh_fn(struct pci_dev *dev, struct pci_board *board, int enable)
+{
+	u8 *b0, *b3;	/* BAR0: PLX 9030, BAR3: card level regs */
+
+	b0 = ioremap(pci_resource_start(dev, 0), 0x80);
+	b3 = ioremap(pci_resource_start(dev, 3), 0x80);
+	/* Set LED color & irq pacing (4?=grn,0?=yel,?2=256us min interval) */
+	/* Enable or disable Enhanced mode and PLX 9030 PCI interrupts. */
+	if (enable) {
+		writel(readl(b0 + 0x54) | 0x04000000, b0 + 0x54); /* GPIO8=1 */
+		writew(0x42, b3 + 0xa); /* LED=green, max irq pace=256us */
+		writew(0, b3 + 0x2);	/* clear any pending irq */
+		writel((readl(b0 + 0x4c) | 0x40), b0 + 0x4c); /* PCI_IRQ=1 */
+	} else {
+		writel((readl(b0 + 0x4c) & ~0x40), b0 + 0x4c); /* PCI_IRQ=0 */
+		writew(0, b3 + 0x2);	/* clear any pending irq */
+		writew(0x00, b3 + 0xa); /* LED=yellow, no irq pace limit */
+		writel(readl(b0 + 0x54) & ~0x04000000, b0 + 0x54); /* GPIO8=0 */
+	}
+	iounmap(b3);
+	iounmap(b0);
+	return 0;
+}
+
 /*
  * This is the configuration table for all of the PCI serial boards
  * which we support.  It is directly indexed by the pci_board_num_t enum
@@ -4346,6 +4371,9 @@
 	pbn_b2_bt_4_115200,
 	pbn_b2_bt_2_921600,
 
+	pbn_b5_8_1843200,
+	pbn_b5_16_1843200,
+
 	pbn_panacom,
 	pbn_panacom2,
 	pbn_panacom4,
@@ -4428,6 +4456,11 @@
 	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 4, 115200 }, /* pbn_b2_bt_4_115200 */
 	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600 }, /* pbn_b2_bt_2_921600 */
 
+	{ SPCI_FL_BASE5, 8, 1843200,  /* IOMEM */	/* pbn_b5_8_1843200 */
+                8, 0, pci_mccsh_fn },
+	{ SPCI_FL_BASE5, 16, 1843200, /* IOMEM */	/* pbn_b5_16_1843200 */
+                8, 0, pci_mccsh_fn },
+
 	{ SPCI_FL_BASE2, 2, 921600, /* IOMEM */		   /* pbn_panacom */
 		0x400, 7, pci_plx9050_fn },
 	{ SPCI_FL_BASE2 | SPCI_FL_BASE_TABLE, 2, 921600,   /* pbn_panacom2 */
@@ -4667,6 +4700,15 @@
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 		pbn_b2_8_115200 },
 
+	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
+		PCI_VENDOR_ID_MACROLINK,
+		PCI_DEVICE_ID_MACROLINK_MCCS8H, 0, 0,
+		pbn_b5_8_1843200 },
+	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
+		PCI_VENDOR_ID_MACROLINK,
+		PCI_DEVICE_ID_MACROLINK_MCCSH, 0, 0,
+		pbn_b5_16_1843200 },
+
 	{	PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_GTEK_SERIAL2,
 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
 		pbn_b2_bt_2_115200 },
diff -urN -X dontdiff.txt linux-2.4.23/include/linux/pci_ids.h linux-2.4.23-ml/include/linux/pci_ids.h
--- linux-2.4.23/include/linux/pci_ids.h	Fri Nov 28 10:26:21 2003
+++ linux-2.4.23-ml/include/linux/pci_ids.h	Thu Dec  4 11:36:41 2003
@@ -864,6 +864,7 @@
 #define PCI_DEVICE_ID_PLX_SPCOM200	0x1103
 #define PCI_DEVICE_ID_PLX_DJINN_ITOO	0x1151
 #define PCI_DEVICE_ID_PLX_R753		0x1152
+#define PCI_DEVICE_ID_PLX_9030		0x9030
 #define PCI_DEVICE_ID_PLX_9050		0x9050
 #define PCI_DEVICE_ID_PLX_9060		0x9060
 #define PCI_DEVICE_ID_PLX_9060ES	0x906E
@@ -1685,6 +1686,10 @@
 #define PCI_VENDOR_ID_PDC		0x15e9
 #define PCI_DEVICE_ID_PDC_ADMA100	0x1841
 
+#define PCI_VENDOR_ID_MACROLINK		0x15ed
+#define PCI_DEVICE_ID_MACROLINK_MCCS8H	0x1002
+#define PCI_DEVICE_ID_MACROLINK_MCCSH	0x1003
+
 #define PCI_VENDOR_ID_ALTIMA		0x173b
 #define PCI_DEVICE_ID_ALTIMA_AC1000	0x03e8
 #define PCI_DEVICE_ID_ALTIMA_AC1001	0x03e9
diff -urN -X dontdiff.txt linux-2.4.23/include/linux/serialP.h linux-2.4.23-ml/include/linux/serialP.h
--- linux-2.4.23/include/linux/serialP.h	Fri Aug  2 17:39:45 2002
+++ linux-2.4.23-ml/include/linux/serialP.h	Thu Dec  4 11:36:41 2003
@@ -170,6 +170,7 @@
 #define SPCI_FL_BASE2	0x0002
 #define SPCI_FL_BASE3	0x0003
 #define SPCI_FL_BASE4	0x0004
+#define SPCI_FL_BASE5	0x0005
 #define SPCI_FL_GET_BASE(x)	(x & SPCI_FL_BASE_MASK)
 
 #define SPCI_FL_IRQ_MASK       (0x0007 << 4)

             reply	other threads:[~2003-12-04 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-04 23:32 Ed Vance [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-12-04 22:49 [PATCH] 2.4.23 add serial driver support for Macrolink MCCS-H car ds Ed Vance

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11E89240C407D311958800A0C9ACF7D1A34060@EXCHANGE \
    --to=edv@macrolink.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).