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

[microblaze-uclinux] Uart Interrupts and Clock Inconsistencies



All,
This is my first post this mailing list, so please correct me if I mis-post
or screw up somehow.
I have noticed the clock running twice as fast as expected and in the course
of investigating and reading the mailing list archives ran across an issue
with the uart locking up in a lot of characters are cut and pasted to the
console.  The fix described in

http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/2005/02/msg00
058.html

does seem to work, but the reason appears to be a problem with the macros
IRQ_EDGE_SENSITIVE and IRQ_LEVEL_SENSITIVE being backwards.  I also am using
a change to microblaze_intc.c to acknowledge level sensitive interrupts
prior to re-enabling them.

The two patches I am using are as follows -- If I have missed something
(which is entirely possible) please let me know.


This patch only moves the interrupt enable to after the acknowledge.. seems
like common sense

--- ofc_src//uClinux-2.4.x/arch/microblaze/kernel/microblaze_intc.c
2005-01-24 18:01:55.00000
0000 -0600
+++ build//uClinux-2.4.x/arch/microblaze/kernel/microblaze_intc.c
2005-09-28 09:34:37.00000
0000 -0500
@@ -279,10 +279,10 @@
 void microblaze_intc_end(unsigned irq)
 {
        if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
-               microblaze_intc_enable_irq(irq);
                /* Level sensitive interrupts are acked after handling */

if(IRQ_LEVEL_SENSITIVE(irq,CONFIG_XILINX_INTC_0_KIND_OF_INTR))
                        microblaze_intc_ack_irq(irq);
+               microblaze_intc_enable_irq(irq);
        }
 }


This patch just flips the sense for EDGE/LEVEL determination. I verified
this from sense from the Xilinx mpd files for the uart and timer that are
used to generate the CONFIG_XILINX_INTC_0_KIND_OF_INTR constant in the
auto-config.in file

--- ofc_src//uClinux-2.4.x/include/asm-microblaze/microblaze_intc.h
2004-10-31 23:43:19.00000
0000 -0600
+++ build//uClinux-2.4.x/include/asm-microblaze/microblaze_intc.h
2005-09-29 19:46:49.00000
0000 -0500
@@ -25,11 +25,11 @@


 /* Test if an IRQ is edge or level sensitive */
-#define IRQ_LEVEL_SENSITIVE(irq,IRQ_KINDOFINTR)                        \
+#define IRQ_EDGE_SENSITIVE(irq,IRQ_KINDOFINTR)                 \
        ((1 << irq) & IRQ_KINDOFINTR)

-#define IRQ_EDGE_SENSITIVE(irq,IRQ_KINDOFINTR)                 \
-       (!IRQ_LEVEL_SENSITIVE(irq,IRQ_KINDOFINTR))
+#define IRQ_LEVEL_SENSITIVE(irq,IRQ_KINDOFINTR)                        \
+       (!IRQ_EDGE_SENSITIVE(irq,IRQ_KINDOFINTR))

 /* What sort of edge sensitive IRQ? */
 #define IRQ_RISING_EDGE(irq,IRQ_KINDOFEDGE)                    \


Once again if I have made any mistakes, please correct me.

Greg Martin



___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/