* [PATCH] au1x00 serial real interrupt
@ 2006-05-22 16:52 Rodolfo Giometti
2006-09-05 15:19 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Rodolfo Giometti @ 2006-05-22 16:52 UTC (permalink / raw)
To: linux-mips
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
Hello.
Here my patch to enable real interrupts management for the au1x00
CPUs.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
[-- Attachment #2: patch-au1x00-serial-real-interrupt --]
[-- Type: text/plain, Size: 461 bytes --]
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 7b23664..0197062 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -11,6 +11,14 @@
#include <linux/config.h>
+#ifdef CONFIG_SOC_AU1X00
+/*
+ * We have to redefine "is_real_interrupt()" for Au1x00 CPUs...
+ */
+#undef is_real_interrupt
+#define is_real_interrupt(irq) ((irq) != ~0)
+#endif
+
/*
* This assumes you have a 1.8432 MHz clock for your UART.
*
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] au1x00 serial real interrupt
2006-05-22 16:52 [PATCH] au1x00 serial real interrupt Rodolfo Giometti
@ 2006-09-05 15:19 ` Sergei Shtylyov
2006-09-09 16:34 ` Sergei Shtylyov
0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2006-09-05 15:19 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Rodolfo Giometti, linux-mips, rmk+serial
Hello.
Rodolfo Giometti wrote:
> Here my patch to enable real interrupts management for the au1x00
> CPUs.
> ------------------------------------------------------------------------
>
> diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
> index 7b23664..0197062 100644
> --- a/include/asm-mips/serial.h
> +++ b/include/asm-mips/serial.h
> @@ -11,6 +11,14 @@
>
> #include <linux/config.h>
>
> +#ifdef CONFIG_SOC_AU1X00
> +/*
> + * We have to redefine "is_real_interrupt()" for Au1x00 CPUs...
> + */
> +#undef is_real_interrupt
> +#define is_real_interrupt(irq) ((irq) != ~0)
> +#endif
> +
> /*
> * This assumes you have a 1.8432 MHz clock for your UART.
> *
Ralf, how about this patch? Can it be applied, at least 3 months after
posting? Alchemy UART0 uses IRQ0 and 0 is treated as "no IRQ" by
drivers/serial/8250.c which says the macro should be redefined in
<asm/serial.h> if needed.
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] au1x00 serial real interrupt
2006-09-05 15:19 ` Sergei Shtylyov
@ 2006-09-09 16:34 ` Sergei Shtylyov
2006-09-09 16:39 ` Russell King
2006-09-18 20:13 ` Sergei Shtylyov
0 siblings, 2 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2006-09-09 16:34 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Rodolfo Giometti, linux-mips, rmk
Hello.
Sergei Shtylyov wrote:
>> ------------------------------------------------------------------------
>>
>> diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
>> index 7b23664..0197062 100644
>> --- a/include/asm-mips/serial.h
>> +++ b/include/asm-mips/serial.h
>> @@ -11,6 +11,14 @@
>>
>> #include <linux/config.h>
>>
>> +#ifdef CONFIG_SOC_AU1X00
>> +/*
>> + * We have to redefine "is_real_interrupt()" for Au1x00 CPUs...
>> + */
>> +#undef is_real_interrupt
>> +#define is_real_interrupt(irq) ((irq) != ~0)
>> +#endif
>> +
>> /*
>> * This assumes you have a 1.8432 MHz clock for your UART.
>> *
> Ralf, how about this patch? Can it be applied, at least 3 months
> after posting? Alchemy UART0 uses IRQ0 and 0 is treated as "no IRQ" by
> drivers/serial/8250.c which says the macro should be redefined in
> <asm/serial.h> if needed.
If the values other than 0 need to be filtered out, to be precise...
Well, after looking at drivers/serial/8250.c a bit more, I think this may
be even more simlified since that driver seems to treat the negative values as
completely invalid anyway. IOW, we can just:
#define is_real_interrupt(irq) 1
Russel, what do you think?
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] au1x00 serial real interrupt
2006-09-09 16:34 ` Sergei Shtylyov
@ 2006-09-09 16:39 ` Russell King
2006-09-09 16:58 ` Sergei Shtylyov
2006-09-14 18:10 ` Ralf Baechle
2006-09-18 20:13 ` Sergei Shtylyov
1 sibling, 2 replies; 7+ messages in thread
From: Russell King @ 2006-09-09 16:39 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: Ralf Baechle, Rodolfo Giometti, linux-mips
On Sat, Sep 09, 2006 at 08:34:28PM +0400, Sergei Shtylyov wrote:
> Well, after looking at drivers/serial/8250.c a bit more, I think this
> may be even more simlified since that driver seems to treat the negative
> values as completely invalid anyway. IOW, we can just:
>
> #define is_real_interrupt(irq) 1
>
> Russel, what do you think?
That's Russell 8)
Well, if you need IRQ0 to be real then redefining is_real_interrupt()
is the correct way forward.
However, Linus' policy is that IRQ0 shall be invalid at least on PCI
systems, and architectures _should_ remap their real IRQ0 to some other
number. Personally I don't like this. Hence why I prefer to give people
the option.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] au1x00 serial real interrupt
2006-09-09 16:39 ` Russell King
@ 2006-09-09 16:58 ` Sergei Shtylyov
2006-09-14 18:10 ` Ralf Baechle
1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2006-09-09 16:58 UTC (permalink / raw)
To: Russell King; +Cc: Sergei Shtylyov, Ralf Baechle, Rodolfo Giometti, linux-mips
Hello.
Russell King wrote:
>> Well, after looking at drivers/serial/8250.c a bit more, I think this
>> may be even more simlified since that driver seems to treat the negative
>>values as completely invalid anyway. IOW, we can just:
>>#define is_real_interrupt(irq) 1
>> Russel, what do you think?
> That's Russell 8)
I'm sorry. :-)
> Well, if you need IRQ0 to be real then redefining is_real_interrupt()
> is the correct way forward.
> However, Linus' policy is that IRQ0 shall be invalid at least on PCI
> systems, and architectures _should_ remap their real IRQ0 to some other
> number.
Hm, given that NO_IRQ is #defined as -1 (when it's defined at all)...
> Personally I don't like this.
Hm, me neither but I can undestand the reasoning. 0 is the usual default
value of the PCI interrupt line register, meaning interrupt is unassigned.
> Hence why I prefer to give people the option.
Thanks for the explanation.
Would be better probably to have that #define in 8250.c going after
#include <asm/serial.h> but as this seems the first and only case of the
override needed, it's good enough this way. :-)
As for the PCI UARTs possibly plugged into Alchemy board, I really don't
know... This macro has no provision to check for the UART type. So, skipping
its invocation in 8250.c for UPIO_AU case might be a better (though not
cleaner) solution...
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] au1x00 serial real interrupt
2006-09-09 16:39 ` Russell King
2006-09-09 16:58 ` Sergei Shtylyov
@ 2006-09-14 18:10 ` Ralf Baechle
1 sibling, 0 replies; 7+ messages in thread
From: Ralf Baechle @ 2006-09-14 18:10 UTC (permalink / raw)
To: Russell King; +Cc: Sergei Shtylyov, Rodolfo Giometti, linux-mips
On Sat, Sep 09, 2006 at 05:39:07PM +0100, Russell King wrote:
> Well, if you need IRQ0 to be real then redefining is_real_interrupt()
> is the correct way forward.
>
> However, Linus' policy is that IRQ0 shall be invalid at least on PCI
> systems, and architectures _should_ remap their real IRQ0 to some other
> number. Personally I don't like this. Hence why I prefer to give people
> the option.
I have no strong opinion either. In some cases not having interrupt 0
available sucks because Linux will have to use a different interrupt
numbering than system documentation ...
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] au1x00 serial real interrupt
2006-09-09 16:34 ` Sergei Shtylyov
2006-09-09 16:39 ` Russell King
@ 2006-09-18 20:13 ` Sergei Shtylyov
1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2006-09-18 20:13 UTC (permalink / raw)
To: Rodolfo Giometti; +Cc: linux-mips
Hello.
Sergei Shtylyov wrote:
>>> diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
>>> index 7b23664..0197062 100644
>>> --- a/include/asm-mips/serial.h
>>> +++ b/include/asm-mips/serial.h
>>> @@ -11,6 +11,14 @@
>>>
>>> #include <linux/config.h>
>>>
>>> +#ifdef CONFIG_SOC_AU1X00
>>> +/*
>>> + * We have to redefine "is_real_interrupt()" for Au1x00 CPUs...
>>> + */
>>> +#undef is_real_interrupt
>>> +#define is_real_interrupt(irq) ((irq) != ~0)
>>> +#endif
>>> +
>>> /*
>>> * This assumes you have a 1.8432 MHz clock for your UART.
>>> *
> Well, after looking at drivers/serial/8250.c a bit more, I think this
> may be even more simlified since that driver seems to treat the negative
> values as completely invalid anyway. IOW, we can just:
> #define is_real_interrupt(irq) 1
Rodolfo, can you do this (possibly adding more elaborate comment about
UART0 using IRQ0)?
WBR, Sergei
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-09-18 20:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-22 16:52 [PATCH] au1x00 serial real interrupt Rodolfo Giometti
2006-09-05 15:19 ` Sergei Shtylyov
2006-09-09 16:34 ` Sergei Shtylyov
2006-09-09 16:39 ` Russell King
2006-09-09 16:58 ` Sergei Shtylyov
2006-09-14 18:10 ` Ralf Baechle
2006-09-18 20:13 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox