/* * intc.c -- interrupt controller or ColdFire 5272 SoC * * (C) Copyright 2009, Greg Ungerer <gerg@snapgear.com> * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details.
*/
/* * The 5272 ColdFire interrupt controller is nothing like any other * ColdFire interrupt controller - it truly is completely different. * Given its age it is unlikely to be used on any other ColdFire CPU.
*/
/* * The masking and priproty setting of interrupts on the 5272 is done * via a set of 4 "Interrupt Controller Registers" (ICR). There is a * loose mapping of vector number to register and internal bits, but * a table is the easiest and quickest way to map them. * * Note that the external interrupts are edge triggered (unlike the * internal interrupt sources which are level triggered). Which means * they also need acknowledging via acknowledge bits.
*/ struct irqmap { unsignedint icr; unsignedchar index; unsignedchar ack;
};
/* * The act of masking the interrupt also has a side effect of 'ack'ing * an interrupt on this irq (for the external irqs). So this mask function * is also an ack_mask function.
*/ staticvoid intc_irq_mask(struct irq_data *d)
{ unsignedint irq = d->irq;
if ((irq >= MCFINT_VECBASE) && (irq <= MCFINT_VECMAX)) {
irq -= MCFINT_VECBASE; if (intc_irqmap[irq].ack) {
u32 v;
v = readl(MCFSIM_PITR); if (type == IRQ_TYPE_EDGE_FALLING)
v &= ~(0x1 << (32 - irq)); else
v |= (0x1 << (32 - irq));
writel(v, MCFSIM_PITR);
}
} return 0;
}
/* * Simple flow handler to deal with the external edge triggered interrupts. * We need to be careful with the masking/acking due to the side effects * of masking an interrupt.
*/ staticvoid intc_external_irq(struct irq_desc *desc)
{
irq_desc_get_chip(desc)->irq_ack(&desc->irq_data);
handle_simple_irq(desc);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.