Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Set up the interrupt priorities |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 3 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * Copyright 2005-2009 Analog Devices Inc. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 5 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | * Licensed under the GPL-2 or later. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/module.h> |
Mike Frysinger | 1f83b8f | 2007-07-12 22:58:21 +0800 | [diff] [blame] | 10 | #include <linux/irq.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 11 | #include <asm/blackfin.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 12 | |
Mike Frysinger | 9216bbc | 2008-08-14 14:35:20 +0800 | [diff] [blame] | 13 | void __init program_IAR(void) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 14 | { |
| 15 | /* Program the IAR0 Register with the configured priority */ |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 16 | bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 17 | ((CONFIG_IRQ_DMA1_ERROR - 7) << IRQ_DMA1_ERROR_POS) | |
| 18 | ((CONFIG_IRQ_DMA2_ERROR - 7) << IRQ_DMA2_ERROR_POS) | |
| 19 | ((CONFIG_IRQ_IMDMA_ERROR - 7) << IRQ_IMDMA_ERROR_POS) | |
| 20 | ((CONFIG_IRQ_PPI0_ERROR - 7) << IRQ_PPI0_ERROR_POS) | |
| 21 | ((CONFIG_IRQ_PPI1_ERROR - 7) << IRQ_PPI1_ERROR_POS) | |
| 22 | ((CONFIG_IRQ_SPORT0_ERROR - 7) << IRQ_SPORT0_ERROR_POS) | |
| 23 | ((CONFIG_IRQ_SPORT1_ERROR - 7) << IRQ_SPORT1_ERROR_POS)); |
| 24 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 25 | bfin_write_SIC_IAR1(((CONFIG_IRQ_SPI_ERROR - 7) << IRQ_SPI_ERROR_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 26 | ((CONFIG_IRQ_UART_ERROR - 7) << IRQ_UART_ERROR_POS) | |
| 27 | ((CONFIG_IRQ_RESERVED_ERROR - 7) << IRQ_RESERVED_ERROR_POS) | |
| 28 | ((CONFIG_IRQ_DMA1_0 - 7) << IRQ_DMA1_0_POS) | |
| 29 | ((CONFIG_IRQ_DMA1_1 - 7) << IRQ_DMA1_1_POS) | |
| 30 | ((CONFIG_IRQ_DMA1_2 - 7) << IRQ_DMA1_2_POS) | |
| 31 | ((CONFIG_IRQ_DMA1_3 - 7) << IRQ_DMA1_3_POS) | |
| 32 | ((CONFIG_IRQ_DMA1_4 - 7) << IRQ_DMA1_4_POS)); |
| 33 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 34 | bfin_write_SIC_IAR2(((CONFIG_IRQ_DMA1_5 - 7) << IRQ_DMA1_5_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 35 | ((CONFIG_IRQ_DMA1_6 - 7) << IRQ_DMA1_6_POS) | |
| 36 | ((CONFIG_IRQ_DMA1_7 - 7) << IRQ_DMA1_7_POS) | |
| 37 | ((CONFIG_IRQ_DMA1_8 - 7) << IRQ_DMA1_8_POS) | |
| 38 | ((CONFIG_IRQ_DMA1_9 - 7) << IRQ_DMA1_9_POS) | |
| 39 | ((CONFIG_IRQ_DMA1_10 - 7) << IRQ_DMA1_10_POS) | |
| 40 | ((CONFIG_IRQ_DMA1_11 - 7) << IRQ_DMA1_11_POS) | |
| 41 | ((CONFIG_IRQ_DMA2_0 - 7) << IRQ_DMA2_0_POS)); |
| 42 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 43 | bfin_write_SIC_IAR3(((CONFIG_IRQ_DMA2_1 - 7) << IRQ_DMA2_1_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 44 | ((CONFIG_IRQ_DMA2_2 - 7) << IRQ_DMA2_2_POS) | |
| 45 | ((CONFIG_IRQ_DMA2_3 - 7) << IRQ_DMA2_3_POS) | |
| 46 | ((CONFIG_IRQ_DMA2_4 - 7) << IRQ_DMA2_4_POS) | |
| 47 | ((CONFIG_IRQ_DMA2_5 - 7) << IRQ_DMA2_5_POS) | |
| 48 | ((CONFIG_IRQ_DMA2_6 - 7) << IRQ_DMA2_6_POS) | |
| 49 | ((CONFIG_IRQ_DMA2_7 - 7) << IRQ_DMA2_7_POS) | |
| 50 | ((CONFIG_IRQ_DMA2_8 - 7) << IRQ_DMA2_8_POS)); |
| 51 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 52 | bfin_write_SIC_IAR4(((CONFIG_IRQ_DMA2_9 - 7) << IRQ_DMA2_9_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 53 | ((CONFIG_IRQ_DMA2_10 - 7) << IRQ_DMA2_10_POS) | |
| 54 | ((CONFIG_IRQ_DMA2_11 - 7) << IRQ_DMA2_11_POS) | |
| 55 | ((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) | |
| 56 | ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) | |
| 57 | ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) | |
| 58 | ((CONFIG_IRQ_TIMER3 - 7) << IRQ_TIMER3_POS) | |
| 59 | ((CONFIG_IRQ_TIMER4 - 7) << IRQ_TIMER4_POS)); |
| 60 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 61 | bfin_write_SIC_IAR5(((CONFIG_IRQ_TIMER5 - 7) << IRQ_TIMER5_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 62 | ((CONFIG_IRQ_TIMER6 - 7) << IRQ_TIMER6_POS) | |
| 63 | ((CONFIG_IRQ_TIMER7 - 7) << IRQ_TIMER7_POS) | |
| 64 | ((CONFIG_IRQ_TIMER8 - 7) << IRQ_TIMER8_POS) | |
| 65 | ((CONFIG_IRQ_TIMER9 - 7) << IRQ_TIMER9_POS) | |
| 66 | ((CONFIG_IRQ_TIMER10 - 7) << IRQ_TIMER10_POS) | |
| 67 | ((CONFIG_IRQ_TIMER11 - 7) << IRQ_TIMER11_POS) | |
| 68 | ((CONFIG_IRQ_PROG0_INTA - 7) << IRQ_PROG0_INTA_POS)); |
| 69 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 70 | bfin_write_SIC_IAR6(((CONFIG_IRQ_PROG0_INTB - 7) << IRQ_PROG0_INTB_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 71 | ((CONFIG_IRQ_PROG1_INTA - 7) << IRQ_PROG1_INTA_POS) | |
| 72 | ((CONFIG_IRQ_PROG1_INTB - 7) << IRQ_PROG1_INTB_POS) | |
| 73 | ((CONFIG_IRQ_PROG2_INTA - 7) << IRQ_PROG2_INTA_POS) | |
| 74 | ((CONFIG_IRQ_PROG2_INTB - 7) << IRQ_PROG2_INTB_POS) | |
| 75 | ((CONFIG_IRQ_DMA1_WRRD0 - 7) << IRQ_DMA1_WRRD0_POS) | |
| 76 | ((CONFIG_IRQ_DMA1_WRRD1 - 7) << IRQ_DMA1_WRRD1_POS) | |
| 77 | ((CONFIG_IRQ_DMA2_WRRD0 - 7) << IRQ_DMA2_WRRD0_POS)); |
| 78 | |
Mike Frysinger | 39c9996 | 2010-10-19 18:44:23 +0000 | [diff] [blame] | 79 | bfin_write_SIC_IAR7(((CONFIG_IRQ_DMA2_WRRD1 - 7) << IRQ_DMA2_WRRD1_POS) | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 80 | ((CONFIG_IRQ_IMDMA_WRRD0 - 7) << IRQ_IMDMA_WRRD0_POS) | |
| 81 | ((CONFIG_IRQ_IMDMA_WRRD1 - 7) << IRQ_IMDMA_WRRD1_POS) | |
| 82 | ((CONFIG_IRQ_WDTIMER - 7) << IRQ_WDTIMER_POS) | |
| 83 | (0 << IRQ_RESERVED_1_POS) | (0 << IRQ_RESERVED_2_POS) | |
| 84 | (0 << IRQ_SUPPLE_0_POS) | (0 << IRQ_SUPPLE_1_POS)); |
| 85 | |
| 86 | SSYNC(); |
| 87 | } |