123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344 |
- /*
- * File: arch/blackfin/mach-common/ints-priority.c
- *
- * Description: Set up the interrupt priorities
- *
- * Modified:
- * 1996 Roman Zippel
- * 1999 D. Jeff Dionne <jeff@uclinux.org>
- * 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * 2003 Metrowerks/Motorola
- * 2003 Bas Vermeulen <bas@buyways.nl>
- * Copyright 2004-2008 Analog Devices Inc.
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
- #include <linux/module.h>
- #include <linux/kernel_stat.h>
- #include <linux/seq_file.h>
- #include <linux/irq.h>
- #ifdef CONFIG_IPIPE
- #include <linux/ipipe.h>
- #endif
- #ifdef CONFIG_KGDB
- #include <linux/kgdb.h>
- #endif
- #include <asm/traps.h>
- #include <asm/blackfin.h>
- #include <asm/gpio.h>
- #include <asm/irq_handler.h>
- #define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
- #ifdef BF537_FAMILY
- # define BF537_GENERIC_ERROR_INT_DEMUX
- #else
- # undef BF537_GENERIC_ERROR_INT_DEMUX
- #endif
- /*
- * NOTES:
- * - we have separated the physical Hardware interrupt from the
- * levels that the LINUX kernel sees (see the description in irq.h)
- * -
- */
- #ifndef CONFIG_SMP
- /* Initialize this to an actual value to force it into the .data
- * section so that we know it is properly initialized at entry into
- * the kernel but before bss is initialized to zero (which is where
- * it would live otherwise). The 0x1f magic represents the IRQs we
- * cannot actually mask out in hardware.
- */
- unsigned long bfin_irq_flags = 0x1f;
- EXPORT_SYMBOL(bfin_irq_flags);
- #endif
- /* The number of spurious interrupts */
- atomic_t num_spurious;
- #ifdef CONFIG_PM
- unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */
- unsigned vr_wakeup;
- #endif
- struct ivgx {
- /* irq number for request_irq, available in mach-bf5xx/irq.h */
- unsigned int irqno;
- /* corresponding bit in the SIC_ISR register */
- unsigned int isrflag;
- } ivg_table[NR_PERI_INTS];
- struct ivg_slice {
- /* position of first irq in ivg_table for given ivg */
- struct ivgx *ifirst;
- struct ivgx *istop;
- } ivg7_13[IVG13 - IVG7 + 1];
- /*
- * Search SIC_IAR and fill tables with the irqvalues
- * and their positions in the SIC_ISR register.
- */
- static void __init search_IAR(void)
- {
- unsigned ivg, irq_pos = 0;
- for (ivg = 0; ivg <= IVG13 - IVG7; ivg++) {
- int irqn;
- ivg7_13[ivg].istop = ivg7_13[ivg].ifirst = &ivg_table[irq_pos];
- for (irqn = 0; irqn < NR_PERI_INTS; irqn++) {
- int iar_shift = (irqn & 7) * 4;
- if (ivg == (0xf &
- #if defined(CONFIG_BF52x) || defined(CONFIG_BF538) \
- || defined(CONFIG_BF539) || defined(CONFIG_BF51x)
- bfin_read32((unsigned long *)SIC_IAR0 +
- ((irqn % 32) >> 3) + ((irqn / 32) *
- ((SIC_IAR4 - SIC_IAR0) / 4))) >> iar_shift)) {
- #else
- bfin_read32((unsigned long *)SIC_IAR0 +
- (irqn >> 3)) >> iar_shift)) {
- #endif
- ivg_table[irq_pos].irqno = IVG7 + irqn;
- ivg_table[irq_pos].isrflag = 1 << (irqn % 32);
- ivg7_13[ivg].istop++;
- irq_pos++;
- }
- }
- }
- }
- /*
- * This is for core internal IRQs
- */
- static void bfin_ack_noop(unsigned int irq)
- {
- /* Dummy function. */
- }
- static void bfin_core_mask_irq(unsigned int irq)
- {
- bfin_irq_flags &= ~(1 << irq);
- if (!irqs_disabled_hw())
- local_irq_enable_hw();
- }
- static void bfin_core_unmask_irq(unsigned int irq)
- {
- bfin_irq_flags |= 1 << irq;
- /*
- * If interrupts are enabled, IMASK must contain the same value
- * as bfin_irq_flags. Make sure that invariant holds. If interrupts
- * are currently disabled we need not do anything; one of the
- * callers will take care of setting IMASK to the proper value
- * when reenabling interrupts.
- * local_irq_enable just does "STI bfin_irq_flags", so it's exactly
- * what we need.
- */
- if (!irqs_disabled_hw())
- local_irq_enable_hw();
- return;
- }
- static void bfin_internal_mask_irq(unsigned int irq)
- {
- #ifdef CONFIG_BF53x
- bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() &
- ~(1 << SIC_SYSIRQ(irq)));
- #else
- unsigned mask_bank, mask_bit;
- mask_bank = SIC_SYSIRQ(irq) / 32;
- mask_bit = SIC_SYSIRQ(irq) % 32;
- bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &
- ~(1 << mask_bit));
- #ifdef CONFIG_SMP
- bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) &
- ~(1 << mask_bit));
- #endif
- #endif
- }
- static void bfin_internal_unmask_irq(unsigned int irq)
- {
- #ifdef CONFIG_BF53x
- bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() |
- (1 << SIC_SYSIRQ(irq)));
- #else
- unsigned mask_bank, mask_bit;
- mask_bank = SIC_SYSIRQ(irq) / 32;
- mask_bit = SIC_SYSIRQ(irq) % 32;
- bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
- (1 << mask_bit));
- #ifdef CONFIG_SMP
- bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) |
- (1 << mask_bit));
- #endif
- #endif
- }
- #ifdef CONFIG_PM
- int bfin_internal_set_wake(unsigned int irq, unsigned int state)
- {
- u32 bank, bit, wakeup = 0;
- unsigned long flags;
- bank = SIC_SYSIRQ(irq) / 32;
- bit = SIC_SYSIRQ(irq) % 32;
- switch (irq) {
- #ifdef IRQ_RTC
- case IRQ_RTC:
- wakeup |= WAKE;
- break;
- #endif
- #ifdef IRQ_CAN0_RX
- case IRQ_CAN0_RX:
- wakeup |= CANWE;
- break;
- #endif
- #ifdef IRQ_CAN1_RX
- case IRQ_CAN1_RX:
- wakeup |= CANWE;
- break;
- #endif
- #ifdef IRQ_USB_INT0
- case IRQ_USB_INT0:
- wakeup |= USBWE;
- break;
- #endif
- #ifdef IRQ_KEY
- case IRQ_KEY:
- wakeup |= KPADWE;
- break;
- #endif
- #ifdef CONFIG_BF54x
- case IRQ_CNT:
- wakeup |= ROTWE;
- break;
- #endif
- default:
- break;
- }
- local_irq_save_hw(flags);
- if (state) {
- bfin_sic_iwr[bank] |= (1 << bit);
- vr_wakeup |= wakeup;
- } else {
- bfin_sic_iwr[bank] &= ~(1 << bit);
- vr_wakeup &= ~wakeup;
- }
- local_irq_restore_hw(flags);
- return 0;
- }
- #endif
- static struct irq_chip bfin_core_irqchip = {
- .name = "CORE",
- .ack = bfin_ack_noop,
- .mask = bfin_core_mask_irq,
- .unmask = bfin_core_unmask_irq,
- };
- static struct irq_chip bfin_internal_irqchip = {
- .name = "INTN",
- .ack = bfin_ack_noop,
- .mask = bfin_internal_mask_irq,
- .unmask = bfin_internal_unmask_irq,
- .mask_ack = bfin_internal_mask_irq,
- .disable = bfin_internal_mask_irq,
- .enable = bfin_internal_unmask_irq,
- #ifdef CONFIG_PM
- .set_wake = bfin_internal_set_wake,
- #endif
- };
- static void bfin_handle_irq(unsigned irq)
- {
- #ifdef CONFIG_IPIPE
- struct pt_regs regs; /* Contents not used. */
- ipipe_trace_irq_entry(irq);
- __ipipe_handle_irq(irq, ®s);
- ipipe_trace_irq_exit(irq);
- #else /* !CONFIG_IPIPE */
- struct irq_desc *desc = irq_desc + irq;
- desc->handle_irq(irq, desc);
- #endif /* !CONFIG_IPIPE */
- }
- #ifdef BF537_GENERIC_ERROR_INT_DEMUX
- static int error_int_mask;
- static void bfin_generic_error_mask_irq(unsigned int irq)
- {
- error_int_mask &= ~(1L << (irq - IRQ_PPI_ERROR));
- if (!error_int_mask)
- bfin_internal_mask_irq(IRQ_GENERIC_ERROR);
- }
- static void bfin_generic_error_unmask_irq(unsigned int irq)
- {
- bfin_internal_unmask_irq(IRQ_GENERIC_ERROR);
- error_int_mask |= 1L << (irq - IRQ_PPI_ERROR);
- }
- static struct irq_chip bfin_generic_error_irqchip = {
- .name = "ERROR",
- .ack = bfin_ack_noop,
- .mask_ack = bfin_generic_error_mask_irq,
- .mask = bfin_generic_error_mask_irq,
- .unmask = bfin_generic_error_unmask_irq,
- };
- static void bfin_demux_error_irq(unsigned int int_err_irq,
- struct irq_desc *inta_desc)
- {
- int irq = 0;
- #if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
- if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK)
- irq = IRQ_MAC_ERROR;
- else
- #endif
- if (bfin_read_SPORT0_STAT() & SPORT_ERR_MASK)
- irq = IRQ_SPORT0_ERROR;
- else if (bfin_read_SPORT1_STAT() & SPORT_ERR_MASK)
- irq = IRQ_SPORT1_ERROR;
- else if (bfin_read_PPI_STATUS() & PPI_ERR_MASK)
- irq = IRQ_PPI_ERROR;
- else if (bfin_read_CAN_GIF() & CAN_ERR_MASK)
- irq = IRQ_CAN_ERROR;
- else if (bfin_read_SPI_STAT() & SPI_ERR_MASK)
- irq = IRQ_SPI_ERROR;
- else if ((bfin_read_UART0_IIR() & UART_ERR_MASK_STAT1) &&
- (bfin_read_UART0_IIR() & UART_ERR_MASK_STAT0))
- irq = IRQ_UART0_ERROR;
- else if ((bfin_read_UART1_IIR() & UART_ERR_MASK_STAT1) &&
- (bfin_read_UART1_IIR() & UART_ERR_MASK_STAT0))
- irq = IRQ_UART1_ERROR;
- if (irq) {
- if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR)))
- bfin_handle_irq(irq);
- else {
- switch (irq) {
- case IRQ_PPI_ERROR:
- bfin_write_PPI_STATUS(PPI_ERR_MASK);
- break;
- #if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
- case IRQ_MAC_ERROR:
- bfin_write_EMAC_SYSTAT(EMAC_ERR_MASK);
- break;
- #endif
- case IRQ_SPORT0_ERROR:
- bfin_write_SPORT0_STAT(SPORT_ERR_MASK);
- break;
- case IRQ_SPORT1_ERROR:
- bfin_write_SPORT1_STAT(SPORT_ERR_MASK);
- break;
- case IRQ_CAN_ERROR:
- bfin_write_CAN_GIS(CAN_ERR_MASK);
- break;
- case IRQ_SPI_ERROR:
- bfin_write_SPI_STAT(SPI_ERR_MASK);
- break;
- default:
- break;
- }
- pr_debug("IRQ %d:"
- " MASKED PERIPHERAL ERROR INTERRUPT ASSERTED\n",
- irq);
- }
- } else
- printk(KERN_ERR
- "%s : %s : LINE %d :\nIRQ ?: PERIPHERAL ERROR"
- " INTERRUPT ASSERTED BUT NO SOURCE FOUND\n",
- __func__, __FILE__, __LINE__);
- }
- #endif /* BF537_GENERIC_ERROR_INT_DEMUX */
- static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
- {
- #ifdef CONFIG_IPIPE
- _set_irq_handler(irq, handle_edge_irq);
- #else
- struct irq_desc *desc = irq_desc + irq;
- /* May not call generic set_irq_handler() due to spinlock
- recursion. */
- desc->handle_irq = handle;
- #endif
- }
- static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
- extern void bfin_gpio_irq_prepare(unsigned gpio);
- #if !defined(CONFIG_BF54x)
- static void bfin_gpio_ack_irq(unsigned int irq)
- {
- /* AFAIK ack_irq in case mask_ack is provided
- * get's only called for edge sense irqs
- */
- set_gpio_data(irq_to_gpio(irq), 0);
- }
- static void bfin_gpio_mask_ack_irq(unsigned int irq)
- {
- struct irq_desc *desc = irq_desc + irq;
- u32 gpionr = irq_to_gpio(irq);
- if (desc->handle_irq == handle_edge_irq)
- set_gpio_data(gpionr, 0);
- set_gpio_maska(gpionr, 0);
- }
- static void bfin_gpio_mask_irq(unsigned int irq)
- {
- set_gpio_maska(irq_to_gpio(irq), 0);
- }
- static void bfin_gpio_unmask_irq(unsigned int irq)
- {
- set_gpio_maska(irq_to_gpio(irq), 1);
- }
- static unsigned int bfin_gpio_irq_startup(unsigned int irq)
- {
- u32 gpionr = irq_to_gpio(irq);
- if (__test_and_set_bit(gpionr, gpio_enabled))
- bfin_gpio_irq_prepare(gpionr);
- bfin_gpio_unmask_irq(irq);
- return 0;
- }
- static void bfin_gpio_irq_shutdown(unsigned int irq)
- {
- u32 gpionr = irq_to_gpio(irq);
- bfin_gpio_mask_irq(irq);
- __clear_bit(gpionr, gpio_enabled);
- bfin_gpio_irq_free(gpionr);
- }
- static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
- {
- int ret;
- char buf[16];
- u32 gpionr = irq_to_gpio(irq);
- if (type == IRQ_TYPE_PROBE) {
- /* only probe unenabled GPIO interrupt lines */
- if (__test_bit(gpionr, gpio_enabled))
- return 0;
- type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
- }
- if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
- IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
- snprintf(buf, 16, "gpio-irq%d", irq);
- ret = bfin_gpio_irq_request(gpionr, buf);
- if (ret)
- return ret;
- if (__test_and_set_bit(gpionr, gpio_enabled))
- bfin_gpio_irq_prepare(gpionr);
- } else {
- __clear_bit(gpionr, gpio_enabled);
- return 0;
- }
- set_gpio_inen(gpionr, 0);
- set_gpio_dir(gpionr, 0);
- if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
- == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
- set_gpio_both(gpionr, 1);
- else
- set_gpio_both(gpionr, 0);
- if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
- set_gpio_polar(gpionr, 1); /* low or falling edge denoted by one */
- else
- set_gpio_polar(gpionr, 0); /* high or rising edge denoted by zero */
- if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
- set_gpio_edge(gpionr, 1);
- set_gpio_inen(gpionr, 1);
- set_gpio_data(gpionr, 0);
- } else {
- set_gpio_edge(gpionr, 0);
- set_gpio_inen(gpionr, 1);
- }
- if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
- bfin_set_irq_handler(irq, handle_edge_irq);
- else
- bfin_set_irq_handler(irq, handle_level_irq);
- return 0;
- }
- #ifdef CONFIG_PM
- int bfin_gpio_set_wake(unsigned int irq, unsigned int state)
- {
- unsigned gpio = irq_to_gpio(irq);
- if (state)
- gpio_pm_wakeup_request(gpio, PM_WAKE_IGNORE);
- else
- gpio_pm_wakeup_free(gpio);
- return 0;
- }
- #endif
- static void bfin_demux_gpio_irq(unsigned int inta_irq,
- struct irq_desc *desc)
- {
- unsigned int i, gpio, mask, irq, search = 0;
- switch (inta_irq) {
- #if defined(CONFIG_BF53x)
- case IRQ_PROG_INTA:
- irq = IRQ_PF0;
- search = 1;
- break;
- # if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
- case IRQ_MAC_RX:
- irq = IRQ_PH0;
- break;
- # endif
- #elif defined(CONFIG_BF538) || defined(CONFIG_BF539)
- case IRQ_PORTF_INTA:
- irq = IRQ_PF0;
- break;
- #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
- case IRQ_PORTF_INTA:
- irq = IRQ_PF0;
- break;
- case IRQ_PORTG_INTA:
- irq = IRQ_PG0;
- break;
- case IRQ_PORTH_INTA:
- irq = IRQ_PH0;
- break;
- #elif defined(CONFIG_BF561)
- case IRQ_PROG0_INTA:
- irq = IRQ_PF0;
- break;
- case IRQ_PROG1_INTA:
- irq = IRQ_PF16;
- break;
- case IRQ_PROG2_INTA:
- irq = IRQ_PF32;
- break;
- #endif
- default:
- BUG();
- return;
- }
- if (search) {
- for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
- irq += i;
- mask = get_gpiop_data(i) & get_gpiop_maska(i);
- while (mask) {
- if (mask & 1)
- bfin_handle_irq(irq);
- irq++;
- mask >>= 1;
- }
- }
- } else {
- gpio = irq_to_gpio(irq);
- mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio);
- do {
- if (mask & 1)
- bfin_handle_irq(irq);
- irq++;
- mask >>= 1;
- } while (mask);
- }
- }
- #else /* CONFIG_BF54x */
- #define NR_PINT_SYS_IRQS 4
- #define NR_PINT_BITS 32
- #define NR_PINTS 160
- #define IRQ_NOT_AVAIL 0xFF
- #define PINT_2_BANK(x) ((x) >> 5)
- #define PINT_2_BIT(x) ((x) & 0x1F)
- #define PINT_BIT(x) (1 << (PINT_2_BIT(x)))
- static unsigned char irq2pint_lut[NR_PINTS];
- static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
- struct pin_int_t {
- unsigned int mask_set;
- unsigned int mask_clear;
- unsigned int request;
- unsigned int assign;
- unsigned int edge_set;
- unsigned int edge_clear;
- unsigned int invert_set;
- unsigned int invert_clear;
- unsigned int pinstate;
- unsigned int latch;
- };
- static struct pin_int_t *pint[NR_PINT_SYS_IRQS] = {
- (struct pin_int_t *)PINT0_MASK_SET,
- (struct pin_int_t *)PINT1_MASK_SET,
- (struct pin_int_t *)PINT2_MASK_SET,
- (struct pin_int_t *)PINT3_MASK_SET,
- };
- inline unsigned int get_irq_base(u32 bank, u8 bmap)
- {
- unsigned int irq_base;
- if (bank < 2) { /*PA-PB */
- irq_base = IRQ_PA0 + bmap * 16;
- } else { /*PC-PJ */
- irq_base = IRQ_PC0 + bmap * 16;
- }
- return irq_base;
- }
- /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
- void init_pint_lut(void)
- {
- u16 bank, bit, irq_base, bit_pos;
- u32 pint_assign;
- u8 bmap;
- memset(irq2pint_lut, IRQ_NOT_AVAIL, sizeof(irq2pint_lut));
- for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) {
- pint_assign = pint[bank]->assign;
- for (bit = 0; bit < NR_PINT_BITS; bit++) {
- bmap = (pint_assign >> ((bit / 8) * 8)) & 0xFF;
- irq_base = get_irq_base(bank, bmap);
- irq_base += (bit % 8) + ((bit / 8) & 1 ? 8 : 0);
- bit_pos = bit + bank * NR_PINT_BITS;
- pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
- irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
- }
- }
- }
- static void bfin_gpio_ack_irq(unsigned int irq)
- {
- struct irq_desc *desc = irq_desc + irq;
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- u32 pintbit = PINT_BIT(pint_val);
- u32 bank = PINT_2_BANK(pint_val);
- if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
- if (pint[bank]->invert_set & pintbit)
- pint[bank]->invert_clear = pintbit;
- else
- pint[bank]->invert_set = pintbit;
- }
- pint[bank]->request = pintbit;
- }
- static void bfin_gpio_mask_ack_irq(unsigned int irq)
- {
- struct irq_desc *desc = irq_desc + irq;
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- u32 pintbit = PINT_BIT(pint_val);
- u32 bank = PINT_2_BANK(pint_val);
- if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
- if (pint[bank]->invert_set & pintbit)
- pint[bank]->invert_clear = pintbit;
- else
- pint[bank]->invert_set = pintbit;
- }
- pint[bank]->request = pintbit;
- pint[bank]->mask_clear = pintbit;
- }
- static void bfin_gpio_mask_irq(unsigned int irq)
- {
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val);
- }
- static void bfin_gpio_unmask_irq(unsigned int irq)
- {
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- u32 pintbit = PINT_BIT(pint_val);
- u32 bank = PINT_2_BANK(pint_val);
- pint[bank]->request = pintbit;
- pint[bank]->mask_set = pintbit;
- }
- static unsigned int bfin_gpio_irq_startup(unsigned int irq)
- {
- u32 gpionr = irq_to_gpio(irq);
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- if (pint_val == IRQ_NOT_AVAIL) {
- printk(KERN_ERR
- "GPIO IRQ %d :Not in PINT Assign table "
- "Reconfigure Interrupt to Port Assignemt\n", irq);
- return -ENODEV;
- }
- if (__test_and_set_bit(gpionr, gpio_enabled))
- bfin_gpio_irq_prepare(gpionr);
- bfin_gpio_unmask_irq(irq);
- return 0;
- }
- static void bfin_gpio_irq_shutdown(unsigned int irq)
- {
- u32 gpionr = irq_to_gpio(irq);
- bfin_gpio_mask_irq(irq);
- __clear_bit(gpionr, gpio_enabled);
- bfin_gpio_irq_free(gpionr);
- }
- static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
- {
- int ret;
- char buf[16];
- u32 gpionr = irq_to_gpio(irq);
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- u32 pintbit = PINT_BIT(pint_val);
- u32 bank = PINT_2_BANK(pint_val);
- if (pint_val == IRQ_NOT_AVAIL)
- return -ENODEV;
- if (type == IRQ_TYPE_PROBE) {
- /* only probe unenabled GPIO interrupt lines */
- if (__test_bit(gpionr, gpio_enabled))
- return 0;
- type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
- }
- if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
- IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
- snprintf(buf, 16, "gpio-irq%d", irq);
- ret = bfin_gpio_irq_request(gpionr, buf);
- if (ret)
- return ret;
- if (__test_and_set_bit(gpionr, gpio_enabled))
- bfin_gpio_irq_prepare(gpionr);
- } else {
- __clear_bit(gpionr, gpio_enabled);
- return 0;
- }
- if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
- pint[bank]->invert_set = pintbit; /* low or falling edge denoted by one */
- else
- pint[bank]->invert_clear = pintbit; /* high or rising edge denoted by zero */
- if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
- == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
- if (gpio_get_value(gpionr))
- pint[bank]->invert_set = pintbit;
- else
- pint[bank]->invert_clear = pintbit;
- }
- if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
- pint[bank]->edge_set = pintbit;
- bfin_set_irq_handler(irq, handle_edge_irq);
- } else {
- pint[bank]->edge_clear = pintbit;
- bfin_set_irq_handler(irq, handle_level_irq);
- }
- return 0;
- }
- #ifdef CONFIG_PM
- u32 pint_saved_masks[NR_PINT_SYS_IRQS];
- u32 pint_wakeup_masks[NR_PINT_SYS_IRQS];
- int bfin_gpio_set_wake(unsigned int irq, unsigned int state)
- {
- u32 pint_irq;
- u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
- u32 bank = PINT_2_BANK(pint_val);
- u32 pintbit = PINT_BIT(pint_val);
- switch (bank) {
- case 0:
- pint_irq = IRQ_PINT0;
- break;
- case 2:
- pint_irq = IRQ_PINT2;
- break;
- case 3:
- pint_irq = IRQ_PINT3;
- break;
- case 1:
- pint_irq = IRQ_PINT1;
- break;
- default:
- return -EINVAL;
- }
- bfin_internal_set_wake(pint_irq, state);
- if (state)
- pint_wakeup_masks[bank] |= pintbit;
- else
- pint_wakeup_masks[bank] &= ~pintbit;
- return 0;
- }
- u32 bfin_pm_setup(void)
- {
- u32 val, i;
- for (i = 0; i < NR_PINT_SYS_IRQS; i++) {
- val = pint[i]->mask_clear;
- pint_saved_masks[i] = val;
- if (val ^ pint_wakeup_masks[i]) {
- pint[i]->mask_clear = val;
- pint[i]->mask_set = pint_wakeup_masks[i];
- }
- }
- return 0;
- }
- void bfin_pm_restore(void)
- {
- u32 i, val;
- for (i = 0; i < NR_PINT_SYS_IRQS; i++) {
- val = pint_saved_masks[i];
- if (val ^ pint_wakeup_masks[i]) {
- pint[i]->mask_clear = pint[i]->mask_clear;
- pint[i]->mask_set = val;
- }
- }
- }
- #endif
- static void bfin_demux_gpio_irq(unsigned int inta_irq,
- struct irq_desc *desc)
- {
- u32 bank, pint_val;
- u32 request, irq;
- switch (inta_irq) {
- case IRQ_PINT0:
- bank = 0;
- break;
- case IRQ_PINT2:
- bank = 2;
- break;
- case IRQ_PINT3:
- bank = 3;
- break;
- case IRQ_PINT1:
- bank = 1;
- break;
- default:
- return;
- }
- pint_val = bank * NR_PINT_BITS;
- request = pint[bank]->request;
- while (request) {
- if (request & 1) {
- irq = pint2irq_lut[pint_val] + SYS_IRQS;
- bfin_handle_irq(irq);
- }
- pint_val++;
- request >>= 1;
- }
- }
- #endif
- static struct irq_chip bfin_gpio_irqchip = {
- .name = "GPIO",
- .ack = bfin_gpio_ack_irq,
- .mask = bfin_gpio_mask_irq,
- .mask_ack = bfin_gpio_mask_ack_irq,
- .unmask = bfin_gpio_unmask_irq,
- .disable = bfin_gpio_mask_irq,
- .enable = bfin_gpio_unmask_irq,
- .set_type = bfin_gpio_irq_type,
- .startup = bfin_gpio_irq_startup,
- .shutdown = bfin_gpio_irq_shutdown,
- #ifdef CONFIG_PM
- .set_wake = bfin_gpio_set_wake,
- #endif
- };
- void __cpuinit init_exception_vectors(void)
- {
- /* cannot program in software:
- * evt0 - emulation (jtag)
- * evt1 - reset
- */
- bfin_write_EVT2(evt_nmi);
- bfin_write_EVT3(trap);
- bfin_write_EVT5(evt_ivhw);
- bfin_write_EVT6(evt_timer);
- bfin_write_EVT7(evt_evt7);
- bfin_write_EVT8(evt_evt8);
- bfin_write_EVT9(evt_evt9);
- bfin_write_EVT10(evt_evt10);
- bfin_write_EVT11(evt_evt11);
- bfin_write_EVT12(evt_evt12);
- bfin_write_EVT13(evt_evt13);
- bfin_write_EVT14(evt14_softirq);
- bfin_write_EVT15(evt_system_call);
- CSYNC();
- }
- /*
- * This function should be called during kernel startup to initialize
- * the BFin IRQ handling routines.
- */
- int __init init_arch_irq(void)
- {
- int irq;
- unsigned long ilat = 0;
- /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
- #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
- || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
- bfin_write_SIC_IMASK0(SIC_UNMASK_ALL);
- bfin_write_SIC_IMASK1(SIC_UNMASK_ALL);
- # ifdef CONFIG_BF54x
- bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
- # endif
- # ifdef CONFIG_SMP
- bfin_write_SICB_IMASK0(SIC_UNMASK_ALL);
- bfin_write_SICB_IMASK1(SIC_UNMASK_ALL);
- # endif
- #else
- bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
- #endif
- local_irq_disable();
- #if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
- /* Clear EMAC Interrupt Status bits so we can demux it later */
- bfin_write_EMAC_SYSTAT(-1);
- #endif
- #ifdef CONFIG_BF54x
- # ifdef CONFIG_PINTx_REASSIGN
- pint[0]->assign = CONFIG_PINT0_ASSIGN;
- pint[1]->assign = CONFIG_PINT1_ASSIGN;
- pint[2]->assign = CONFIG_PINT2_ASSIGN;
- pint[3]->assign = CONFIG_PINT3_ASSIGN;
- # endif
- /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
- init_pint_lut();
- #endif
- for (irq = 0; irq <= SYS_IRQS; irq++) {
- if (irq <= IRQ_CORETMR)
- set_irq_chip(irq, &bfin_core_irqchip);
- else
- set_irq_chip(irq, &bfin_internal_irqchip);
- switch (irq) {
- #if defined(CONFIG_BF53x)
- case IRQ_PROG_INTA:
- # if defined(BF537_FAMILY) && !(defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE))
- case IRQ_MAC_RX:
- # endif
- #elif defined(CONFIG_BF54x)
- case IRQ_PINT0:
- case IRQ_PINT1:
- case IRQ_PINT2:
- case IRQ_PINT3:
- #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
- case IRQ_PORTF_INTA:
- case IRQ_PORTG_INTA:
- case IRQ_PORTH_INTA:
- #elif defined(CONFIG_BF561)
- case IRQ_PROG0_INTA:
- case IRQ_PROG1_INTA:
- case IRQ_PROG2_INTA:
- #elif defined(CONFIG_BF538) || defined(CONFIG_BF539)
- case IRQ_PORTF_INTA:
- #endif
- set_irq_chained_handler(irq,
- bfin_demux_gpio_irq);
- break;
- #ifdef BF537_GENERIC_ERROR_INT_DEMUX
- case IRQ_GENERIC_ERROR:
- set_irq_chained_handler(irq, bfin_demux_error_irq);
- break;
- #endif
- #if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
- case IRQ_TIMER0:
- set_irq_handler(irq, handle_percpu_irq);
- break;
- #endif
- #ifdef CONFIG_SMP
- case IRQ_SUPPLE_0:
- case IRQ_SUPPLE_1:
- set_irq_handler(irq, handle_percpu_irq);
- break;
- #endif
- default:
- #ifdef CONFIG_IPIPE
- /*
- * We want internal interrupt sources to be masked, because
- * ISRs may trigger interrupts recursively (e.g. DMA), but
- * interrupts are _not_ masked at CPU level. So let's handle
- * them as level interrupts.
- */
- set_irq_handler(irq, handle_level_irq);
- #else /* !CONFIG_IPIPE */
- set_irq_handler(irq, handle_simple_irq);
- #endif /* !CONFIG_IPIPE */
- break;
- }
- }
- #ifdef BF537_GENERIC_ERROR_INT_DEMUX
- for (irq = IRQ_PPI_ERROR; irq <= IRQ_UART1_ERROR; irq++)
- set_irq_chip_and_handler(irq, &bfin_generic_error_irqchip,
- handle_level_irq);
- #endif
- /* if configured as edge, then will be changed to do_edge_IRQ */
- for (irq = GPIO_IRQ_BASE; irq < NR_IRQS; irq++)
- set_irq_chip_and_handler(irq, &bfin_gpio_irqchip,
- handle_level_irq);
- bfin_write_IMASK(0);
- CSYNC();
- ilat = bfin_read_ILAT();
- CSYNC();
- bfin_write_ILAT(ilat);
- CSYNC();
- printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n");
- /* IMASK=xxx is equivalent to STI xx or bfin_irq_flags=xx,
- * local_irq_enable()
- */
- program_IAR();
- /* Therefore it's better to setup IARs before interrupts enabled */
- search_IAR();
- /* Enable interrupts IVG7-15 */
- bfin_irq_flags |= IMASK_IVG15 |
- IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
- IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
- #ifdef SIC_IWR0
- bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
- # ifdef SIC_IWR1
- /* BF52x/BF51x system reset does not properly reset SIC_IWR1 which
- * will screw up the bootrom as it relies on MDMA0/1 waking it
- * up from IDLE instructions. See this report for more info:
- * http://blackfin.uclinux.org/gf/tracker/4323
- */
- if (ANOMALY_05000435)
- bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
- else
- bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
- # endif
- # ifdef SIC_IWR2
- bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
- # endif
- #else
- bfin_write_SIC_IWR(IWR_DISABLE_ALL);
- #endif
- #ifdef CONFIG_IPIPE
- for (irq = 0; irq < NR_IRQS; irq++) {
- struct irq_desc *desc = irq_desc + irq;
- desc->ic_prio = __ipipe_get_irq_priority(irq);
- desc->thr_prio = __ipipe_get_irqthread_priority(irq);
- }
- #endif /* CONFIG_IPIPE */
- return 0;
- }
- #ifdef CONFIG_DO_IRQ_L1
- __attribute__((l1_text))
- #endif
- void do_irq(int vec, struct pt_regs *fp)
- {
- if (vec == EVT_IVTMR_P) {
- vec = IRQ_CORETMR;
- } else {
- struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst;
- struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop;
- #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
- || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
- unsigned long sic_status[3];
- if (smp_processor_id()) {
- #ifdef CONFIG_SMP
- /* This will be optimized out in UP mode. */
- sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0();
- sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1();
- #endif
- } else {
- sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
- sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
- }
- #ifdef CONFIG_BF54x
- sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
- #endif
- for (;; ivg++) {
- if (ivg >= ivg_stop) {
- atomic_inc(&num_spurious);
- return;
- }
- if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag)
- break;
- }
- #else
- unsigned long sic_status;
- sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR();
- for (;; ivg++) {
- if (ivg >= ivg_stop) {
- atomic_inc(&num_spurious);
- return;
- } else if (sic_status & ivg->isrflag)
- break;
- }
- #endif
- vec = ivg->irqno;
- }
- asm_do_IRQ(vec, fp);
- }
- #ifdef CONFIG_IPIPE
- int __ipipe_get_irq_priority(unsigned irq)
- {
- int ient, prio;
- if (irq <= IRQ_CORETMR)
- return irq;
- for (ient = 0; ient < NR_PERI_INTS; ient++) {
- struct ivgx *ivg = ivg_table + ient;
- if (ivg->irqno == irq) {
- for (prio = 0; prio <= IVG13-IVG7; prio++) {
- if (ivg7_13[prio].ifirst <= ivg &&
- ivg7_13[prio].istop > ivg)
- return IVG7 + prio;
- }
- }
- }
- return IVG15;
- }
- int __ipipe_get_irqthread_priority(unsigned irq)
- {
- int ient, prio;
- int demux_irq;
- /* The returned priority value is rescaled to [0..IVG13+1]
- * with 0 being the lowest effective priority level. */
- if (irq <= IRQ_CORETMR)
- return IVG13 - irq + 1;
- /* GPIO IRQs are given the priority of the demux
- * interrupt. */
- if (IS_GPIOIRQ(irq)) {
- #if defined(CONFIG_BF54x)
- u32 bank = PINT_2_BANK(irq2pint_lut[irq - SYS_IRQS]);
- demux_irq = (bank == 0 ? IRQ_PINT0 :
- bank == 1 ? IRQ_PINT1 :
- bank == 2 ? IRQ_PINT2 :
- IRQ_PINT3);
- #elif defined(CONFIG_BF561)
- demux_irq = (irq >= IRQ_PF32 ? IRQ_PROG2_INTA :
- irq >= IRQ_PF16 ? IRQ_PROG1_INTA :
- IRQ_PROG0_INTA);
- #elif defined(CONFIG_BF52x)
- demux_irq = (irq >= IRQ_PH0 ? IRQ_PORTH_INTA :
- irq >= IRQ_PG0 ? IRQ_PORTG_INTA :
- IRQ_PORTF_INTA);
- #else
- demux_irq = irq;
- #endif
- return IVG13 - PRIO_GPIODEMUX(demux_irq) + 1;
- }
- /* The GPIO demux interrupt is given a lower priority
- * than the GPIO IRQs, so that its threaded handler
- * unmasks the interrupt line after the decoded IRQs
- * have been processed. */
- prio = PRIO_GPIODEMUX(irq);
- /* demux irq? */
- if (prio != -1)
- return IVG13 - prio;
- for (ient = 0; ient < NR_PERI_INTS; ient++) {
- struct ivgx *ivg = ivg_table + ient;
- if (ivg->irqno == irq) {
- for (prio = 0; prio <= IVG13-IVG7; prio++) {
- if (ivg7_13[prio].ifirst <= ivg &&
- ivg7_13[prio].istop > ivg)
- return IVG7 - prio;
- }
- }
- }
- return 0;
- }
- /* Hw interrupts are disabled on entry (check SAVE_CONTEXT). */
- #ifdef CONFIG_DO_IRQ_L1
- __attribute__((l1_text))
- #endif
- asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
- {
- struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop;
- struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst;
- int irq;
- if (likely(vec == EVT_IVTMR_P)) {
- irq = IRQ_CORETMR;
- goto handle_irq;
- }
- SSYNC();
- #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
- {
- unsigned long sic_status[3];
- sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
- sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
- #ifdef CONFIG_BF54x
- sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
- #endif
- for (;; ivg++) {
- if (ivg >= ivg_stop) {
- atomic_inc(&num_spurious);
- return 0;
- }
- if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag)
- break;
- }
- }
- #else
- {
- unsigned long sic_status;
- sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR();
- for (;; ivg++) {
- if (ivg >= ivg_stop) {
- atomic_inc(&num_spurious);
- return 0;
- } else if (sic_status & ivg->isrflag)
- break;
- }
- }
- #endif
- irq = ivg->irqno;
- if (irq == IRQ_SYSTMR) {
- bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */
- /* This is basically what we need from the register frame. */
- __raw_get_cpu_var(__ipipe_tick_regs).ipend = regs->ipend;
- __raw_get_cpu_var(__ipipe_tick_regs).pc = regs->pc;
- if (!ipipe_root_domain_p)
- __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10;
- else
- __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10;
- }
- handle_irq:
- ipipe_trace_irq_entry(irq);
- __ipipe_handle_irq(irq, regs);
- ipipe_trace_irq_exit(irq);
- if (ipipe_root_domain_p)
- return !test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status));
- return 0;
- }
- #endif /* CONFIG_IPIPE */
|