Re: can't find interrupt number under /proc/interrupts for the pci multi-port on db1550

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Jun 2005, rolf liu wrote:
I am running 2.4.31 on db1550 with a pci multi-port board. the kernel
starts up ok. but after start-up, I can't find the corresponding
interrupt number for this board, which is irq 2. I can find the device
under /proc/devices and /proc/tty/driver, etc. So I am now sure if it
is working ok. Is there good (simple) method to test this serial port?

My guess is that you can get it working if you disable the built-in serial ports in the kernel.

I've attached a quick'n'dirty patch I made for 2.4.27 that makes it possible to use both internal and pci serial ports. It's a hack, but it works.


--
Jon Anders Haugum
Index: include/asm-mips/au1000.h

===================================================================

RCS file: /home/cvs/linux/include/asm-mips/Attic/au1000.h,v

retrieving revision 1.5.2.29

diff -u -r1.5.2.29 au1000.h

--- include/asm-mips/au1000.h	7 Jul 2004 18:19:37 -0000	1.5.2.29

+++ include/asm-mips/au1000.h	17 Nov 2004 11:03:13 -0000

@@ -904,15 +904,15 @@

 #define UART_BASE                 UART0_ADDR

 #define UART_DEBUG_BASE           UART3_ADDR

 

-#define UART_RX		0	/* Receive buffer */

-#define UART_TX		4	/* Transmit buffer */

-#define UART_IER	8	/* Interrupt Enable Register */

-#define UART_IIR	0xC	/* Interrupt ID Register */

-#define UART_FCR	0x10	/* FIFO Control Register */

-#define UART_LCR	0x14	/* Line Control Register */

-#define UART_MCR	0x18	/* Modem Control Register */

-#define UART_LSR	0x1C	/* Line Status Register */

-#define UART_MSR	0x20	/* Modem Status Register */

+#define AU_UART_RX		0	/* Receive buffer */

+#define AU_UART_TX		4	/* Transmit buffer */

+#define AU_UART_IER	8	/* Interrupt Enable Register */

+#define AU_UART_IIR	0xC	/* Interrupt ID Register */

+#define AU_UART_FCR	0x10	/* FIFO Control Register */

+#define AU_UART_LCR	0x14	/* Line Control Register */

+#define AU_UART_MCR	0x18	/* Modem Control Register */

+#define AU_UART_LSR	0x1C	/* Line Status Register */

+#define AU_UART_MSR	0x20	/* Modem Status Register */

 #define UART_CLK	0x28	/* Baud Rate Clock Divider */

 #define UART_MOD_CNTRL	0x100	/* Module Control */

 

@@ -920,7 +920,7 @@

 #define UART_FCR_CLEAR_RCVR	0x02 /* Clear the RCVR FIFO */

 #define UART_FCR_CLEAR_XMIT	0x04 /* Clear the XMIT FIFO */

 #define UART_FCR_DMA_SELECT	0x08 /* For DMA applications */

-#define UART_FCR_TRIGGER_MASK	0xF0 /* Mask for the FIFO trigger range */

+#define AU_UART_FCR_TRIGGER_MASK	0xF0 /* Mask for the FIFO trigger range */

 #define UART_FCR_R_TRIGGER_1	0x00 /* Mask for receive trigger set at 1 */

 #define UART_FCR_R_TRIGGER_4	0x40 /* Mask for receive trigger set at 4 */

 #define UART_FCR_R_TRIGGER_8	0x80 /* Mask for receive trigger set at 8 */

Index: include/asm-mips/serial.h

===================================================================

RCS file: /home/cvs/linux/include/asm-mips/serial.h,v

retrieving revision 1.23.2.21

diff -u -r1.23.2.21 serial.h

--- include/asm-mips/serial.h	19 Aug 2004 22:33:33 -0000	1.23.2.21

+++ include/asm-mips/serial.h	17 Nov 2004 11:03:14 -0000

@@ -191,6 +191,7 @@

 #endif

 

 #ifdef CONFIG_SOC_AU1550

+#define SERIAL_DEV_OFFSET 3

 #define AU1000_SERIAL_PORT_DEFNS                              \

     { .baud_base = 0, .port = UART0_ADDR, .irq = AU1550_UART0_INT,  \

       .flags = STD_COM_FLAGS, .type = 1 },                        \

@@ -469,7 +470,6 @@

 

 #define SERIAL_PORT_DFNS			\

 	ATLAS_SERIAL_PORT_DEFNS			\

-	AU1000_SERIAL_PORT_DEFNS		\

 	COBALT_SERIAL_PORT_DEFNS		\

 	DDB5477_SERIAL_PORT_DEFNS		\

 	EV96100_SERIAL_PORT_DEFNS		\

Index: drivers/char/au1x00-serial.c

===================================================================

RCS file: /home/cvs/linux/drivers/char/Attic/au1x00-serial.c,v

retrieving revision 1.1.2.2

diff -u -r1.1.2.2 au1x00-serial.c

--- drivers/char/au1x00-serial.c	24 Jun 2003 22:19:58 -0000	1.1.2.2

+++ drivers/char/au1x00-serial.c	17 Nov 2004 11:03:14 -0000

@@ -110,19 +110,13 @@

 #include <asm/irq.h>

 #include <asm/bitops.h>

 

-#ifdef CONFIG_MAC_SERIAL

-#define SERIAL_DEV_OFFSET	2

-#else

-#define SERIAL_DEV_OFFSET	0

-#endif

-

 #ifdef SERIAL_INLINE

 #define _INLINE_ inline

 #else

 #define _INLINE_

 #endif

 

-static char *serial_name = "Serial driver";

+static char *serial_name = "Au1xxx serial driver";

 

 static DECLARE_TASK_QUEUE(tq_serial);

 

@@ -174,8 +168,8 @@

 };

 

 

-static struct serial_state rs_table[RS_TABLE_SIZE] = {

-	SERIAL_PORT_DFNS	/* Defined in serial.h */

+static struct serial_state rs_table[] = {

+	AU1000_SERIAL_PORT_DEFNS	/* Defined in serial.h */

 };

 

 #define NR_PORTS	(sizeof(rs_table)/sizeof(struct serial_state))

@@ -279,7 +273,7 @@

 	spin_lock_irqsave(&serial_lock, flags);

 	if (info->IER & UART_IER_THRI) {

 		info->IER &= ~UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 	}

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

@@ -297,7 +291,7 @@

 	    && info->xmit.buf

 	    && !(info->IER & UART_IER_THRI)) {

 		info->IER |= UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 	}

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

@@ -345,7 +339,7 @@

 

 	icount = &info->state->icount;

 	do {

-		ch = serial_inp(info, UART_RX);

+		ch = serial_inp(info, AU_UART_RX);

 		if (tty->flip.count >= TTY_FLIPBUF_SIZE)

 			goto ignore_char;

 		*tty->flip.char_buf_ptr = ch;

@@ -444,7 +438,7 @@

 		tty->flip.char_buf_ptr++;

 		tty->flip.count++;

 	ignore_char:

-		*status = serial_inp(info, UART_LSR);

+		*status = serial_inp(info, AU_UART_LSR);

 	} while (*status & UART_LSR_DR);

 	tty_flip_buffer_push(tty);

 }

@@ -454,7 +448,7 @@

 	int count;

 

 	if (info->x_char) {

-		serial_outp(info, UART_TX, info->x_char);

+		serial_outp(info, AU_UART_TX, info->x_char);

 		info->state->icount.tx++;

 		info->x_char = 0;

 		if (intr_done)

@@ -465,13 +459,13 @@

 	    || info->tty->stopped

 	    || info->tty->hw_stopped) {

 		info->IER &= ~UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 		return;

 	}

 

 	count = info->xmit_fifo_size;

 	do {

-		serial_out(info, UART_TX, info->xmit.buf[info->xmit.tail]);

+		serial_out(info, AU_UART_TX, info->xmit.buf[info->xmit.tail]);

 		info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1);

 		info->state->icount.tx++;

 		if (info->xmit.head == info->xmit.tail)

@@ -491,7 +485,7 @@

 

 	if (info->xmit.head == info->xmit.tail) {

 		info->IER &= ~UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 	}

 }

 

@@ -500,7 +494,7 @@

 	int	status;

 	struct	async_icount *icount;

 

-	status = serial_in(info, UART_MSR);

+	status = serial_in(info, AU_UART_MSR);

 

 	if (status & UART_MSR_ANY_DELTA) {

 		icount = &info->state->icount;

@@ -546,7 +540,7 @@

 #endif

 				info->tty->hw_stopped = 0;

 				info->IER |= UART_IER_THRI;

-				serial_out(info, UART_IER, info->IER);

+				serial_out(info, AU_UART_IER, info->IER);

 				rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);

 				return;

 			}

@@ -557,7 +551,7 @@

 #endif

 				info->tty->hw_stopped = 1;

 				info->IER &= ~UART_IER_THRI;

-				serial_out(info, UART_IER, info->IER);

+				serial_out(info, AU_UART_IER, info->IER);

 			}

 		}

 	}

@@ -583,7 +577,7 @@

 		return;

 

 	do {

-		status = serial_inp(info, UART_LSR);

+		status = serial_inp(info, AU_UART_LSR);

 #ifdef SERIAL_DEBUG_INTR

 		printk("status = %x...", status);

 #endif

@@ -598,7 +592,7 @@

 #endif

 			break;

 		}

-	} while (!(serial_in(info, UART_IIR) & UART_IIR_NO_INT));

+	} while (!(serial_in(info, AU_UART_IIR) & UART_IIR_NO_INT));

 	info->last_active = jiffies;

 #ifdef SERIAL_DEBUG_INTR

 	printk("end.\n");

@@ -764,20 +758,20 @@

 	 * (they will be reenabled in change_speed())

 	 */

 	if (uart_config[state->type].flags & UART_CLEAR_FIFO) {

-		serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO);

-		serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |

+		serial_outp(info, AU_UART_FCR, UART_FCR_ENABLE_FIFO);

+		serial_outp(info, AU_UART_FCR, (UART_FCR_ENABLE_FIFO |

 					     UART_FCR_CLEAR_RCVR |

 					     UART_FCR_CLEAR_XMIT));

-		serial_outp(info, UART_FCR, 0);

+		serial_outp(info, AU_UART_FCR, 0);

 	}

 

 	/*

 	 * Clear the interrupt registers.

 	 */

-	(void) serial_inp(info, UART_LSR);

-	(void) serial_inp(info, UART_RX);

-	(void) serial_inp(info, UART_IIR);

-	(void) serial_inp(info, UART_MSR);

+	(void) serial_inp(info, AU_UART_LSR);

+	(void) serial_inp(info, AU_UART_RX);

+	(void) serial_inp(info, AU_UART_IIR);

+	(void) serial_inp(info, AU_UART_MSR);

 

 	/*

 	 * At this point there's no way the LSR could still be 0xFF;

@@ -785,7 +779,7 @@

 	 * here.

 	 */

 	if (!(info->flags & ASYNC_BUGGY_UART) &&

-	    (serial_inp(info, UART_LSR) == 0xff)) {

+	    (serial_inp(info, AU_UART_LSR) == 0xff)) {

 		printk("LSR safety check engaged!\n");

 		if (capable(CAP_SYS_ADMIN)) {

 			if (info->tty)

@@ -810,7 +804,7 @@

 			handler = rs_interrupt_single;

 

 		retval = request_irq(state->irq, handler, SA_SHIRQ,

-				     "serial", &IRQ_ports[state->irq]);

+				     "Au1xxx serial", &IRQ_ports[state->irq]);

 		if (retval) {

 			if (capable(CAP_SYS_ADMIN)) {

 				if (info->tty)

@@ -835,7 +829,7 @@

 	/*

 	 * Now, initialize the UART

 	 */

-	serial_outp(info, UART_LCR, UART_LCR_WLEN8);

+	serial_outp(info, AU_UART_LCR, UART_LCR_WLEN8);

 

 	info->MCR = 0;

 	if (info->tty->termios->c_cflag & CBAUD)

@@ -845,22 +839,22 @@

 			info->MCR |= UART_MCR_OUT2;

 	}

 	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */

-	serial_outp(info, UART_MCR, info->MCR);

+	serial_outp(info, AU_UART_MCR, info->MCR);

 

 	/*

 	 * Finally, enable interrupts

 	 */

 	info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI;

-	serial_outp(info, UART_IER, info->IER);	/* enable interrupts */

+	serial_outp(info, AU_UART_IER, info->IER);	/* enable interrupts */

 

 

 	/*

 	 * And clear the interrupt registers again for luck.

 	 */

-	(void)serial_inp(info, UART_LSR);

-	(void)serial_inp(info, UART_RX);

-	(void)serial_inp(info, UART_IIR);

-	(void)serial_inp(info, UART_MSR);

+	(void)serial_inp(info, AU_UART_LSR);

+	(void)serial_inp(info, AU_UART_RX);

+	(void)serial_inp(info, AU_UART_IIR);

+	(void)serial_inp(info, AU_UART_MSR);

 

 	if (info->tty)

 		clear_bit(TTY_IO_ERROR, &info->tty->flags);

@@ -947,7 +941,7 @@

 		if (IRQ_ports[state->irq]) {

 			free_irq(state->irq, &IRQ_ports[state->irq]);

 			retval = request_irq(state->irq, rs_interrupt_single,

-					     SA_SHIRQ, "serial",

+					     SA_SHIRQ, "Au1xxx serial",

 					     &IRQ_ports[state->irq]);

 

 			if (retval)

@@ -964,24 +958,24 @@

 	}

 

 	info->IER = 0;

-	serial_outp(info, UART_IER, 0x00);	/* disable all intrs */

+	serial_outp(info, AU_UART_IER, 0x00);	/* disable all intrs */

 		info->MCR &= ~UART_MCR_OUT2;

 	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */

 

 	/* disable break condition */

-	serial_out(info, UART_LCR, serial_inp(info, UART_LCR) & ~UART_LCR_SBC);

+	serial_out(info, AU_UART_LCR, serial_inp(info, AU_UART_LCR) & ~UART_LCR_SBC);

 

 	if (!info->tty || (info->tty->termios->c_cflag & HUPCL))

 		info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);

-	serial_outp(info, UART_MCR, info->MCR);

+	serial_outp(info, AU_UART_MCR, info->MCR);

 

 	/* disable FIFO's */

-	serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |

+	serial_outp(info, AU_UART_FCR, (UART_FCR_ENABLE_FIFO |

 				     UART_FCR_CLEAR_RCVR |

 				     UART_FCR_CLEAR_XMIT));

-	serial_outp(info, UART_FCR, 0);

+	serial_outp(info, AU_UART_FCR, 0);

 

-	(void)serial_in(info, UART_RX);    /* read data port to reset things */

+	(void)serial_in(info, AU_UART_RX);    /* read data port to reset things */

 

 	if (info->tty)

 		set_bit(TTY_IO_ERROR, &info->tty->flags);

@@ -1104,7 +1098,7 @@

 		info->flags |= ASYNC_CHECK_CD;

 		info->IER |= UART_IER_MSI;

 	}

-	serial_out(info, UART_IER, info->IER);

+	serial_out(info, AU_UART_IER, info->IER);

 

 	/*

 	 * Set up parity check flag

@@ -1140,7 +1134,7 @@

 	spin_lock_irqsave(&serial_lock, flags);

 

 	serial_outp(info, UART_CLK, quot & 0xffff);

-	serial_outp(info, UART_LCR, cval);

+	serial_outp(info, AU_UART_LCR, cval);

 	info->LCR = cval;				/* Save LCR */

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

@@ -1185,7 +1179,7 @@

 

 	spin_lock_irqsave(&serial_lock, flags);

 	info->IER |= UART_IER_THRI;

-	serial_out(info, UART_IER, info->IER);

+	serial_out(info, AU_UART_IER, info->IER);

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

 

@@ -1261,7 +1255,7 @@

 	    && !tty->hw_stopped

 	    && !(info->IER & UART_IER_THRI)) {

 		info->IER |= UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 	}

 	return ret;

 }

@@ -1318,7 +1312,7 @@

 	if (ch) {

 		/* Make sure transmit interrupts are on */

 		info->IER |= UART_IER_THRI;

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 	}

 }

 

@@ -1351,7 +1345,7 @@

 		info->MCR &= ~UART_MCR_RTS;

 

 	spin_lock_irqsave(&serial_lock, flags);

-	serial_out(info, UART_MCR, info->MCR);

+	serial_out(info, AU_UART_MCR, info->MCR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

 

@@ -1378,7 +1372,7 @@

 	if (tty->termios->c_cflag & CRTSCTS)

 		info->MCR |= UART_MCR_RTS;

 	spin_lock_irqsave(&serial_lock, flags);

-	serial_out(info, UART_MCR, info->MCR);

+	serial_out(info, AU_UART_MCR, info->MCR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

 

@@ -1564,7 +1558,7 @@

 	unsigned long flags;

 

 	spin_lock_irqsave(&serial_lock, flags);

-	status = serial_in(info, UART_LSR);

+	status = serial_in(info, AU_UART_LSR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 	result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);

 

@@ -1594,7 +1588,7 @@

 

 	control = info->MCR;

 	spin_lock_irqsave(&serial_lock, flags);

-	status = serial_in(info, UART_MSR);

+	status = serial_in(info, AU_UART_MSR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 	result =  ((control & UART_MCR_RTS) ? TIOCM_RTS : 0)

 		| ((control & UART_MCR_DTR) ? TIOCM_DTR : 0)

@@ -1671,7 +1665,7 @@

 	}

 	spin_lock_irqsave(&serial_lock, flags);

 	info->MCR |= ALPHA_KLUDGE_MCR; 		/* Don't ask */

-	serial_out(info, UART_MCR, info->MCR);

+	serial_out(info, AU_UART_MCR, info->MCR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 	return 0;

 }

@@ -1713,7 +1707,7 @@

 		info->LCR |= UART_LCR_SBC;

 	else

 		info->LCR &= ~UART_LCR_SBC;

-	serial_out(info, UART_LCR, info->LCR);

+	serial_out(info, AU_UART_LCR, info->LCR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

 

@@ -1775,7 +1769,7 @@

 			spin_unlock_irqrestore(&serial_lock, flags);

 			/* Force modem status interrupts on */

 			info->IER |= UART_IER_MSI;

-			serial_out(info, UART_IER, info->IER);

+			serial_out(info, AU_UART_IER, info->IER);

 			while (1) {

 				interruptible_sleep_on(&info->delta_msr_wait);

 				/* see if a signal did it */

@@ -1852,7 +1846,7 @@

 	    !(cflag & CBAUD)) {

 		info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);

 		spin_lock_irqsave(&serial_lock, flags);

-		serial_out(info, UART_MCR, info->MCR);

+		serial_out(info, AU_UART_MCR, info->MCR);

 		spin_unlock_irqrestore(&serial_lock, flags);

 	}

 

@@ -1865,7 +1859,7 @@

 			info->MCR |= UART_MCR_RTS;

 		}

 		spin_lock_irqsave(&serial_lock, flags);

-		serial_out(info, UART_MCR, info->MCR);

+		serial_out(info, AU_UART_MCR, info->MCR);

 		spin_unlock_irqrestore(&serial_lock, flags);

 	}

 

@@ -1959,7 +1953,7 @@

 	info->IER &= ~UART_IER_RLSI;

 	info->read_status_mask &= ~UART_LSR_DR;

 	if (info->flags & ASYNC_INITIALIZED) {

-		serial_out(info, UART_IER, info->IER);

+		serial_out(info, AU_UART_IER, info->IER);

 		/*

 		 * Before we drop DTR, make sure the UART transmitter

 		 * has completely drained; this is especially

@@ -2036,7 +2030,7 @@

 	printk("In rs_wait_until_sent(%d) check=%lu...", timeout, char_time);

 	printk("jiff=%lu...", jiffies);

 #endif

-	while (!((lsr = serial_inp(info, UART_LSR)) & UART_LSR_TEMT)) {

+	while (!((lsr = serial_inp(info, AU_UART_LSR)) & UART_LSR_TEMT)) {

 #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT

 		printk("lsr = %d (jiff=%lu)...", lsr, jiffies);

 #endif

@@ -2170,8 +2164,8 @@

 		spin_lock_irqsave(&serial_lock, flags);

 		if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&

 		    (tty->termios->c_cflag & CBAUD))

-			serial_out(info, UART_MCR,

-				   serial_inp(info, UART_MCR) |

+			serial_out(info, AU_UART_MCR,

+				   serial_inp(info, AU_UART_MCR) |

 				   (UART_MCR_DTR | UART_MCR_RTS));

 		spin_unlock_irqrestore(&serial_lock, flags);

 		set_current_state(TASK_INTERRUPTIBLE);

@@ -2189,7 +2183,7 @@

 		}

 		if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&

 		    !(info->flags & ASYNC_CLOSING) &&

-		    (do_clocal || (serial_in(info, UART_MSR) &

+		    (do_clocal || (serial_in(info, AU_UART_MSR) &

 				   UART_MSR_DCD)))

 			break;

 		if (signal_pending(current)) {

@@ -2397,8 +2391,8 @@

 		info->tty = 0;

 	}

 	spin_lock_irqsave(&serial_lock, flags);

-	status = serial_in(info, UART_MSR);

-	control = info != &scr_info ? info->MCR : serial_in(info, UART_MCR);

+	status = serial_in(info, AU_UART_MSR);

+	control = info != &scr_info ? info->MCR : serial_in(info, AU_UART_MCR);

 	spin_unlock_irqrestore(&serial_lock, flags);

 

 	stat_buf[0] = 0;

@@ -2536,23 +2530,23 @@

 	state->xmit_fifo_size =	uart_config[state->type].dfl_xmit_fifo_size;

 

 	if (info->port) {

-			request_region(info->port,8,"serial(auto)");

+			request_region(info->port,8,"Au1xxx serial(auto)");

 	}

 

 	/*

 	 * Reset the UART.

 	 */

-	serial_outp(info, UART_FCR, (UART_FCR_ENABLE_FIFO |

+	serial_outp(info, AU_UART_FCR, (UART_FCR_ENABLE_FIFO |

 				     UART_FCR_CLEAR_RCVR |

 				     UART_FCR_CLEAR_XMIT));

-	serial_outp(info, UART_FCR, 0);

-	(void)serial_in(info, UART_RX);

-	serial_outp(info, UART_IER, 0);

+	serial_outp(info, AU_UART_FCR, 0);

+	(void)serial_in(info, AU_UART_RX);

+	serial_outp(info, AU_UART_IER, 0);

 	spin_unlock_irqrestore(&serial_lock, flags);

 }

 

-int register_serial(struct serial_struct *req);

-void unregister_serial(int line);

+int register_Au1xxx_serial(struct serial_struct *req);

+void unregister_Au1xxx_serial(int line);

 

 /*

  * The serial driver boot-time initialization code!

@@ -2562,6 +2556,7 @@

 	int i;

 	struct serial_state * state;

 

+printk("au rs_init %d\n", NR_PORTS);

 	init_bh(SERIAL_BH, do_serial_bh);

 	init_timer(&serial_timer);

 	serial_timer.function = rs_timer;

@@ -2589,14 +2584,14 @@

 

 	memset(&serial_driver, 0, sizeof(struct tty_driver));

 	serial_driver.magic = TTY_DRIVER_MAGIC;

-	serial_driver.driver_name = "serial";

+	serial_driver.driver_name = "Au1xxx_serial";

 #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))

 	serial_driver.name = "tts/%d";

 #else

 	serial_driver.name = "ttyS";

 #endif

 	serial_driver.major = TTY_MAJOR;

-	serial_driver.minor_start = 64 + SERIAL_DEV_OFFSET;

+	serial_driver.minor_start = 64;

 	serial_driver.num = NR_PORTS;

 	serial_driver.type = TTY_DRIVER_TYPE_SERIAL;

 	serial_driver.subtype = SERIAL_TYPE_NORMAL;

@@ -2680,7 +2675,7 @@

 			continue;

 		}

 		printk(KERN_INFO "ttyS%02d%s at 0x%04lx (irq = %d) is a %s\n",

-		       state->line + SERIAL_DEV_OFFSET,

+		       state->line,

 		       (state->flags & ASYNC_FOURPORT) ? " FourPort" : "",

 		       state->port, state->irq,

 		       uart_config[state->type].name);

@@ -2711,7 +2706,7 @@

  *	On success the port is ready to use and the line number is returned.

  */

 

-int register_serial(struct serial_struct *req)

+int register_Au1xxx_serial(struct serial_struct *req)

 {

 	int i;

 	unsigned long flags;

@@ -2770,7 +2765,7 @@

 	spin_unlock_irqrestore(&serial_lock, flags);

 

        printk(KERN_INFO "ttyS%02d at %s 0x%04lx (irq = %d) is a %s\n",

-	      state->line + SERIAL_DEV_OFFSET,

+	      state->line,

 	      state->iomem_base ? "iomem" : "port",

 	      state->iomem_base ? (unsigned long)state->iomem_base :

 	      state->port, state->irq, uart_config[state->type].name);

@@ -2778,7 +2773,7 @@

 			   serial_driver.minor_start + state->line);

 	tty_register_devfs(&callout_driver, 0,

 			   callout_driver.minor_start + state->line);

-	return state->line + SERIAL_DEV_OFFSET;

+	return state->line;

 }

 

 /**

@@ -2790,7 +2785,7 @@

  *	the port number returned by register_serial().

  */

 

-void unregister_serial(int line)

+void unregister_Au1xxx_serial(int line)

 {

 	unsigned long flags;

 	struct serial_state *state = &rs_table[line];

@@ -2869,7 +2864,7 @@

 	unsigned int status, tmout = 0xffffff;

 

 	do {

-		status = serial_in(info, UART_LSR);

+		status = serial_in(info, AU_UART_LSR);

 

 		if (status & UART_LSR_BI)

 			lsr_break_flag = UART_LSR_BI;

@@ -2896,8 +2891,8 @@

 	/*

 	 *	First save the IER then disable the interrupts

 	 */

-	ier = serial_in(info, UART_IER);

-	serial_out(info, UART_IER, 0x00);

+	ier = serial_in(info, AU_UART_IER);

+	serial_out(info, AU_UART_IER, 0x00);

 

 	/*

 	 *	Now, do each character

@@ -2909,10 +2904,10 @@

 		 *	Send the character out.

 		 *	If a LF, also do CR...

 		 */

-		serial_out(info, UART_TX, *s);

+		serial_out(info, AU_UART_TX, *s);

 		if (*s == 10) {

 			wait_for_xmitr(info);

-			serial_out(info, UART_TX, 13);

+			serial_out(info, AU_UART_TX, 13);

 		}

 	}

 

@@ -2921,7 +2916,7 @@

 	 * 	and restore the IER

 	 */

 	wait_for_xmitr(info);

-	serial_out(info, UART_IER, ier);

+	serial_out(info, AU_UART_IER, ier);

 }

 

 /*

@@ -2939,16 +2934,16 @@

 	 *	that the real driver for the port does not get the

 	 *	character.

 	 */

-	ier = serial_in(info, UART_IER);

-	serial_out(info, UART_IER, 0x00);

+	ier = serial_in(info, AU_UART_IER);

+	serial_out(info, AU_UART_IER, 0x00);

  

-	while ((serial_in(info, UART_LSR) & UART_LSR_DR) == 0);

-	c = serial_in(info, UART_RX);

+	while ((serial_in(info, AU_UART_LSR) & UART_LSR_DR) == 0);

+	c = serial_in(info, AU_UART_RX);

 

 	/*

 	 *	Restore the interrupts

 	 */

-	serial_out(info, UART_IER, ier);

+	serial_out(info, AU_UART_IER, ier);

 

 	return c;

 }

@@ -3061,13 +3056,13 @@

 	 *	and set speed.

 	 */

 	serial_out(info, UART_CLK, quot & 0xffff);

-	serial_out(info, UART_IER, 0);

-	serial_out(info, UART_MCR, UART_MCR_DTR | UART_MCR_RTS);

+	serial_out(info, AU_UART_IER, 0);

+	serial_out(info, AU_UART_MCR, UART_MCR_DTR | UART_MCR_RTS);

 

 	/*

 	 *	If we read 0xff from the LSR, there is no UART here.

 	 */

-	if (serial_in(info, UART_LSR) == 0xff)

+	if (serial_in(info, AU_UART_LSR) == 0xff)

 		return -1;

 

 	return 0;

Index: drivers/char/serial.c

===================================================================

RCS file: /home/cvs/linux/drivers/char/Attic/serial.c,v

retrieving revision 1.62.2.10

diff -u -r1.62.2.10 serial.c

--- drivers/char/serial.c	15 Dec 2003 18:19:50 -0000	1.62.2.10

+++ drivers/char/serial.c	17 Nov 2004 11:03:15 -0000

@@ -242,11 +243,13 @@

 #include <asm/irq.h>

 #include <asm/bitops.h>

 

+#ifndef SERIAL_DEV_OFFSET

 #if defined(CONFIG_MAC_SERIAL)

 #define SERIAL_DEV_OFFSET	((_machine == _MACH_prep || _machine == _MACH_chrp) ? 0 : 2)

 #else

 #define SERIAL_DEV_OFFSET	0

 #endif

+#endif

 

 #ifdef SERIAL_INLINE

 #define _INLINE_ inline

@@ -5718,7 +5748,7 @@

 			   serial_driver.minor_start + state->line); 

 	tty_register_devfs(&callout_driver, 0,

 			   callout_driver.minor_start + state->line);

-	return state->line + SERIAL_DEV_OFFSET;

+	return state->line;

 }

 

 /**


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux