Michael Hennerich | dc26aec | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Set up the interrupt priorities |
Michael Hennerich | dc26aec | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 3 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * Copyright 2008 Analog Devices Inc. |
Michael Hennerich | dc26aec | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 5 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 6 | * Licensed under the GPL-2 or later. |
Michael Hennerich | dc26aec | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <linux/module.h> |
| 10 | #include <linux/irq.h> |
| 11 | #include <asm/blackfin.h> |
| 12 | |
| 13 | void __init program_IAR(void) |
| 14 | { |
| 15 | |
| 16 | /* Program the IAR0 Register with the configured priority */ |
| 17 | bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) | |
| 18 | ((CONFIG_IRQ_DMA0_ERROR - 7) << IRQ_DMA0_ERROR_POS) | |
| 19 | ((CONFIG_IRQ_PPI_ERROR - 7) << IRQ_PPI_ERROR_POS) | |
| 20 | ((CONFIG_IRQ_SPORT0_ERROR - 7) << IRQ_SPORT0_ERROR_POS) | |
| 21 | ((CONFIG_IRQ_SPORT1_ERROR - 7) << IRQ_SPORT1_ERROR_POS) | |
| 22 | ((CONFIG_IRQ_SPI0_ERROR - 7) << IRQ_SPI0_ERROR_POS) | |
| 23 | ((CONFIG_IRQ_UART0_ERROR - 7) << IRQ_UART0_ERROR_POS) | |
| 24 | ((CONFIG_IRQ_RTC - 7) << IRQ_RTC_POS)); |
| 25 | |
| 26 | bfin_write_SIC_IAR1(((CONFIG_IRQ_PPI - 7) << IRQ_PPI_POS) | |
| 27 | ((CONFIG_IRQ_SPORT0_RX - 7) << IRQ_SPORT0_RX_POS) | |
| 28 | ((CONFIG_IRQ_SPORT0_TX - 7) << IRQ_SPORT0_TX_POS) | |
| 29 | ((CONFIG_IRQ_SPORT1_RX - 7) << IRQ_SPORT1_RX_POS) | |
| 30 | ((CONFIG_IRQ_SPORT1_TX - 7) << IRQ_SPORT1_TX_POS) | |
| 31 | ((CONFIG_IRQ_SPI0 - 7) << IRQ_SPI0_POS) | |
| 32 | ((CONFIG_IRQ_UART0_RX - 7) << IRQ_UART0_RX_POS) | |
| 33 | ((CONFIG_IRQ_UART0_TX - 7) << IRQ_UART0_TX_POS)); |
| 34 | |
Yi Li | 6a01f23 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 35 | bfin_write_SIC_IAR2(((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) | |
| 36 | ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) | |
| 37 | ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) | |
Michael Hennerich | dc26aec | 2008-11-18 17:48:22 +0800 | [diff] [blame] | 38 | ((CONFIG_IRQ_PORTF_INTA - 7) << IRQ_PORTF_INTA_POS) | |
| 39 | ((CONFIG_IRQ_PORTF_INTB - 7) << IRQ_PORTF_INTB_POS) | |
| 40 | ((CONFIG_IRQ_MEM0_DMA0 - 7) << IRQ_MEM0_DMA0_POS) | |
| 41 | ((CONFIG_IRQ_MEM0_DMA1 - 7) << IRQ_MEM0_DMA1_POS) | |
| 42 | ((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS)); |
| 43 | |
| 44 | bfin_write_SIC_IAR3(((CONFIG_IRQ_DMA1_ERROR - 7) << IRQ_DMA1_ERROR_POS) | |
| 45 | ((CONFIG_IRQ_SPORT2_ERROR - 7) << IRQ_SPORT2_ERROR_POS) | |
| 46 | ((CONFIG_IRQ_SPORT3_ERROR - 7) << IRQ_SPORT3_ERROR_POS) | |
| 47 | ((CONFIG_IRQ_SPI1_ERROR - 7) << IRQ_SPI1_ERROR_POS) | |
| 48 | ((CONFIG_IRQ_SPI2_ERROR - 7) << IRQ_SPI2_ERROR_POS) | |
| 49 | ((CONFIG_IRQ_UART1_ERROR - 7) << IRQ_UART1_ERROR_POS) | |
| 50 | ((CONFIG_IRQ_UART2_ERROR - 7) << IRQ_UART2_ERROR_POS)); |
| 51 | |
| 52 | bfin_write_SIC_IAR4(((CONFIG_IRQ_CAN_ERROR - 7) << IRQ_CAN_ERROR_POS) | |
| 53 | ((CONFIG_IRQ_SPORT2_RX - 7) << IRQ_SPORT2_RX_POS) | |
| 54 | ((CONFIG_IRQ_SPORT2_TX - 7) << IRQ_SPORT2_TX_POS) | |
| 55 | ((CONFIG_IRQ_SPORT3_RX - 7) << IRQ_SPORT3_RX_POS) | |
| 56 | ((CONFIG_IRQ_SPORT3_TX - 7) << IRQ_SPORT3_TX_POS) | |
| 57 | ((CONFIG_IRQ_SPI1 - 7) << IRQ_SPI1_POS)); |
| 58 | |
| 59 | bfin_write_SIC_IAR5(((CONFIG_IRQ_SPI2 - 7) << IRQ_SPI2_POS) | |
| 60 | ((CONFIG_IRQ_UART1_RX - 7) << IRQ_UART1_RX_POS) | |
| 61 | ((CONFIG_IRQ_UART1_TX - 7) << IRQ_UART1_TX_POS) | |
| 62 | ((CONFIG_IRQ_UART2_RX - 7) << IRQ_UART2_RX_POS) | |
| 63 | ((CONFIG_IRQ_UART2_TX - 7) << IRQ_UART2_TX_POS) | |
| 64 | ((CONFIG_IRQ_TWI0 - 7) << IRQ_TWI0_POS) | |
| 65 | ((CONFIG_IRQ_TWI1 - 7) << IRQ_TWI1_POS) | |
| 66 | ((CONFIG_IRQ_CAN_RX - 7) << IRQ_CAN_RX_POS)); |
| 67 | |
| 68 | bfin_write_SIC_IAR6(((CONFIG_IRQ_CAN_TX - 7) << IRQ_CAN_TX_POS) | |
| 69 | ((CONFIG_IRQ_MEM1_DMA0 - 7) << IRQ_MEM1_DMA0_POS) | |
| 70 | ((CONFIG_IRQ_MEM1_DMA1 - 7) << IRQ_MEM1_DMA1_POS)); |
| 71 | |
| 72 | SSYNC(); |
| 73 | } |