Port-powerpc archive

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

OpenPIC and sandpoint



Hi! all,


I have a question.
The OpenPIC always set OPENPIC_POLARITY_POSITIVE, if the variable irq == 0
in arch/powerpc/pic/pic_openpic.c::opic_establish_irq().

        x = irq;
        x |= OPENPIC_IMASK;
        x |= (irq == 0) ?
            OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE;
        x |= (type == IST_EDGE) ? OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL;
        :
        openpic_write(OPENPIC_SRC_VECTOR(irq), x);


However the variable irq is not hw-irq.  This reason is defined in
arch/powerpc/include/openpicreg.h.

  /* interrupt vector/priority reg */
  #ifndef OPENPIC_SRC_VECTOR
  #define OPENPIC_SRC_VECTOR(irq)         (0x10000 + (irq) * 0x20)
  #endif


And sandpoint defines in arch/sandpoint/include/openpicreg.h.

  #define OPENPIC_SRC_VECTOR(irq)         (epicsteer[(irq)])

And in machdep.c.

  unsigned epicsteer[] = {
          0x10200,        /* external irq 0 direct/serial */
          0x10220,        /* external irq 1 direct/serial */

Maybe we use it.  from the No.16.  The KURO-BOX(sandpoint) maps tlp(4)
to here.  The tlp(4) require OPENPIC_POLARITY_NEGATIVE.
Should I process our OpenPIC like this?


Index: arch/powerpc/pic/pic_openpic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/pic/pic_openpic.c,v
retrieving revision 1.5
diff -u -r1.5 pic_openpic.c
--- arch/powerpc/pic/pic_openpic.c      29 Apr 2008 06:53:02 -0000      1.5
+++ arch/powerpc/pic/pic_openpic.c      17 Jul 2009 18:36:45 -0000
@@ -144,7 +144,7 @@
 
        x = irq;
        x |= OPENPIC_IMASK;
-       x |= (irq == 0) ?
+       x |= (OPENPIC_SRC_VECTOR(irq) == 0x10000) ?
            OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE;
        x |= (type == IST_EDGE) ? OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL;
        x |= realpri << OPENPIC_PRIORITY_SHIFT;


Thanks,
--
kiyohara


Home | Main Index | Thread Index | Old Index