Skip to contentSkip to conversation

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

DISCUSSION rolf liu 4 participants 12 messages Jun 28, 2005 – Jul 5, 2005 MIPS

lore
Share & tools
lore

rolf liu

author
#0 lore raw

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?

thanks

#1 lore raw
Quoted 5 lines · rolf liu

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.

Signature · 1 line
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

asm-mips/au1000.h +10 -10
diff -u -r1.5.2.29 au1000.h
@@ -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

asm-mips/serial.h +1 -1
diff -u -r1.23.2.21 serial.h
@@ -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

char/au1x00-serial.c +89 -94

574 lines not on this page · raw message

Index: drivers/char/serial.c
===================================================================
RCS file: /home/cvs/linux/drivers/char/Attic/serial.c,v retrieving revision 1.62.2.10

char/serial.c +3 -1
diff -u -r1.62.2.10 serial.c
@@ -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;
 }
 
 /**
author
#2 lore raw

I did it and it is just stuck there. I have to use Ctrl-c to kill it. It seems no working :(

Quoted 20 lines · Jon Anders Haugum
Quoted 5 lines · rolf liu

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

author
#3 lore raw
In reply to Jon Anders Haugum

What is the real reason to disable the existing uart on db1550? I checked the PCI configuration for the multi-port board. It seems the configuration is ok, including the memory map, irq number. The linux can find such information and register this device, but it just can't work :(

thanks

Quoted 20 lines · Jon Anders Haugum
Quoted 5 lines · rolf liu

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

author
#4 lore raw
In reply to Jon Anders Haugum

Jon,
did you make the board work under 2.6.x? I tried to turn off the au1x00 uart, but the board does not work by just not using au1000.h. Any idea?

thanks

Quoted 20 lines · Jon Anders Haugum
Quoted 5 lines · rolf liu

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

#5 lore raw
In reply to rolf liu
Quoted 5 lines · rolf liu

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?

Do something like

cat /dev/ttySwhatever

then look at the IRQ list. The interrupt will only be allocated while the port is in use.

author
#6 lore raw

I checked again. When I cat sth to /dev/ttyM0 and it is stuck there, I cat /proc/interrupts, the interrupt number show up for that driver, but the number of interrupts for that driver is always 0, which seems not OK. I am wondering if such interrupt is routed to somewhere else? If that is possible, what is the most likely place, the au1x00_serial.c?

thanks

Quoted 15 lines · Alan Cox
Quoted 5 lines · rolf liu

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?

Do something like

cat /dev/ttySwhatever

then look at the IRQ list. The interrupt will only be allocated while the port is in use.

#7 lore raw
Quoted 2 lines · rolf liu

but the number of interrupts for that driver is always 0, which seems not OK. I am wondering if such interrupt is routed to somewhere else?

I'd expect it to stay zero unless characters were received or events occurred. Something like

(echo "Hello world"; cat ) <> /dev/ttywhatever

ought to cause interrupts

[That bit of script writes Hello world to the serial port and then copies anything from it back to it until you hit ^C]

author
#8 lore raw

Thanks for your help.
I tried your script. the result is really interesting.
the interrupt is still shown as 0 times. I even hacked into the do_IRQ and handle_IRQ_event, let them printk if there is a interrupt number 2 coming in. Still no printk output through klogd logfile. more interesting thing is there is a timer on the multi-port board, which is keeping time-out and keeping the timer interrupt up.

Is that possible the board is not enabled to interrupt correctly? really a pain. I just got the driver from the company. don't know what is the start point if I want to really dig into the hardware control of the board.

thanks

Quoted 15 lines · Alan Cox
Quoted 2 lines · rolf liu

but the number of interrupts for that driver is always 0, which seems not OK. I am wondering if such interrupt is routed to somewhere else?

I'd expect it to stay zero unless characters were received or events occurred. Something like

(echo "Hello world"; cat ) <> /dev/ttywhatever

ought to cause interrupts

[That bit of script writes Hello world to the serial port and then copies anything from it back to it until you hit ^C]

#9 lore raw
In reply to rolf liu
Quoted 5 lines · rolf liu

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?

Linux will only allocate the interrupt when the interface is actually opened, just loading the driver doesn't suffice.

Ralf

author
#10 lore raw

After some work, I found out the problem is the multi-port card is using some of macros defined in au1000.h, which is not supposed to do. I gave it a dirty hack by defining such macros in the source file.

Now I can see the interrupts coming up. BUT when I typed:
echo "hello world!">/dev/ttyM0
the message is shown on terminal connected to this serial port. But it then is stuck there. Then the rs_timer gives a lot of timeouts and enter the interrupt service routine each time there is timeout. rs_close() is never got called. any suggestion on this part?

What is the function of serial_timer? it is just sitting there, generating timeout, periodically. Just to make sure the interrupt routine will be called periodically?

thanks

Quoted 13 lines · Ralf Baechle
Quoted 5 lines · rolf liu

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?

Linux will only allocate the interrupt when the interface is actually opened, just loading the driver doesn't suffice.

Ralf

#11 lore raw
Quoted 3 lines · rolf liu

What is the function of serial_timer? it is just sitting there, generating timeout, periodically. Just to make sure the interrupt routine will be called periodically?

It's for interrupt-less ports.

Ralf