/* * intc.c -- support for the old ColdFire interrupt controller * * (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 mapping of irq number to a mask register bit is not one-to-one. * The irq numbers are either based on "level" of interrupt or fixed * for an autovector-able interrupt. So we keep a local data structure * that maps from irq to mask register. Not all interrupts will have * an IMR bit.
*/ unsignedchar mcf_irq2imr[NR_IRQS];
/* * Define the minimum and maximum external interrupt numbers. * This is also used as the "level" interrupt numbers.
*/ #define EIRQ1 25 #define EIRQ7 31
/* * In the early version 2 core ColdFire parts the IMR register was 16 bits * in size. Version 3 (and later version 2) core parts have a 32 bit * sized IMR register. Provide some size independent methods to access the * IMR register.
*/ #ifdef MCFSIM_IMR_IS_16BITS
/* * Interrupts can be "vectored" on the ColdFire cores that support this old * interrupt controller. That is, the device raising the interrupt can also * supply the vector number to interrupt through. The AVR register of the * interrupt controller enables or disables this for each external interrupt, * so provide generic support for this. Setting this up is out-of-band for * the interrupt system API's, and needs to be done by the driver that * supports this device. Very few devices actually use this.
*/ void mcf_autovector(int irq)
{ #ifdef MCFSIM_AVR if ((irq >= EIRQ1) && (irq <= EIRQ7)) {
u8 avec;
avec = __raw_readb(MCFSIM_AVR);
avec |= (0x1 << (irq - EIRQ1 + 1));
__raw_writeb(avec, MCFSIM_AVR);
} #endif
}
staticvoid intc_irq_mask(struct irq_data *d)
{ if (mcf_irq2imr[d->irq])
mcf_setimr(mcf_irq2imr[d->irq]);
}
staticvoid intc_irq_unmask(struct irq_data *d)
{ if (mcf_irq2imr[d->irq])
mcf_clrimr(mcf_irq2imr[d->irq]);
}
¤ 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.0.3Bemerkung:
¤
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.