public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support for Korenix 16C950-based PCI cards
@ 2006-12-13 14:45 Russell King
  2006-12-20 13:33 ` Andrey Panin
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2006-12-13 14:45 UTC (permalink / raw)
  To: Linux Kernel List, Andrew Morton, Linus Torvalds

Linus, Andrew,

This patch adds initial support to 8250-pci for the Korenix Jetcard PCI
serial cards.  The JC12xx cards are standard RS232-based serial cards
utilising the Oxford 16C950 device.

The JC14xx are RS422/RS485-based cards, but in order for these to be
supported natively, we will need additional tweaks to the 8250 layers
so we can specify some values for the 950's registers.  Hence, these
two entries are commented out.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

 drivers/serial/8250_pci.c |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 4d0ff8f..89c3f2c 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -2239,6 +2239,30 @@ static struct pci_device_id serial_pci_t
 		pbn_b0_bt_1_460800 },
 
 	/*
+	 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
+	 * Cards are identified by their subsystem vendor IDs, which
+	 * (in hex) match the model number.
+	 *
+	 * Note that JC140x are RS422/485 cards which require ox950
+	 * ACR = 0x10, and as such are not currently fully supported.
+	 */
+	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+		0x1204, 0x0004, 0, 0,
+		pbn_b0_4_921600 },
+	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+		0x1208, 0x0004, 0, 0,
+		pbn_b0_4_921600 },
+/*	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+		0x1402, 0x0002, 0, 0,
+		pbn_b0_2_921600 }, */
+/*	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
+		0x1404, 0x0004, 0, 0,
+		pbn_b0_4_921600 }, */
+	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
+		0x1208, 0x0004, 0, 0,
+		pbn_b0_4_921600 },
+
+	/*
 	 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
 	 */
 	{	PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add support for Korenix 16C950-based PCI cards
  2006-12-13 14:45 [PATCH] Add support for Korenix 16C950-based PCI cards Russell King
@ 2006-12-20 13:33 ` Andrey Panin
  2006-12-20 19:05   ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Panin @ 2006-12-20 13:33 UTC (permalink / raw)
  To: Linux Kernel List, Andrew Morton, Linus Torvalds

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

On 347, 12 13, 2006 at 02:45:46PM +0000, Russell King wrote:
> Linus, Andrew,
> 
> This patch adds initial support to 8250-pci for the Korenix Jetcard PCI
> serial cards.  The JC12xx cards are standard RS232-based serial cards
> utilising the Oxford 16C950 device.
> 
> The JC14xx are RS422/RS485-based cards, but in order for these to be
> supported natively, we will need additional tweaks to the 8250 layers
> so we can specify some values for the 950's registers.  Hence, these
> two entries are commented out.

IIRC 16c950 just need two bits in ACR set properly. Will attached patch 
do the trick ?

> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> 
>  drivers/serial/8250_pci.c |   24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
> index 4d0ff8f..89c3f2c 100644
> --- a/drivers/serial/8250_pci.c
> +++ b/drivers/serial/8250_pci.c
> @@ -2239,6 +2239,30 @@ static struct pci_device_id serial_pci_t
>  		pbn_b0_bt_1_460800 },
>  
>  	/*
> +	 * Korenix Jetcard F0/F1 cards (JC1204, JC1208, JC1404, JC1408).
> +	 * Cards are identified by their subsystem vendor IDs, which
> +	 * (in hex) match the model number.
> +	 *
> +	 * Note that JC140x are RS422/485 cards which require ox950
> +	 * ACR = 0x10, and as such are not currently fully supported.
> +	 */
> +	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> +		0x1204, 0x0004, 0, 0,
> +		pbn_b0_4_921600 },
> +	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> +		0x1208, 0x0004, 0, 0,
> +		pbn_b0_4_921600 },
> +/*	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> +		0x1402, 0x0002, 0, 0,
> +		pbn_b0_2_921600 }, */
> +/*	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF0,
> +		0x1404, 0x0004, 0, 0,
> +		pbn_b0_4_921600 }, */
> +	{	PCI_VENDOR_ID_KORENIX, PCI_DEVICE_ID_KORENIX_JETCARDF1,
> +		0x1208, 0x0004, 0, 0,
> +		pbn_b0_4_921600 },
> +
> +	/*
>  	 * Dell Remote Access Card 4 - Tim_T_Murphy@Dell.com
>  	 */
>  	{	PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_DELL_RAC4,

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@donpac.ru		| PGP key: wwwkeys.pgp.net

[-- Attachment #2: patch-ACR --]
[-- Type: text/plain, Size: 1350 bytes --]

diff -urdpNX /usr/share/dontdiff -x Makefile linux-2.6.19.vanilla/drivers/serial/8250.c linux-2.6.19/drivers/serial/8250.c
--- linux-2.6.19.vanilla/drivers/serial/8250.c	2006-12-19 20:18:26.000000000 +0300
+++ linux-2.6.19/drivers/serial/8250.c	2006-12-19 19:53:04.000000000 +0300
@@ -1548,7 +1548,7 @@ static int serial8250_startup(struct uar
 
 	if (up->port.type == PORT_16C950) {
 		/* Wake up and initialize UART */
-		up->acr = 0;
+		up->acr = port->initial_acr;
 		serial_outp(up, UART_LCR, 0xBF);
 		serial_outp(up, UART_EFR, UART_EFR_ECB);
 		serial_outp(up, UART_IER, 0);
@@ -2599,6 +2599,7 @@ int serial8250_register_port(struct uart
 		uart->port.iotype   = port->iotype;
 		uart->port.flags    = port->flags | UPF_BOOT_AUTOCONF;
 		uart->port.mapbase  = port->mapbase;
+		uart->port.initial_acr = port->initial_acr;
 		if (port->dev)
 			uart->port.dev = port->dev;
 
diff -urdpNX /usr/share/dontdiff -x Makefile linux-2.6.19.vanilla/drivers/serial/8250.h linux-2.6.19/drivers/serial/8250.h
--- linux-2.6.19.vanilla/drivers/serial/8250.h	2006-12-19 20:44:12.000000000 +0300
+++ linux-2.6.19/drivers/serial/8250.h	2006-12-19 20:28:29.000000000 +0300
@@ -29,6 +29,8 @@ struct old_serial_port {
 	unsigned short iomem_reg_shift;
 };
 
+#define initial_acr unused[0]
+
 /*
  * This replaces serial_uart_config in include/linux/serial.h
  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add support for Korenix 16C950-based PCI cards
  2006-12-20 13:33 ` Andrey Panin
@ 2006-12-20 19:05   ` Russell King
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2006-12-20 19:05 UTC (permalink / raw)
  To: Linux Kernel List, Andrew Morton, Linus Torvalds

On Wed, Dec 20, 2006 at 04:33:10PM +0300, Andrey Panin wrote:
> On 347, 12 13, 2006 at 02:45:46PM +0000, Russell King wrote:
> > Linus, Andrew,
> > 
> > This patch adds initial support to 8250-pci for the Korenix Jetcard PCI
> > serial cards.  The JC12xx cards are standard RS232-based serial cards
> > utilising the Oxford 16C950 device.
> > 
> > The JC14xx are RS422/RS485-based cards, but in order for these to be
> > supported natively, we will need additional tweaks to the 8250 layers
> > so we can specify some values for the 950's registers.  Hence, these
> > two entries are commented out.
> 
> IIRC 16c950 just need two bits in ACR set properly. Will attached patch 
> do the trick ?

I, too, also have a patch which does something similar.  I'm going to
hold off on that until post 2.6.20 though, especially as I have no
way to test it.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-20 19:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-13 14:45 [PATCH] Add support for Korenix 16C950-based PCI cards Russell King
2006-12-20 13:33 ` Andrey Panin
2006-12-20 19:05   ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox