Skip to contentSkip to conversation

PPC4xx UART0 (8250) problem

PATCH In review Mikhail Zolotaryov 2 participants 3 messages Apr 7, 2007 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC4xx UART0 (8250) problem

On PPC4xx embedded we often have UART0 on IRQ0 but 8250 UART driver uses IRQ0 as "no irq" hack. It's suggested that platforms with UART on IRQ0 will redefine is_real_interrupt(irq) macro but 8250 code anyway overrides that. As the result, serial line on UART0 works on polling-way and we have character loss on high baud rates.

In patch I added check if UART0 is on IRQ0, if so we define is_real_interrupt macro to be 1 (true). Also, check if is_real_interrupt macro is already defined added to 8250 UART driver.

-------------------------------------------------------------------

include/asm-ppc/ibm4xx.h 2007-04-06 17:37:22.000000000 +0300 renamed from include/asm-ppc/ibm4xx.h 2007-03-23 21:52:51.000000000 +0200 +6 -0
@@ -54,6 +54,12 @@
 #include <platforms/4xx/xilinx_ml403.h>
 #endif
 
+#ifdef UART0_INT
+#if (UART0_INT == 0)
+#define is_real_interrupt(irq)  (1)
+#endif
+#endif
+
 #ifndef __ASSEMBLY__
 
 #ifdef CONFIG_40x
drivers/serial/8250.c 2007-04-06 16:44:32.000000000 +0300 renamed from drivers/serial/8250.c 2007-03-23 21:52:51.000000000 +0200 +2 -0
@@ -77,7 +77,9 @@
  * machine types want others as well - they're free
  * to redefine this in their header file.
  */
+#ifndef is_real_interrupt(irq)
 #define is_real_interrupt(irq)	((irq) != 0)
+#endif
 
 #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
 #define CONFIG_SERIAL_DETECT_IRQ 1
#1 lore raw
Quoted 10 lines · Mikhail Zolotaryov

On PPC4xx embedded we often have UART0 on IRQ0 but 8250 UART driver uses IRQ0 as "no irq" hack. It's suggested that platforms with UART on IRQ0 will redefine is_real_interrupt(irq) macro but 8250 code anyway overrides that. As the result, serial line on UART0 works on polling-way and we have character loss on high baud rates.

In patch I added check if UART0 is on IRQ0, if so we define is_real_interrupt macro to be 1 (true). Also, check if is_real_interrupt macro is already defined added to 8250 UART driver.

This is an old problem. The proper fix is already implemented for arch/powerpc and consist of having virtual irq numbers (which helps for many other things anyway).

Support for 4xx platforms in arch/powerpc is starting to get in, pop on [email protected] where the patches are being posted and you are welcome to give a hand porting more platforms over :-)

Ben.

#2 lore raw
Quoted 7 lines · Benjamin Herrenschmidt

This is an old problem. The proper fix is already implemented for arch/powerpc and consist of having virtual irq numbers (which helps for many other things anyway).

Support for 4xx platforms in arch/powerpc is starting to get in, pop on [email protected] where the patches are being posted and you are welcome to give a hand porting more platforms over :-)

First, thanks for response.

Ok, I see IRQ0 mapping to virtual number is good solution but I know the problem from the times of 2.4 kernel. It was very surprising while moving to 2.6 kernel - serial driver was changed, but we have the same problem there.

Maybe it's good idea to create unofficial ppc linux branch repository (or it already exists ?) where we can put patches that work (as above) but not in pretty good way linux community expects.