Port-powerpc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
New trigger types for OpenPIC
Hi!
We have many OpenPIC-based PICs in powerpc/pic, which also support
different polarities of level- and edge-triggers. So I suggest to extened
our trigger types like this (powerpc/include/intr.h):
/* Interrupt sharing types. */
#define IST_NONE 0 /* none */
#define IST_PULSE 1 /* pulsed */
#define IST_EDGE 2 /* edge-triggered */
#define IST_LEVEL 3 /* level-triggered */
/* new: */
#define IST_EDGE_FALLING IST_EDGE
#define IST_EDGE_RAISING 4
#define IST_LEVEL_LOW IST_LEVEL
#define IST_LEVEL_HIGH 5
Additionally I would change the PICs which support polarities as in the
following example for the mpcsoc PIC:
--- pic_mpcsoc.c 20 Jun 2011 06:21:45 -0000 1.2
+++ pic_mpcsoc.c 10 Jan 2012 13:04:01 -0000
@@ -161,9 +161,11 @@
x = irq;
x |= OPENPIC_IMASK;
- x |= (i8259iswired && irq == 0) ?
+ x |= ((i8259iswired && irq == 0) ||
+ type == IST_EDGE_RAISING || type == IST_LEVEL_HIGH) ?
OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE;
- x |= (type == IST_EDGE) ? OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL;
+ x |= (type == IST_EDGE_FALLING || type == IST_EDGE_RAISING) ?
+ OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL;
x |= realpri << OPENPIC_PRIORITY_SHIFT;
openpic_write(MPCPIC_IVEC(irq), x);
Existing code is not affected by this modification.
Are there any objections against it?
--
Frank Wille
Home |
Main Index |
Thread Index |
Old Index